Hello swati,
It sounds like your MEX file is encountering a segmentation fault; I'm wasn't aware that FLIR offers a C/C++ API (I assume cv.h and/or highgui.h are include files for code provided by FLIR), but assuming the seg fault is in your code and not one of the FLIR-provided files, I'd check for the usual suspects (see http://en.wikipedia.org/wiki/Segmentation_fault#Common_causes if you haven't encountered seg faults before).
Regarding use of the FLIR ActiveX control: it's been a few years since I worked with it, but there are some general things I remember that might be of use to you:
- Once the FLIR ActiveX control is installed, check that MATLAB recognizes it using the actxcontrollist command. It should be listed as CAMCTRL.LVCamCtrl.#, where # is some apparently random number (it varied by computer when I used the FLIR SDK).
- The properties and methods for the FLIR ActiveX control should be listed in the documentation for the FLIR SDK. I don't recall off the top of my head how to access an ActiveX control's methods from MATLAB, but this documentation page is probably a good place to start: http://www.mathworks.com/help/matlab/ref/actxcontrol.html
- I was able to locate one of my old test files that uses the FLIR ActiveX control to load an already-recorded sequence file and extract a couple of frames. I've included its code below; it's pretty basic, but it should be a decent place to start (even if you don't have any sequence files around, it shows how to start the FLIR ActiveX control and invoke its methods).
Hope that helps.
Will
=== SAMPLE MATLAB FLIR ACTIVEX CONTROL CODE ===
flir_fig = figure;
flir = actxcontrol('CAMCTRL.LVCamCtrl.3','parent',flir_fig);
% "Connecting" to a file device.
invoke(flir,'Connect',10,0,2,0,'0');
% Set path of sequence file to open.
pathToSequenceFile = 'C:\Seq Files\test838.SEQ';
invoke(flir,'SetCameraProperty',53,pathToSequenceFile);
% Get the number of frames in the sequence file.
num_frames = invoke(flir,'GetCameraProperty',76);
% Retrieve the current frame; for some reason it's transposed.
frame = invoke(flir,'GetImage',3);
figure
imagesc(frame');
% Change the current frame (note that the parameter must be cast as a long int).
frameNumber = 300;
invoke(flir,'SetCameraProperty',77,cast(frameNumber,'int32'));
frame = invoke(flir,'GetImage',3);
figure
imagesc(frame');
invoke(flir,'Disconnect');
clear flir;
close(flir_fig);
=== END SAMPLE CODE ===
It sounds like your MEX file is encountering a segmentation fault; I'm wasn't aware that FLIR offers a C/C++ API (I assume cv.h and/or highgui.h are include files for code provided by FLIR), but assuming the seg fault is in your code and not one of the FLIR-provided files, I'd check for the usual suspects (see http://en.wikipedia.org/wiki/Segmentation_fault#Common_causes if you haven't encountered seg faults before).
Regarding use of the FLIR ActiveX control: it's been a few years since I worked with it, but there are some general things I remember that might be of use to you:
- Once the FLIR ActiveX control is installed, check that MATLAB recognizes it using the actxcontrollist command. It should be listed as CAMCTRL.LVCamCtrl.#, where # is some apparently random number (it varied by computer when I used the FLIR SDK).
- The properties and methods for the FLIR ActiveX control should be listed in the documentation for the FLIR SDK. I don't recall off the top of my head how to access an ActiveX control's methods from MATLAB, but this documentation page is probably a good place to start: http://www.mathworks.com/help/matlab/ref/actxcontrol.html
- I was able to locate one of my old test files that uses the FLIR ActiveX control to load an already-recorded sequence file and extract a couple of frames. I've included its code below; it's pretty basic, but it should be a decent place to start (even if you don't have any sequence files around, it shows how to start the FLIR ActiveX control and invoke its methods).
Hope that helps.
Will
=== SAMPLE MATLAB FLIR ACTIVEX CONTROL CODE ===
flir_fig = figure;
flir = actxcontrol('CAMCTRL.LVCamCtrl.3','parent',flir_fig);
% "Connecting" to a file device.
invoke(flir,'Connect',10,0,2,0,'0');
% Set path of sequence file to open.
pathToSequenceFile = 'C:\Seq Files\test838.SEQ';
invoke(flir,'SetCameraProperty',53,pathToSequenceFile);
% Get the number of frames in the sequence file.
num_frames = invoke(flir,'GetCameraProperty',76);
% Retrieve the current frame; for some reason it's transposed.
frame = invoke(flir,'GetImage',3);
figure
imagesc(frame');
% Change the current frame (note that the parameter must be cast as a long int).
frameNumber = 300;
invoke(flir,'SetCameraProperty',77,cast(frameNumber,'int32'));
frame = invoke(flir,'GetImage',3);
figure
imagesc(frame');
invoke(flir,'Disconnect');
clear flir;
close(flir_fig);
=== END SAMPLE CODE ===