mirror of
https://github.com/peterbraden/node-opencv.git
synced 2025-12-08 19:45:55 +00:00
Prevent a copy during grayscale conversion
This commit is contained in:
parent
a2073757a2
commit
dc12c4f2ed
@ -998,10 +998,7 @@ NAN_METHOD(Matrix::ConvertGrayscale) {
|
||||
Nan::ThrowError("Image is no 3-channel");
|
||||
}
|
||||
|
||||
cv::Mat gray;
|
||||
|
||||
cv::cvtColor(self->mat, gray, CV_BGR2GRAY);
|
||||
gray.copyTo(self->mat);
|
||||
cv::cvtColor(self->mat, self->mat, CV_BGR2GRAY);
|
||||
|
||||
info.GetReturnValue().Set(Nan::Null());
|
||||
}
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user