Problem compile imaq.VideoDevice to Standard Alone(.exe)

2 ビュー (過去 30 日間)
williamx
williamx 2015 年 8 月 17 日
編集済み: williamx 2015 年 8 月 18 日
I'm able to run the GUI code in MATLAB but when compiled to .exe and run it
I got the error Undefined function or variable 'imaqslgate'
I suppose Image Acquisition Toolbox is able to compile to .exe right?
Using MATLAB R2015a and build in webcam
Thanks.
Code
function pushbutton1_Callback(hObject, eventdata, handles)
vid = imaq.VideoDevice('winvideo', 1, 'MJPG_640x480', 'ROI', [1 1 640 480], ...
'ReturnedColorSpace', 'rgb', ...
'DeviceProperties.Brightness', 0, ...
'DeviceProperties.Sharpness', 15);
videoPlayer = vision.VideoPlayer('Name','Camera Preview','Position',[510 320 660 520]);
while(1)
videoFrame = step(vid);
imshow(videoFrame,handles.axes1)
step(videoPlayer,videoFrame);
end
Error
Undefined function or variable 'imaqslgate'.
Error in imaq.internal.Utility.getDeviceList (line 26)
Error in imaq.internal.VideoDeviceInternal (line 238)
Error in imaq.VideoDevice (line 270)
Error in test>pushbutton1_Callback (line 80)
Error in gui_mainfcn (line 95)
Error in test (line 42)
Error in @(hObject,eventdata)test('pushbutton1_Callback',hObject,eventdata,guida
ta(hObject))
Error while evaluating UIControl Callback
  2 件のコメント
Walter Roberson
Walter Roberson 2015 年 8 月 17 日
I do not know why you are getting the imaqslgate problem, but why are you using both imshow() for the image and using videoPlayer to display the image?
williamx
williamx 2015 年 8 月 17 日
編集済み: williamx 2015 年 8 月 17 日
Imshow() To display video on the gui axes. Which I will do some object detection and display on the axes. This is just a simplified code.

サインインしてコメントする。

採用された回答

Madhura Suresh
Madhura Suresh 2015 年 8 月 18 日
Hi William,
Check this bug report out:
https://www.mathworks.com/support/bugreports/1162560
There is also a workaround.
Thanks, Madhura

その他の回答 (1 件)

Madhura Suresh
Madhura Suresh 2015 年 8 月 17 日
How are you running the executable? Within MATLAB using the ! operator, or double clicking it outside MATLAB? Either way, can you close MATLAB (if its running) or run IMAQRESET in MATLAB before running the exe? Just to make sure that the hardware is not in use.
  1 件のコメント
williamx
williamx 2015 年 8 月 18 日
編集済み: williamx 2015 年 8 月 18 日
Well i tried running the executable without MATLAB running and also IMAQRESET before closing MATLAB. Thank you anyway. Hope i can solve it or someone can provide me a simple executable with just 1 button to enable my camera.

サインインしてコメントする。

カテゴリ

Help Center および File ExchangeImage Processing and Computer Vision についてさらに検索

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by