java.lang.RuntimeException: /Users/saudet/projects/bytedeco/javacpp-presets/opencv/cppbuild/macosx-x86_64/opencv_contrib-3.1.0/modules/face/src/lbph_faces.cpp:359: error: (-5) The number of samples (src) must equal the number of labels (labels). Was len(samples)=891, len(labels)=0. in function train


Solutions on the web

Solution icon of github
via GitHub by matthewcodes
, 8 months ago
/Users/saudet/projects/bytedeco/javacpp-presets/opencv/cppbuild/macosx-x86_64/opencv_contrib-3.1.0/modules/face/src/lbph_faces.cpp:359: error: (-5) The number of samples (src) must equal the number of labels (labels). Was len(samples)=891, len(labels)=0. in function train

Solution icon of googlegroups
src\matrix.cpp:464: error: (-215) 0 <= _colRange.start && _colRange.start <= _colRange.end && _colRange.end <= m.cols in function cv::Mat::Mat

Solution icon of github
via GitHub by lquinn2015
, 3 months ago
/projects/bytedeco/javacpp-presets/opencv/cppbuild/linux-x86_64/opencv-3.1.0/modules/core/src/lda.cpp:1016: error: (-5) At least two classes are needed to perform a LDA. Reason: Only one class was given! in function lda

Stack trace

java.lang.RuntimeException: /Users/saudet/projects/bytedeco/javacpp-presets/opencv/cppbuild/macosx-x86_64/opencv_contrib-3.1.0/modules/face/src/lbph_faces.cpp:359: error: (-5) The number of samples (src) must equal the number of labels (labels). Was len(samples)=891, len(labels)=0. in function train
	at org.bytedeco.javacpp.opencv_face$FaceRecognizer.train(Native Method)

Write tip

You have a different solution? A short tip here would help you and many other users who saw this issue last week.

Users with the same issue

You are the first who have seen this exception. Write a tip to help other users and build your expert profile.