Ask Your Question

Question about parameter of cv::calcBackProject( )

asked 2013-08-21 10:38:45 -0500

flammxy gravatar image

updated 2013-08-21 10:43:27 -0500

I am doing it as a part of mean-shift tracking.

calcBackProject( const Mat* images, int nimages, const int* channels, const SparseMat& hist, OutputArray backProject, const float** ranges, double scale=1, bool uniform=true );

The 3rd parameter is: int* channels.

if do it in 1 channel, I know it is define as: int ch[1]={0}, now I want to do in 3 channels (input a RGB 3 channel color image), how should I define it?

int ch[3]={2} ? or int ch[3]={0,1,2}? or int ch[3]={2,1,0}? or int ch[3]={2,2,2}?

Does anyone know it and Could you give me some tips? Thank you.

edit retag flag offensive close merge delete

1 answer

Sort by ยป oldest newest most voted

answered 2013-08-21 10:48:34 -0500

berak gravatar image

take the 2nd.

 int ch[3]={0,1,2};
edit flag offensive delete link more


I tried it.

But find the result of ch[3]={2,1,0} is better than ch[3]={0,1,2}, and the result of ch[3]={2,1,0} is still not good. Do you know why it is?

Thank you.

flammxy gravatar imageflammxy ( 2013-08-21 10:53:00 -0500 )edit

images in opencv are bgr. no idea, what you expected, but that might explain the reordering

berak gravatar imageberak ( 2013-08-21 10:55:59 -0500 )edit

Question Tools


Asked: 2013-08-21 10:38:45 -0500

Seen: 202 times

Last updated: Aug 21 '13