/OpenCV_HistogramComparison

Image comparison by image histograms using OpenCV(Computer vision class assignment)

Primary LanguageC++

OpenCV_HistogramComparison

Image comparison by image histograms using OpenCV (Computer vision class assignment)

How to run

Run demo/Project1.exe

#How to modify

  1. Import src/main.cpp to your opencv project and open it.
  2. To change image, modify imgPaths
std::string imgPaths[2] = { "assets/1st.jpg", "assets/2nd.jpg" };
  1. To change scale of image displayed, modify scaleFactor
double scaleFactor = 0.2;
  1. To change method, channels, patch size, or bin size, change variables right before the for loop.
int method = 3;
int histSize[] = { 16 };
int hChannel[] = { 0 };
int sChannel[] = { 1 };
int vChannel[] = { 2 };
float hRange_[] = { 0,180 };
float svRange_[] = { 0,256 };
const float* hRange[] = { hRange_ };
const float* svRange[] = { svRange_ };
cv::Size patchSize(140, 140);
  • autoeval.cpp is used for iterating tests to find the right parameters.

Test result 1

image

Histograms of test result 1

image

Test result 2

image