Simulink: Sending Android Camera Data To Workspace

Hello,
I'm trying to take a video with my Android camera and send it to the workspace where I can analyze it. In Simulink, I've connected the Android Camera block to the Video to Workspace Block (see image) and have tried deploying the app to the hardware and running Simulink on external mode. Both methods send a variable to the workspace that is a zero array, like the video is not being transferred correctly. I've run both the "Communicating with Android" and the " Getting Started with Android" examples and both are communicating correctly with my phone. I've checked out the documentation for both these block and everything seems like it should work. Is there something that I'm overlooking?
Thanks, Ian

 Respuesta aceptada

Saurabh Gupta
Saurabh Gupta el 31 de Jul. de 2017

0 votos

Both external mode simulation and deployment are based on code generation. It seems that the ' Video to Workspace' block is ignored during code generation, which would explain the output full of zeros. You can verify this using the Simulink menu option "Help > Simulink > Block Data Types & Code Generation Support > All Tables".
As an alternative, you may want to try writing the video to a file ( binary file or multimedia file ) and post-processing that file for analysis.
Hope this helps!

4 comentarios

Ian Liu
Ian Liu el 1 de Ag. de 2017
I hooked up the Android Camera block to the To Multimedia File block and it doesn't create a file in the specified location. All the settings between the blocks appear to be consistent. I have a feeling that the File block cannot continuously send data that it is receiving to the file or something. Might this be the case? If so, how could I compile each of the frames that the camera is capturing before sending it to the To Multimedia File block?
Thanks
It does send data to the file by sampling frames. You can view that as an example in demo model 'ex_export_avi'.
I am guessing that since you are using it in either external mode simulation or deployed code, you might be running into some code generation limitations of the 'To Multimedia' block.
Have you tried writing to a binary file as an alternative?
Ian Liu
Ian Liu el 2 de Ag. de 2017
I'll give it a shot. I need to figure out how to convert the RGB Android camera output to Y Cr Cb first. If there are any easy ways of doing this, give me hint!
Thanks!
Color Space Conversion block might come in handy here.

Iniciar sesión para comentar.

Más respuestas (0)

Categorías

Más información sobre Android Devices en Centro de ayuda y File Exchange.

Preguntada:

el 27 de Jul. de 2017

Comentada:

el 2 de Ag. de 2017

Community Treasure Hunt

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

Start Hunting!

Translated by