Segmentation fault using OpenCV with Node.js [closed]
Hello, I am trying to detect faces on a series of images in a node script and I am getting a segmentation fault.
This is the output of the console when the error occurs:
OpenCV Error: Bad flag (parameter or structure field) (Unrecognized or unsupported array type) in cvGetMat, file /tmp/opencv-20160626-26273-1a7s2xo/opencv-2.4.13/modules/core/src/array.cpp, line 2482
OpenCV Error: Bad flag (parameter or structure field) (Unrecognized or unsupported array type) in cvGetMat, file /tmp/opencv-20160626-26273-1a7s2xo/opencv-2.4.13/modules/core/src/array.cpp, line 2482
OpenCV Error: Bad flag (parameter or structure field) (Unrecognized or unsupported array type) in cvGetMat, file /tmp/opencv-20160626-26273-1a7s2xo/opencv-2.4.13/modules/core/src/array.cpp, line 2482
OpenCV Error: Bad flag (parameter or structure field) (Unrecognized or unsupported array type) in cvGetMat, file /tmp/opencv-20160626-26273-1a7s2xo/opencv-2.4.13/modules/core/src/array.cpp, line 2482
OpenCV Error: Bad flag (parameter or structure field) (Unrecognized or unsupported array type) in cvGetMat, file /tmp/opencv-20160626-26273-1a7s2xo/opencv-2.4.13/modules/core/src/array.cpp, line 2482
Segmentation fault: 11
This is the code that produces the error:
glob.sync('*.jpg' ).forEach( function( file,index,array ) {
cv.readImage(file, function(err, im){
im.detectObject(cv.FACE_CASCADE, {}, function(err, faces){
if(faces.length>0){
//do something
}
else{
//do another thing
}
});
})
});
opencv does not maintain any node bindings.
the breaking happens with opencv, not the node module but ok i guess
you supplied bad data from the node bindings. how would that happen ? we'll never know here.
at least, please check any err values in the callbacks.
... and ... if that is re-loading a cascade file per image , that's total moronic.