how to insert a rectangle to a video preview
Mostrar comentarios más antiguos
im using my webcam to take an image of the user. I want to insert a rectangle to the video preview so that user can put his face within that boundary.
cem=webcam('Lenovo EasyCam');
preview(cem);
img=snapshot(cem);
preview(img);
hold on
thisBB = [10 10 300 300];
rectangle('Position', [thisBB(1),thisBB(2),thisBB(3),thisBB(4)],'EdgeColor','r','LineWidth',2 );
1 comentario
hervey he
el 1 de Dic. de 2019
Hi man, have you resoluted this problem? I also want that fuction too.
Respuestas (2)
Image Analyst
el 22 de Abr. de 2017
I don't think you want these lines:
img=snapshot(cem);
preview(img);
hold on
Getting a snapshot into a variable img is fine (not sure if it would freeze the video after that though) but then passing an image to preview instead of a video object will probably cause problems. Play around with hold on to see if you need to put it before or after rectangle or if you even need it at all.
1 comentario
Thushar Praveen
el 24 de Abr. de 2017
Thushar Praveen
el 27 de Abr. de 2017
1 comentario
Tung Le Thanh
el 25 de Ag. de 2020
I am impossible
Categorías
Más información sobre Image Acquisition Support Packages for Hardware Adaptors (Generic Video Interface) en Centro de ayuda y File Exchange.
Productos
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!