mirror of
https://github.com/peterbraden/node-opencv.git
synced 2025-12-08 19:45:55 +00:00
make getData() work if we have more than one channel
This commit is contained in:
parent
6f62e4a644
commit
9a2b3c3bfc
@ -317,7 +317,7 @@ NAN_METHOD(Matrix::GetData) {
|
||||
Nan::HandleScope scope;
|
||||
|
||||
Matrix *self = Nan::ObjectWrap::Unwrap<Matrix>(info.This());
|
||||
int size = self->mat.rows * self->mat.cols * self->mat.elemSize1();
|
||||
int size = self->mat.rows * self->mat.cols * self->mat.elemSize();
|
||||
Local<Object> buf = Nan::NewBuffer(size).ToLocalChecked();
|
||||
uchar* data = (uchar*) Buffer::Data(buf);
|
||||
// if there is padding after each row, clone first to get rid of it
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user