node-opencv
node-opencv copied to clipboard
NAN_METHOD(Matrix::Set) in Matrix.cc isn't working?
trafficstars
Hi guys, I'm trying to replace the pixel color of matrix channel and then merge this channels into original matrix, but without lucky. My workaround is to draw a 1x1 rectangle upper to the original pixel. Sorry about my poor english.
_adjustColorChannel(channel, intensity, width, height) {
for (let i = 0; i < width; i++) {
for (let j = 0; j < height; j++) {
let pixel = channel.pixel(i, j);
let newPixel = Math.floor(pixel + (pixel * intensity));
channel.set(i, j, newPixel);
}
}
}
Hello,
What is the type of your channel Matrix (channel.type()) ?
I think only CV_32FC3 and CV_32FC1 are supported by setmethod. See https://github.com/peterbraden/node-opencv/blob/master/src/Matrix.cc#L289
I had similar problems with CV_8U1 matrixes