-# Declare variables such as the matrices to store the base image and the two other images to
- Load the base image (src_base) and the other two test images:
compare ( BGR and HSV )
@code{.cpp}
@add_toggle_cpp
Mat src_base, hsv_base;
@snippet samples/cpp/tutorial_code/Histograms_Matching/compareHist_Demo.cpp Load three images with different environment settings
Mat src_test1, hsv_test1;
@end_toggle
Mat src_test2, hsv_test2;
Mat hsv_half_down;
@add_toggle_java
@endcode
@snippet samples/java/tutorial_code/Histograms_Matching/histogram_comparison/CompareHistDemo.java Load three images with different environment settings
-# Load the base image (src_base) and the other two test images:
@snippet samples/python/tutorial_code/Histograms_Matching/histogram_comparison/compareHist_Demo.py Load three images with different environment settings
return -1;
@end_toggle
}
- Convert them to HSV format:
src_base = imread( argv[1], 1 );
src_test1 = imread( argv[2], 1 );
@add_toggle_cpp
src_test2 = imread( argv[3], 1 );
@snippet samples/cpp/tutorial_code/Histograms_Matching/compareHist_Demo.cpp Convert to HSV
@endcode
@end_toggle
-# Convert them to HSV format:
@code{.cpp}
@add_toggle_java
cvtColor( src_base, hsv_base, COLOR_BGR2HSV );
@snippet samples/java/tutorial_code/Histograms_Matching/histogram_comparison/CompareHistDemo.java Convert to HSV
cvtColor( src_test1, hsv_test1, COLOR_BGR2HSV );
@end_toggle
cvtColor( src_test2, hsv_test2, COLOR_BGR2HSV );
@endcode
@add_toggle_python
-# Also, create an image of half the base image (in HSV format):
@snippet samples/python/tutorial_code/Histograms_Matching/histogram_comparison/compareHist_Demo.py Convert to HSV