How to process an array of image data?
显示 更早的评论
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.
回答(1 个)
Image Analyst
2013-6-26
0 个投票
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 个评论
Walter
2013-6-27
Image Analyst
2013-6-27
I don't think it's a lighting issue - I think it's a colormap or colorspace issue. Are you using the Image Acquisition Toolbox? If so, what are the video modes that are listed? By the way, to display pictures you need to get something that ends in .jpg or some other format. I fixed your original question by clicking on the images in the links you posted until the URL showed an image file, not something ending in 5/ or something like that. Then I replaced your original URL with the one ending in .jpg. I think you're picking the wrong URL from tinypic. You want the last one that says "Direct Link for Layouts", not the one above it. Or for something simpler, use http://snag.gy where you simply paste the image in (copy the image to the clipboard first with ALt-PrintScreen).
Image Analyst
2013-6-27
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
2013-7-1
类别
在 帮助中心 和 File Exchange 中查找有关 Point Grey Hardware 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!



