Video frames not displaying properly

I am trying to display video frames, but they're showing up incorrectly.
I'm using MATLAB R2019b, a Point Grey Flea3 camera, the "Image Acquisition Toolbox Support Package for Point Grey Hardware," Point Grey FlyCap2, and the following code:
vid = videoinput('winvideo', 1, 'RGB32_1600x1200');
set(vid,'FramesPerTrigger',Inf);
set(vid,'ReturnedColorSpace','rgb');
vid.FrameGrabInterval = 5;
start(vid);
while(vid.FramesAcquired <= 100)
data = getsnapshot(vid);
imshow(data);
end
stop(vid);
flushdata(vid);
clear all;
Previously, the video would display as expected, but for some reason I now get results like the attached image. The video looks fine in FlyCap.

5 件のコメント

Walter Roberson
Walter Roberson 2021 年 10 月 8 日
It sort of looks like the internal YUV was in "packed" format and was converted incorrectly to RGB
Ward
Ward 2021 年 10 月 8 日
That's exactly what was wrong, thank you! For anyone else having the same problem, changing the video mode to RGB in FlyCap is what fixed it.
Walter Roberson
Walter Roberson 2021 年 10 月 8 日
I would have expected set(vid,'ReturnedColorSpace','rgb'); to do that for you...
Ward
Ward 2021 年 10 月 8 日
Oh, I'll try that, thanks!
Walter Roberson
Walter Roberson 2021 年 10 月 9 日
You already did that; I am surprised it did not work. But anyhow, setting RGB in FlyCap got you working, and that's the important part for now.

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

回答 (0 件)

製品

リリース

R2019b

質問済み:

2021 年 10 月 8 日

コメント済み:

2021 年 10 月 9 日

Community Treasure Hunt

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

Start Hunting!

Translated by