How to process an array of image data?

Asked by Walter on 26 Jun 2013 at 20:41
Latest activity Commented on by Walter about 13 hours ago

Hello. I am new to image processing so any help is appreciated. I have been trying to figure out how to use the image data from a camera and display it with Matlab. The image data was all initially given to me as a very long array of 230400 numbers that ranged from 0 to 255. Several different sources make it seem like this image could be rgb8 or ycbcr. I originally divided the picture to be 240x960 but noticed vertical lines and realized that the image probably needed to be divided into separate blocks. I then made the 230400 array into a 240x320x3 matrix. Each of the 3 sections do show up as if they are the same image but with different variations. I used image() and imshow() to display the 240x320x3 image but it doesn't appear as I wish. Below is the final image and the separate sections.

If the images don't appear, I'm sorry, and will try to fix them.

If there are any suggestions on how to get my image to be more clear, please let me know. Thanks.

0 Comments

Walter

1 Answer

Answer by Image Analyst on 26 Jun 2013 at 20:53

How are you displaying these? It looks like you used imagesc() which applies some weird colormap by default. If you used image() or imshow() then you applied some colormap - what was it? Or maybe it is ycbcr and combined it just looks bizarre because imshow assumes the color channels are R, G, and B, not Y, Cb, and Cr. There is a function ycbcr2rgb you could try before displaying it. Make sure the image is uint8 before you display it.

6 Comments

Walter on 27 Jun 2013 at 20:18

I actually cannot see my device through the Image Acquisition Toolbox probably because it is being processed through another program. My overall goal is to use Matlab to map and localize an area with the AR Drone. I am using ROS to get data from an AR drone. The data is then sent through a program that allows Matlab to speak with ROS topics. So from Matlab I just get a 230400 array of data that comes from a topic on ROS. There is no file but only data from the camera. Is there any simple way that you know of that connects the Image Acquisition Toolbox to the AR Drone so that I can see if the camera seems to display properly on there? imaqfind doens't find any connections so I'm not sure what to do to fix that issue.

Image Analyst on 27 Jun 2013 at 21:00

It might be possible if you can connect your camera to your computer but if you don't have the correct drivers for it, and the correct video adapter for the MATLAB interface, then it might show up with a generic winvideo adapter (that is if windows device manager even sees it, which is required first before MATLAB has any hope of seeing it). If it shows up with a winvideo adapter, then there may be several modes available to use, and there's no guarantee that the one you picked is the same as the one used to create the videos you were given. Your best bet is to do some more research to find out what is the format of the file you were given.

Walter about 13 hours ago

Thanks for the help but I finally found the problem was with other software that I was using. There was an overflow problem that made the data not show up as intended.

Image Analyst

Contact us