Filter löschen
Filter löschen

show a simple rectangle

1 Ansicht (letzte 30 Tage)
Izzo
Izzo am 7 Dez. 2011
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!!

Antworten (1)

Image Analyst
Image Analyst am 10 Dez. 2011
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 Kommentare
Jan
Jan am 11 Dez. 2011
And what is the problem you are having?
Izzo
Izzo am 11 Dez. 2011
the problem is i cant do it, i just asking for someone who might knows

Melden Sie sich an, um zu kommentieren.

Kategorien

Mehr zu MATLAB Support Package for IP Cameras finden Sie in Help Center und File Exchange

Community Treasure Hunt

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

Start Hunting!

Translated by