Having trouble with the image aq

1 Ansicht (letzte 30 Tage)
Robert
Robert am 15 Feb. 2016
Beantwortet: Image Analyst am 15 Feb. 2016
Hi
So i just got the image Aq toolbox and I'm trying to following a bit of example code on the math works site
Im working on the second part of the example and i don't understand the following
imageData = getdata(vidobj, 30);
So i used the help menu and i gather this function is setting the variable imageData to a 3d array containing frame #30 from my video object.
ok fine that makes sense
to display the frame to see it, it tells me to use this bit of code. If i have already assigned the imageData variable to frame 30 what is the 30 at the end of the function do. If i change it, it appears to change the frame but how is that possible?
Im using the FaceTime camera built into my macbook air. Ive also notices that my frames are very dark and distorted even in a brightly lit room.
Can someone help me understand this line and possibly why my images are all dark and grainy? When i do a preview the images have proper resolution and are full of color like you would expect Thanks
imagesc(imageData(:,:,:,30))

Antworten (2)

Walter Roberson
Walter Roberson am 15 Feb. 2016
imageData = getdata(vidobj, 30); is going to return the first 30 logged frames remaining in the buffer, not the 30'th logged frame. The result is going to be height by width by number of channels by 30.
If you are getting RGB images then you should use
image(imageData(:,:,:,30))
instead of imagesc()
  1 Kommentar
Robert
Robert am 15 Feb. 2016
Bearbeitet: Robert am 15 Feb. 2016
I apoligize im not exactly sure if they are RGB or a different format. I just tried image instead of imagesc and i get the same result. Dark and grainy. I was playing around with the imaqtool and i found that when i changed the format to RGB the image look better in the imaqtool gui. When i look at the structure for the video object its says its format is YCbCr422_1280x720 (default)
as i was saying above the imagesc and image are giving me the same results
what do i do to get it to look correct?
I also noticed that if say to take 500 frames per trigger the camera comes on for around 3-4 seconds or so. How do i find out how many FPS the camera is running at.

Melden Sie sich an, um zu kommentieren.


Image Analyst
Image Analyst am 15 Feb. 2016
Try this:
vidobj.ReturnedColorspace = 'rgb';

Community Treasure Hunt

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

Start Hunting!

Translated by