How to troubleshoot no video in a MATLAB compiled standalone executable?
    11 Ansichten (letzte 30 Tage)
  
       Ältere Kommentare anzeigen
    
    hollingswood
 am 13 Jan. 2016
  
    
    
    
    
    Kommentiert: Ondrej Hala
 am 11 Sep. 2016
            I'm trying to create a MATLAB compiled application that uses an Allied Vision GigE camera. My code works fine when running in MATLAB directly, but when I run the compiled standalone executable (I am using the files in the for testing folder), the figure does not display the live video, only a white box with a red x. I have no errors and all required support packages are installed.
Matlab and hardware support packages are already installed on the PC. The version of MATLAB is R2015b.
I'm not sure where to start to troubleshoot? Does the testing version not support live video?
0 Kommentare
Akzeptierte Antwort
  Adithya Addanki
    
 am 15 Jan. 2016
        Hi,
There has been a similar issue identified before, however we are still investigating this further to identify the root cause.
Gladly, there is a workaround. It is usually recommended to use WAITFOR with a figure handle before the end of the main function, so that the videoinput object does not get deleted.
For instance:
v = videoinput('winvideo', 1)
vidRes = v.VideoResolution;
nBands = v.NumberOfBands;
hFig = figure;
himg1 = image(zeros(vidRes(2), vidRes(1), nBands));
disp(himg1.Parent)
preview(v, himg1);
waitfor(hFig);
delete(v);
Please try reproducing the issue after making use of "waitfor".
Thank you,
Adithya
1 Kommentar
  Ondrej Hala
 am 11 Sep. 2016
				Hello, it's not woking for me, what am I doing wrong? I am beginner in MATLAB. I have the same issue. It's working in Matlab, but not after compile the code.
This is my callback function for Connect Camera Button.
function ConnectCameraButton_Callback(hObject, eventdata, handles)
global CameraID
global CameraInput
axes(handles.CameraInputAxes);
CameraInput = videoinput('gige', CameraID, 'Mono8');
src = getselectedsource(CameraInput);
src.ExposureTimeAbs = 9000;
src.AcquisitionFrameRateAbs = 8.0;
hFig = figure;
hImage = image(zeros(1038, 1388, 1), 'Parent', handles.CameraInputAxes);
camroll(handles.CameraInputAxes, 90);
disp(hImage.Parent)
preview(CameraInput, hImage);
waitfor(hFig);
delete(CameraInput);
Weitere Antworten (0)
Siehe auch
Kategorien
				Mehr zu GigE Vision Hardware finden Sie in Help Center und File Exchange
			
	Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!


