Ask Your Question

robertofbc's profile - activity

2016-08-09 11:09:48 -0600 commented question Segmentation fault using OpenCV with Node.js

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

2016-08-08 20:28:12 -0600 asked a question Segmentation fault using OpenCV with Node.js

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
        }

      });
    })

});