Willow icon indicating copy to clipboard operation
Willow copied to clipboard

Feature detection error in matrix.cpp

Open BertrandBordage opened this issue 6 years ago • 1 comments

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.

BertrandBordage avatar May 21 '18 16:05 BertrandBordage

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

kaedroho avatar May 29 '18 08:05 kaedroho