Ask Your Question
0

How can I compare two histograms?

asked 2013-03-05 20:15:43 -0600

this post is marked as community wiki

This post is a wiki. Anyone with karma >50 is welcome to improve it.

I am tying to compare two histograms, but it gives error. Here I have given my code, histogram file and error message. Histogram file 3*5 matrix(output_test.txt):

1 2 3 4 5
5 2 1 4 2
2 1 2 4 2

code:

int main(..........)
{
   ................................................
   Mat first_histogram(1,feature_vector_size, CV_32F);
   Mat second_histogram(1,feature_vector_size, CV_32F);

for(i=0;i<count_row;i++)
{
  for(j=0;j<count_row;j++) 
   {
    if(i==j)
    {
       comparision_feature[i][j]=0.0;
    }
    else
    {
       l=0;
    for(k=0;k<feature_vector_size;k++)
    {
        first_histogram.at <float>(l,k)=read_feature[i][k];
        second_histogram.at <float>(l,k)=read_feature[j][k];
    }
temp_distance=compareHist(first_histogram,second_histogram,CV_COMP_CORREL);//error message 
            comparision_feature[i][j]=temp_distance;
   }
    }
}

Error message: error LNK2019: unresolved external symbol "double __cdecl cv::compareHist(class cv::Mat const &,class cv::Mat const &,int)" (?compareHist@cv@@YANABVMat@1@0H@Z) Is there anybody who can help in this regard?

edit retag flag offensive close merge delete

1 answer

Sort by ยป oldest newest most voted
2

answered 2013-03-06 03:23:37 -0600

this post is marked as community wiki

This post is a wiki. Anyone with karma >50 is welcome to improve it.

oh, that's a linker error, you're missing a library, the imgproc module in this case.

opencv_imgproc242.lib on my machine, but the name will ofc differ for different os/opencv version

edit flag offensive delete link more

Comments

Thank you. I include opencv_imgproc220d.lib in additional library of VC++2010.Now it works fine.

Nihad gravatar imageNihad ( 2013-03-06 05:46:41 -0600 )edit

Question Tools

Stats

Asked: 2013-03-05 20:15:43 -0600

Seen: 265 times

Last updated: Mar 06 '13