show a simple rectangle
7 ビュー (過去 30 日間)
古いコメントを表示
i just need to show a rectangle(square) with any color in a camera videostream, then i need to crop the snapshot according inside the rectangle in the video (size 180x200), can you guys help me? here are the few codes been working:
vid = videoinput('winvideo', 1, 'YUY2_320x240');
preview(vid);
for ii=3:-1:1
pause(1);
end
img = getsnapshot(vid);
figure,imshow(img);
BW = imcrop(img,[75 68 180 200]);
imshow(BW);
thank you!!
0 件のコメント
回答 (1 件)
Image Analyst
2011 年 12 月 10 日
Did you try "hold on" and rectangle() to show the rectangle over your live video? Your code seems to go live for just two seconds and then snap, crop, and display an image. What is the problem you are having?
3 件のコメント
参考
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!