8
$\begingroup$

I found Mathematica can use OpenCV to improve face recognition in FindFaces: how to improve the results of the face recognition feature.

But I tried this way and the kernel crashed.

URLDownload["https://raw.githubusercontent.com/nagadomi/lbpcascade_animeface/master/lbpcascade_animeface.xml","lbpcascade_animeface.xml"];
FindFaces[img,"Image","TrainingFile" ->"lbpcascade_animeface.xml"]

Then I found that even using the files in the distribution will still cause kernel shut down.

enter image description here

Notice that the number disappears, the code highlight disappears, the calculation does not continue, the kernel has stopped working at this time.

Can someone else reproduce this situation, is this a bug?

$\endgroup$
6
  • 2
    $\begingroup$ I observe the same behaviour ("11.3.0 for Linux x86 (64-bit) (March 7, 2018)") $\endgroup$
    – mikado
    Sep 23, 2018 at 11:33
  • $\begingroup$ Same on 11.3.0 for Mac OS X x86 (64-bit) (March 7, 2018) $\endgroup$ Sep 24, 2018 at 1:49
  • 1
    $\begingroup$ This should be reported to Wolfram Support, please share then the case number so other people get a chance to follow up when new versions are released. $\endgroup$
    – rhermans
    Oct 25, 2018 at 10:20
  • 2
    $\begingroup$ @rhermans Re: [CASE:4169085] I was able to reproduce the crash, however TrainingFile is not documented and not supported. $\endgroup$
    – Aster
    Oct 25, 2018 at 10:49
  • 2
    $\begingroup$ Seems undocumented functions cannot get support. $\endgroup$
    – Aster
    Oct 25, 2018 at 10:49

2 Answers 2

4
$\begingroup$

I launch Mathematica from a bash shell under linux and get the following error message when the kernel crashes:

OpenCV Error: Unspecified error (The node does not represent a user object (unknown type?)) in cvRead, file /home/usr0/matthias/tmp/opencv/opencv-3.1.0/modules/core/src/persistence.cpp, line 4976
terminate called after throwing an instance of 'cv::Exception'
what():  /home/usr0/matthias/tmp/opencv/opencv-3.1.0/modules/core/src/persistence.cpp:4976: error: (-2) The node does not represent a user object (unknown type?) in function cvRead

I guess that you have triggered an error in OpenCV.

$\endgroup$
1
  • 1
    $\begingroup$ Nice find. Still, Mathematica should be resilient to errors in external calls. This should be reported to Wolfram Support. $\endgroup$
    – rhermans
    Oct 25, 2018 at 10:20
2
$\begingroup$

Fixed in Version 12.

enter image description here

animeface = FindFaces[#,
    "Method" -> "LocalBinaryPatterns",
    "TrainingFile" -> "lbpcascade_animeface.xml",
    AcceptanceThreshold -> 0.1,
    "ScaleDecreaseFraction" -> 1
]&;
HighlightImage[img, {"Boundary", Green, animeface[#]&}]

Remark:

  • Method must be set
  • Image`HumanDump`FindFacesHiddenOptions
$\endgroup$
2
  • $\begingroup$ That's very interesting. Is there a repository somewhere for LBP xml files like the one you used? $\endgroup$
    – Carl Lange
    Apr 18, 2019 at 7:20
  • $\begingroup$ @CarlLange, OpenCV maintained some. Or search lbpcascade in google or github. $\endgroup$
    – Aster
    Apr 18, 2019 at 7:40

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Not the answer you're looking for? Browse other questions tagged or ask your own question.