Ask Your Question
0

standard deviation calculation

asked 2014-03-04 04:57:21 -0600

mahsa gravatar image

updated 2014-03-04 04:58:15 -0600

I was searching for standard deviation calculation using opencv that I found this:

http://answers.opencv.org/question/6501/problem-with-meanstddev/

I can not underestand what do these two lines mean:

uchar       mean_pxl = mean.val[0];
uchar       stddev_pxl = stddev.val[0];

what would be the output of mean.val[0] and stddev.val[0] ?

Thanks in advance..

edit retag flag offensive close merge delete

1 answer

Sort by ยป oldest newest most voted
0

answered 2014-03-04 07:17:41 -0600

The first one (mean.val[0]) is the average values while the second one (stddev.val[0]) is the standard deviation of all elements of one Mat object, but both of them are converted to unsigned char values (in the range [0..255]).

edit flag offensive delete link more

Comments

Thanks for the answer...One more thing: Type of the input is CV_32FC1, should I still use uchar?

mahsa gravatar imagemahsa ( 2014-03-04 08:28:00 -0600 )edit

It is depend on your purpose: if it is used for statistics, it should be float but in other cases, may be uchar is enough.

tuannhtn gravatar imagetuannhtn ( 2014-03-04 08:36:30 -0600 )edit

Question Tools

Stats

Asked: 2014-03-04 04:57:21 -0600

Seen: 657 times

Last updated: Mar 04 '14