node-opencv icon indicating copy to clipboard operation
node-opencv copied to clipboard

Error: failed to run: img.toBuffer() function

Open DDavo opened this issue 8 years ago • 3 comments

I have the next code:

` cv.readImage(path, function(err, img){

  if (err) return resp.end(err.stack);

  if (img.width() < 1 || img.height() < 1) return resp.end('Image has no size');

  img.toBuffer()  // Here the nodejs server just is stopped with no errors

});

`

I have tried with img.toBufferAsync() and the same thing happens

Any leads to fix it will be great!

DDavo avatar Jan 24 '17 14:01 DDavo

same issue

stasovlas avatar Jan 30 '17 09:01 stasovlas

If you're on windows, this problem will happen if your version of Visual Studio Build Tools doesn't match what opencv was compiled with.

For vs2015, use this version of opencv: https://github.com/opencv/opencv/releases/download/2.4.13.2/opencv-2.4.13.2-vc14.exe and make sure you're env variable is pointing to the v14 folder.

vc14: The compiler packaged with Visual Studio 2015
vc12: The compiler packaged with Visual Studio 2013
vc11: The compiler packaged with Visual Studio 2012
vc10: The compiler packaged with Visual Studio 2010

bmathews avatar Feb 08 '17 20:02 bmathews

It would be nice if you could change the README to add the multiple versions of VS that are supported and which release needs to be downloaded

PierrickLozach avatar Apr 06 '17 15:04 PierrickLozach