SIMULINK Code Generation with USB Webcam under Ubuntu
5 次查看(过去 30 天)
显示 更早的评论
Hello everybody,
Please find my complete setup at the bottom of this Post.
i am trying to integrate a USB Webcam in a SIMULINK model from which i want to generate and build a standalone application. I am trying to achieve this by two different ways:
1) Using the "From Video Device Block":
Therefore I simply use this model:
[From Video Device Block]->[Convert 2D to 1D]->[To File block] Building the model succedes but when i am trying to run it with sudo ./model i get: "Could not open library: libmwimaqmex.so" Copying libmwimaqmex.so to the folder where the compiled model lies did not solve the problem.
2) Using a MATLAB function block:
In the MATLAB function block i wrote the following code:
function y = fcn()
%#codegen
persistent vid
if isempty(vid)
vid = imaq.VideoDevice('linuxvideo');
end
img = step(vid);
y = 1;
Trying to build this model results in an error during building:
HostLib_rtw.o: In function `DestroyHostLibrary': HostLib_rtw.c:(.text+0x15): undefined reference to `dlclose' HostLib_rtw.o: In function `CreateHostLibrary': HostLib_rtw.c:(.text+0x93): undefined reference to `dlopen'
I had a look in the generated C files and i found in HostLib_rtw.h: include dlfcn.h So i thought that libdl.so should be linked somewhere.
Does anybody has some experience with this problems?
Here my complete setup:
OS: Ubuntu 14.04 LTS Kernel: 3.7.8-030708-generic (important cause with the kernel brought by 14.04 LTS, the USB Webcam cannot be used even with standard MATLAB Code)
2 个评论
Ketan
2014-6-17
For situation (1) try adding the directory containing libmwimaqmex.so to LD_LIBRARY_PATH
回答(3 个)
Kaustubha Govind
2014-6-16
Are you able to run the model using:
>> !sudo ./model
at the MATLAB prompt? If yes, it could be that libmwimaqmex.so needs additional dependencies that were not copied over (within MATLAB, the system PATH is correctly setup). You could try using the packngo utility to grab all dependencies.
Regarding the second issue, what happens if you include libdl.so in the Simulation Target>Custom Code>Libraries pane of the Configuration Parameters window? Also, please check the box that says "Use the same custom code settings as Simulation Target" on the Code Generation>Custom Code pane
3 个评论
Kaustubha Govind
2014-6-17
Timotheus: I wonder if you are missing some dependency files for libmwimaqmex.so - could you try using the nm or ldd utilities as documented in this solution to see why the OS is having trouble loading the library.
Ketan
2014-6-18
Kaustubha mentioned earlier to use packNGo to get all the needed dependent libraries. Have you tried that for situation (1)? This goes along with the idea of missing dependencies. See the following doc page:
RAVI CHEKURI
2020-3-2
Hi, does your problem got solved. Please help me I am also getting same error. When I run the standalone application generated from video device block . I am getting error of could not determine entry point functions in libmwimaqmex.so
0 个评论
另请参阅
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!