CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Results 1 to 2 of 2
  1. #1
    Join Date
    Feb 2013
    Posts
    21

    How can I compare two histograms in OpenCV c++?

    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:

    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?

  2. #2
    Join Date
    Feb 2013
    Posts
    21

    Re: How can I compare two histograms in OpenCV c++?

    Anyway, I have solved the problem. I include "opencv_imgproc220d.lib" in additional library dependencies in VC++2010.
    Last edited by nihad; March 6th, 2013 at 02:40 AM.

Tags for this Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  





Click Here to Expand Forum to Full Width

Featured