muesli / smartcrop

smartcrop finds good image crops for arbitrary crop sizes
MIT License
1.82k stars 114 forks source link

OpenCV problem #24

Closed region23 closed 7 years ago

region23 commented 8 years ago

env: OS X 10.11.2 Go 1.5.2 OpenCV 2.4.12 Error when exec analyzer.FindBestCrop:

stat /usr/share/opencv/haarcascades/haarcascade_frontalface_alt.xml: no such file or directory
exit status 1

path created by homebrew is /usr/local/Cellar/opencv/2.4.12/share/OpenCV, not /usr/share/opencv/

region23 commented 8 years ago

if I rewrite path in crop.go, then I caught this error:

OpenCV Error: Unspecified error (The node does not represent a user object (unknown type?)) in cvRead, file /tmp/opencv20151230-64900-cukeo2/opencv-2.4.12/modules/core/src/persistence.cpp, line 5008
libc++abi.dylib: terminating with uncaught exception of type cv::Exception: /tmp/opencv20151230-64900-cukeo2/opencv-2.4.12/modules/core/src/persistence.cpp:5008: error: (-2) The node does not represent a user object (unknown type?) in function cvRead

SIGABRT: abort
PC=0x7fff93301002 m=4
signal arrived during cgo execution
sharpner commented 8 years ago

you can use NewAnalyzerWithCropSettings and configure the haarcascade file manually. I also use that openCV version from brew and this haarcascade file:

https://github.com/VoycerAG/gridfs-image-server/blob/master/scripts/haarcascade_frontalface_alt.xml

hope it helps :-)