Save Video on XPC Target

I am getting a video stream from my xpc target machine via USB webcam, but I would like to be able to save the video file to the internal Hard Drive of my target machine. Does anyone know how to go about doing this?

Respuestas (2)

Kaustubha Govind
Kaustubha Govind el 23 de Mayo de 2012

0 votos

Not a 100% sure that this is the right solution, but how about connecting the output of the webcam driver to a xPC File Scope block?

12 comentarios

Nicholas
Nicholas el 25 de Mayo de 2012
I've tried to use the XPC file scope block, but it appears that it can't take two-dimensional signals. Even after saving R,G,B channels independently, I still get an invalid dimension error.
Kaustubha Govind
Kaustubha Govind el 29 de Mayo de 2012
Are the signals still 2-D even after splitting into R, G and B channels? Try turning on Format>Port/Signal Displays>Signal Dimensions and see if anything seems off?
Nicholas
Nicholas el 31 de Mayo de 2012
Yes. The signals are 2-D after splitting into R,G,B channels and the xpc file scope block seems to not accept a 2 dimensional signal.
Kaustubha Govind
Kaustubha Govind el 31 de Mayo de 2012
Perhaps you could split those further into 1-D signals? Not sure if there is a way to log 2-D or n-D signals to disk with xPC Target. Please consider putting in an enhancement request with MathWorks Technical Support for this.
Nicholas
Nicholas el 1 de Jun. de 2012
I was considering that, but the input image is a [480 640] image matrix. I split that into 1D signals, I would either have 480 row vectors or 640 column vectors, which I'm almost certain xpc target cannot support.
Walter Roberson
Walter Roberson el 1 de Jun. de 2012
I thought there was a reshape block?
Nicholas
Nicholas el 2 de Jun. de 2012
Thanks Walter, I'll try this out on Monday when I have access to the Target machine
Walter Roberson
Walter Roberson el 2 de Jun. de 2012
http://www.mathworks.com/help/toolbox/simulink/slref/reshape.html
Nicholas
Nicholas el 8 de Jun. de 2012
Walter, I tried your suggestion on the R channel of an RGB image, and it seemed to reshape the 640*480 matrix to a single column vector (which is necessary to save on xpc target). The problem was that when I tried to retrieve the data, it appears that xpc target only recorded one value (perhaps the first element in the column matrix) per sample time. Therefore, I only was able to retrieve one value for every sample time.
I'm somewhat lost as to any other way I could save video to xpc target. As I've already mentioned, wireless transmission then saving on another computer is not an option since the target machine is used on a mobile robot that moves out of range of the wireless network.
Kaustubha Govind
Kaustubha Govind el 8 de Jun. de 2012
Nicholas: Sorry, I'm out of ideas. Could you try contacting MathWorks Tech Support to see if they have a better solution?
Nicholas
Nicholas el 8 de Jun. de 2012
Thanks for your help. I've contacted technical support for assistance.
Aram Simonian
Aram Simonian el 29 de Oct. de 2012
Hi, I have exactly the same problem. The only difference is that I use a CameraLink camera. What did the MathWorks support suggest to you? Thanks for any advice.

Iniciar sesión para comentar.

Pika
Pika el 21 de Sept. de 2018

0 votos

Can you give me some explanation about how to read usb camera? I have set up a target, which works well without reading usb camera. After add the usb video device module to the model, the following problems exist: (1) This usb video device module can not detect the camera connected to the target. If I connect this camera to the development computer, it works well with the vision machine toolbox. (2) This application can be loaded to the target, but I cannot start it and a error message "Video device is not found" is displayed.

Preguntada:

el 23 de Mayo de 2012

Respondida:

el 21 de Sept. de 2018

Community Treasure Hunt

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

Start Hunting!

Translated by