Ask Your Question
0

Matrix Deviation

asked 2017-01-31 08:48:05 -0600

belan gravatar image

I want to make dev1,dev2,dev3 to array mat like ( dev[d] )but i can't.

Mat dev1,dev2,dev3;
        dev1=Mat(align[0])-average; 
        dev2=Mat(align[1])-average; 
        dev3=Mat(align[2])-average;

is there anyone can help me? thank you

edit retag flag offensive close merge delete

Comments

"I can't " why does it mean.

LBerger gravatar imageLBerger ( 2017-01-31 09:05:28 -0600 )edit

1 answer

Sort by ยป oldest newest most voted
0

answered 2017-01-31 09:04:03 -0600

LBerger gravatar image

updated 2017-01-31 09:41:55 -0600

I suppose that align is vector of uchar. You have to use substract instead of - to set result type (here float with one channel CV_32FC1):

vector<uchar> align={1,1,3,3};
Mat dev1;

subtract(Mat(align), 2, dev1, Mat(), CV_32FC1);
cout << dev1;
cout << Mat(align)-2; // wrong because uchar cannot be negative
edit flag offensive delete link more

Question Tools

1 follower

Stats

Asked: 2017-01-31 08:48:05 -0600

Seen: 128 times

Last updated: Jan 31 '17