Having trouble with the image aq

4 ビュー (過去 30 日間)
Robert
Robert 2016 年 2 月 15 日
回答済み: Image Analyst 2016 年 2 月 15 日
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))

回答 (2 件)

Walter Roberson
Walter Roberson 2016 年 2 月 15 日
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 件のコメント
Robert
Robert 2016 年 2 月 15 日
編集済み: Robert 2016 年 2 月 15 日
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.

サインインしてコメントする。


Image Analyst
Image Analyst 2016 年 2 月 15 日
Try this:
vidobj.ReturnedColorspace = 'rgb';

カテゴリ

Help Center および File ExchangeComputer Vision with Simulink についてさらに検索

Community Treasure Hunt

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

Start Hunting!

Translated by