Segmentation fault using OpenCV with Node.js [closed]

asked 2016-08-08 16:06:38 -0600

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
        }

      });
    })

});
edit retag flag offensive reopen merge delete

Closed for the following reason question is off-topic or not relevant by berak
close date 2016-08-08 20:58:14.952202

Comments

opencv does not maintain any node bindings.

berak gravatar imageberak ( 2016-08-08 20:33:04 -0600 )edit

the breaking happens with opencv, not the node module but ok i guess

robertofbc gravatar imagerobertofbc ( 2016-08-09 11:09:48 -0600 )edit

you supplied bad data from the node bindings. how would that happen ? we'll never know here.

berak gravatar imageberak ( 2016-08-10 00:35:44 -0600 )edit

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.

berak gravatar imageberak ( 2016-08-10 01:52:08 -0600 )edit