mirror of
https://github.com/peterbraden/node-opencv.git
synced 2025-12-08 19:45:55 +00:00
FaceRecognizer: convert to grayscale only if 3 channels are provided
This commit is contained in:
parent
a31402f60a
commit
bb07fcdaf6
@ -213,7 +213,10 @@ NAN_METHOD(FaceRecognizerWrap::PredictSync) {
|
||||
SETUP_FUNCTION(FaceRecognizerWrap)
|
||||
|
||||
cv::Mat im = fromMatrixOrFilename(info[0]); // TODO CHECK!
|
||||
if (im.channels() == 3) {
|
||||
cv::cvtColor(im, im, CV_RGB2GRAY);
|
||||
}
|
||||
|
||||
// int predictedLabel = self->rec->predict(im);
|
||||
|
||||
int predictedLabel = -1;
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user