mirror of
https://github.com/peterbraden/node-opencv.git
synced 2025-12-08 19:45:55 +00:00
fixed channel check
This commit is contained in:
parent
f9d5c8a4d7
commit
d5441b93ff
@ -316,6 +316,10 @@ NAN_METHOD(Matrix::Brightness){
|
||||
|
||||
if (args.Length() == 2){
|
||||
Matrix *self = ObjectWrap::Unwrap<Matrix>(args.This());
|
||||
|
||||
if(self->mat.channels() != 3)
|
||||
NanThrowError("Image is no 3-channel");
|
||||
|
||||
cv::Mat image = self->mat;
|
||||
cv::Mat new_image = cv::Mat::zeros( image.size(), image.type() );
|
||||
double alpha = args[0]->NumberValue();
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user