Image comparison by image histograms using OpenCV (Computer vision class assignment)
Run demo/Project1.exe
#How to modify
- Import src/main.cpp to your opencv project and open it.
- To change image, modify
imgPaths
std::string imgPaths[2] = { "assets/1st.jpg", "assets/2nd.jpg" };
- To change scale of image displayed, modify
scaleFactor
double scaleFactor = 0.2;
- 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.