0

I am trying to add "if, then logic" to the opencv face detection code such that if and when a face is detected through a camera or webcam, an image of the detected face is saved to a pre-determined file path on the controller or computer such as C:\Users\Public\Desktop.

I have looked everywhere for examples of anything that can help but I cant find anything.

If anyone knows any codes, research articles, websites, people I can contact, that would be very helpful.

Thanks

kingpin
  • 85
  • 1
  • 14

2 Answers2

2

The function call that detects the face will most probably contain a boundingRectangle parameter of type vector<Rect>. Use the data present in it to select the Region of Interest(ROI) if a face is detected. This selected ROI can then be saved using this function.

These are the very basics of OpenCV and hence I am not including any code snippets along with my answer.

Anoop K. Prabhu
  • 5,417
  • 2
  • 26
  • 43
0

Based on the detected portion(pending whether you are getting a region or point) from the image, define an roi(if needed). Then copy the roi to new image and then save to path?

user1538798
  • 1,075
  • 3
  • 17
  • 42