user1510711
user1510711

Reputation: 113

resizing a picture in opencv?

i am writing a face dection program in opencv. And this is the error code below:

result = img[rects[0]:rects[1], rects[2]:rects[3]] 
result = cv2.resize(result, (100,100)) 

img is our original picture and the first step is croping out our rigion of interest into result. The second step is resize to 100*100 pixels.

the error is:

result = cv2.resize(result, (100,100))
error: ..\..\..\src\opencv\modules\imgproc\src\imgwarp.cpp:1725: error: (-215) ssize.area() > 0

Hope someone can help me. Thanks a lot.

Upvotes: 5

Views: 10382

Answers (1)

aabhas
aabhas

Reputation: 416

Had the same error in python ,found that image was empty so check whether imread worked or not by using imshow or checking it for NULL then use cv2.resize .

Upvotes: 9

Related Questions