Skip to content Skip to sidebar Skip to footer

How To Crop The Detected Face In Opencv And Save Roi As Image In Opencv Python

Im using opencv in python and this is my code in detecting the face and saving the face..but it does not save the roi(the face detected),i've been having trouble doing this.please

Solution 1:

Do you mean?:

.
.
.
print x0,y0,x1,y1
.
.
.
roi=saved_image[y0:y1,x0:x1]

The indentation above and below the while statement seems incorrect.

Triple quotes should only be used temporarily for block quotes as they can cause problems.

Maybe use # instead:

#x0,y0=x,y#x1,y1=x+w,y+h

Unless that is how the help for that function is suppose to read.

Including errors in your question would be helpful too.

Post a Comment for "How To Crop The Detected Face In Opencv And Save Roi As Image In Opencv Python"