wagtail / Willow

A wrapper that combines the functionality of multiple Python image libraries into one API
https://willow.wagtail.org/
BSD 3-Clause "New" or "Revised" License
273 stars 53 forks source link

Feature detection error in matrix.cpp #64

Open BertrandBordage opened 6 years ago

BertrandBordage commented 6 years ago

While uploading multiple images in Wagtail with feature detection enabled, one of my clients faced this error on each image:

File "/…/python3.5/site-packages/willow/plugins/opencv.py" in detect_features
  79.         points = cv2.goodFeaturesToTrack(self.image, 20, 0.04, 1.0)

Exception Type: error at /admin/images/multiple/add/
Exception Value: /io/opencv/modules/core/src/matrix.cpp:436: error: (-215) u != 0 in function create

The images themselves are pretty standard, JPGs of less than 1 MB each. They were generated from Adobe Illustrator vector drawings where most of the image is a white background.

kaedroho commented 6 years ago

I think the Python bindings for OpenCV should be handling errors like this so this is probably an OpenCV bug.

As a workaround, this library might work better than OpenCV (and it's easy to install): https://github.com/torchbox/rustface-py