Ask Your Question
0

average of some frames

asked 2014-01-17 03:48:43 -0600

ati gravatar image

to get the average of two frames, I found this simple code in opencv.

Mat img_mean=0.5*image+0.5*image2;
imshow("Average",img_mean);

But I get this error that Double can not convert to the Mat.

How do I solve this erros?

edit retag flag offensive close merge delete

1 answer

Sort by ยป oldest newest most voted
1

answered 2014-01-17 04:17:32 -0600

Flart gravatar image

Try:

 Mat img_mean = image * 0.5 + image2 * 0.5;

If I am wrong, then read docs cv::Mat (overloading operators section)

edit flag offensive delete link more

Comments

wow, seems the problem is that image has a vector type, How do i convert it to Mat?

ati gravatar imageati ( 2014-01-17 04:42:14 -0600 )edit
Flart gravatar imageFlart ( 2014-01-17 05:20:29 -0600 )edit

it is a useful link..thanks but I did not find such a this expression "scaling plus scaling"

ati gravatar imageati ( 2014-01-17 06:15:53 -0600 )edit

scaling: sc1 = image * 0.5;

scaling: sc2 = image2 * 0.5;

plus: sc1 + sc2.

In total: (image * 0.5) + (image2 * 0.5)

In total: (scaling) plus (scaling).

Flart gravatar imageFlart ( 2014-01-17 06:31:04 -0600 )edit

Question Tools

Stats

Asked: 2014-01-17 03:48:43 -0600

Seen: 214 times

Last updated: Jan 17 '14