convert frame from camera on laptop
정보
이 질문은 마감되었습니다. 편집하거나 답변을 올리려면 질문을 다시 여십시오.
이전 댓글 표시
i've got the code below:
vid=videoinput('winvideo',1,'YUY2_1024x768');
preview(vid);
for k = 1:10
frame = getsnapshot(vid);
end
frame1 = rgb2gray(frame);
figure,image(frame1);
level = graythresh(frame1);
frame3 = im2bw(frame1,level);
figure,image(frame3);
delete(vid);
closepreview(vid);
the problem here is that i don't know what type of image i can get from my camera on my laptop (RGB,HSV, or something else)! the result is not as i expect ! here is the result:

hope someone can help me !
댓글 수: 0
답변 (2개)
Walter Roberson
2013년 3월 16일
dev_info = imaqhwinfo('winvideo', 1);
char(dev_info.SupportedFormats)
will show you the supported formats
댓글 수: 2
Chanh Nguyen
2013년 3월 17일
편집: Walter Roberson
2013년 3월 17일
Walter Roberson
2013년 3월 17일
편집: Image Analyst
2013년 3월 17일
Image Analyst
2013년 3월 17일
0 개 추천
The cameras I deal with all have an RGB mode. Why don't you just cut your losses and switch to a camera that uses an RGB mode? Otherwise you'll have to use ycbcr2rgb() to convert your yuy2 image into rgb. This page may be helpful: http://www.fourcc.org/yuv.php
댓글 수: 0
이 질문은 마감되었습니다.
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!