Subversion Repositories seema-scanner

Rev

Rev 28 | Rev 155 | Go to most recent revision | Only display areas with differences | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 28 Rev 154
1
%CAMERA Matlab wrapper class for the Camera C++ class.
1
%CAMERA Matlab wrapper class for the Camera C++ class.
2
% Gives low level access to custom industrial cameras by wrapping their
2
% Gives low level access to custom industrial cameras by wrapping their
3
% API. Currently libdc1394 IIDC and IDS Imaging uEye are implemented.
3
% API. Currently libdc1394 IIDC and IDS Imaging uEye are implemented.
4
%
4
%
5
% Jakob Wilm, DTU 2013
5
% Jakob Wilm, DTU 2015
6
 
6
 
7
classdef Camera < handle
7
classdef Camera < handle
8
    properties (SetAccess = private, Hidden = true)
8
    properties (SetAccess = private, Hidden = true)
9
        objectHandle; % Handle to the underlying C++ class instance
9
        objectHandle; % Handle to the underlying C++ class instance
10
    end
10
    end
11
    methods (Static = true)
11
    methods (Static = true)
12
        function varargout = GetInterfaceCameraList
12
        function varargout = GetInterfaceCameraList
13
            [varargout{1:nargout}] = CameraMex('GetInterfaceCameraList');
13
            [varargout{1:nargout}] = CameraMex('GetInterfaceCameraList');
14
        end
14
        end
15
    end
15
    end
16
    methods
16
    methods
17
        % Constructor - Create a new C++ class instance 
17
        % Constructor - Create a new C++ class instance 
18
        function this = Camera(interfaceNum, cameraNum)
18
        function this = Camera(interfaceNum, cameraNum)
19
            this.objectHandle = CameraMex('NewCamera', interfaceNum, cameraNum);
19
            this.objectHandle = CameraMex('NewCamera', interfaceNum, cameraNum);
20
        end
20
        end
21
        
21
        
22
        % Destructor - Destroy the C++ class instance
22
        % Destructor - Destroy the C++ class instance
23
        function delete(this)
23
        function delete(this)
24
            CameraMex('delete', this.objectHandle);
24
            CameraMex('delete', this.objectHandle);
25
        end
25
        end
26
        
26
        
27
        % startCapture
27
        % startCapture
28
        function startCapture(this)
28
        function startCapture(this)
29
            CameraMex('startCapture', this.objectHandle);
29
            CameraMex('startCapture', this.objectHandle);
30
        end
30
        end
31
        
31
        
32
        % stopCapture
32
        % stopCapture
33
        function stopCapture(this)
33
        function stopCapture(this)
34
            CameraMex('stopCapture', this.objectHandle);
34
            CameraMex('stopCapture', this.objectHandle);
35
        end
35
        end
36
        
36
        
37
        % trigger
37
        % trigger
38
        function trigger(this)
38
        function trigger(this)
39
            CameraMex('trigger', this.objectHandle);
39
            CameraMex('trigger', this.objectHandle);
40
        end
40
        end
41
 
41
 
42
        % getFrame
42
        % getFrame
43
        function varargout = getFrame(this)
43
        function varargout = getFrame(this)
44
            frame = CameraMex('getFrame', this.objectHandle);
44
            frame = CameraMex('getFrame', this.objectHandle);
45
            [varargout{1:nargout}] = permute(frame,[3 2 1]);
45
            [varargout{1:nargout}] = permute(frame,[3 2 1]);
46
        end
46
        end
-
 
47
			
-
 
48
        % setSettings
-
 
49
        function varargout = setSettings(this, gain, shutter)
-
 
50
            frame = CameraMex('setSettings', this.objectHandle, gain, shutter);
-
 
51
        end
47
        
52
        
48
    end
53
    end
49
end
54
end
50
 
55