Ask Your Question
-2

How can i save only one image using the imwrite command without press any key?

asked 2018-08-10 12:57:51 -0600

Leonel Ceolin gravatar image

updated 2018-08-13 13:23:17 -0600

berak gravatar image

I'm using OpenCV for facial recognize and i want to save automatically only one image when the person is detected in front of webcam withou press any key.

In this case i want to save only one image and the command imwrite is saving multiple images. useless screenshot

here is my code. it's detecting the face in front of the camera,when is a unknown person in front of the camera it returns -1 and i want to save a screenshot from the camera using the imwrite command but it's saving lots of pictures.

edit retag flag offensive close merge delete

Comments

I don't understand your problem : imwrite save only one image. Show us your code in text please

LBerger gravatar imageLBerger ( 2018-08-10 15:06:36 -0600 )edit

the print of the code is in the question now

Leonel Ceolin gravatar imageLeonel Ceolin ( 2018-08-13 13:17:22 -0600 )edit

useless screenshot, again.

berak gravatar imageberak ( 2018-08-13 13:23:58 -0600 )edit

1 answer

Sort by ยป oldest newest most voted
0

answered 2018-08-11 04:44:34 -0600

berak gravatar image

updated 2018-08-11 04:57:51 -0600

you could simply try to read the image, and thus check, if there already is one for that person.

 String name = "john.d.png";
 Mat im = imread(name);
 if (im.empty())
     imwrite(name, face_ image);
edit flag offensive delete link more

Question Tools

1 follower

Stats

Asked: 2018-08-10 12:57:51 -0600

Seen: 253 times

Last updated: Aug 13 '18