realtime object tracking with webcam in Simulink

hi everybody!
I´m working for a project and I have a problem. First of all, my project is about realtime object tracking with a webcam in Simulink to track for example a red point bondet on a movable object. With the x and y coordinates of the red Point i want to contolle the object.
Right now i have a .m file where i can track red points, and the x and y coordinates will be putted out in the command window in realtime. But my problem is, i need the coordinates in realtime in Simulink, is that possible?
At the end I want a Simulink file, where i can start the simulation, the webcam should be started, and in the webcam live video shold be tracked the red object and giving me out the coordinates. is that possible?

1 comentario

Walter Roberson
Walter Roberson el 13 de Nov. de 2011
Real Time in simulink requires the Simulink Code Generator (previously known as Real Time Workshop), and a dedicated PC or embedded device with a Real Time Operating System (RTOS). MS Windows is not a RTOS and cannot handle real-time tasks.
There may be ways to speed up your existing code so that Simulink is usually able to run it "fast enough, considering", but real-time is a much more difficult constraint.

Iniciar sesión para comentar.

 Respuesta aceptada

Kaustubha Govind
Kaustubha Govind el 14 de Nov. de 2011

1 voto

Like Walter explained in his comment, MATLAB/Simulink are not exactly suited to perform "real-time" processing in the client mode (xPC Target and Real-Time Windows Target are the two products that allow real-time/rapid prototyping of Simulink models), but if you are willing to accept the performance of your Simulink model, you may be able to achieve a "soft" real-time system.
FYI, you may need to get the Image Acquisition Toolbox to obtain live images from a webcam (unless you are using unsupported hardware, in which case, you will need custom driver blocks) - you could get a demo license to try it out and see if the performance is satisfactory.

Más respuestas (2)

Daniel
Daniel el 14 de Nov. de 2011

0 votos

okay thanks for the information! i talked with my professor and he sad that maby a good solve of this problem is to program the realtime object tracking part in visual c++ (opencv) and send the coordinates via interprocess comunication ( UDP or TCP) in to simulink. there i can work with the realtime data (...with some delay)

1 comentario

Kaustubha Govind
Kaustubha Govind el 15 de Nov. de 2011
Yes, I suppose you could do that. Although, it might be easier for you to write a C/C++ S-function block to call into your opencv application directly at each time-step, instead of inter-process communication.

Iniciar sesión para comentar.

juhaina alrajhi
juhaina alrajhi el 7 de Abr. de 2017

0 votos

I think we have the same problem .. so please did you find what you are looking for yet??

Categorías

Preguntada:

el 13 de Nov. de 2011

Respondida:

el 7 de Abr. de 2017

Community Treasure Hunt

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

Start Hunting!

Translated by