Ask Your Question
0

average of some frames

asked Jan 17 '14

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?

Preview: (hide)

1 answer

Sort by » oldest newest most voted
1

answered Jan 17 '14

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)

Preview: (hide)

Comments

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

ati gravatar imageati (Jan 17 '14)edit

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

ati gravatar imageati (Jan 17 '14)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 (Jan 17 '14)edit

Question Tools

Stats

Asked: Jan 17 '14

Seen: 254 times

Last updated: Jan 17 '14