nagadomi / lbpcascade_animeface

A Face detector for anime/manga using OpenCV
1.93k stars 294 forks source link

add flags for cv2.imread #2

Closed youkaichao closed 7 years ago

youkaichao commented 7 years ago

if the flag of cv2.imread is not set, sometimes Exception described in here can happen

nagadomi commented 7 years ago

Is not it the default flag for the Python interface?

cv2.IMREAD_COLOR : Loads a color image. Any transparency of image will be neglected. It is the default flag.

http://docs.opencv.org/3.0-beta/doc/py_tutorials/py_gui/py_image_display/py_image_display.html#read-an-image

However, if that is easy to understand for using in other language, I will merge it. Thanks.

youkaichao commented 7 years ago

i run the code across hundreds of imges. Most images can be disposed properly, but some will raise exception. After i add the default flag, all images can be disposed properly(without exceptions). Thus, i add the default flag.