<commit_before>/**
 * @file compareHist_Demo.cpp
 * @brief Sample code to use the function compareHist
 * @author OpenCV team
 */

#include "opencv2/highgui/highgui.hpp"
#include "opencv2/imgproc/imgproc.hpp"
#include <iostream>
#include <stdio.h>

using namespace std;
using namespace cv;

/**
 * @function main
 */
int main( int argc, char** argv )
{
    Mat src_base, hsv_base;
    Mat src_test1, hsv_test1;
    Mat src_test2, hsv_test2;
    Mat hsv_half_down;

   /// Load three images with different environment settings
   if( argc < 4 )
     { printf("** Error. Usage: ./compareHist_Demo <image_settings0> <image_setting1> <image_settings2>\n");
       return -1; 
     }

   src_base = imread( argv[1], 1 );
   src_test1 = imread( argv[2], 1 );
   src_test2 = imread( argv[3], 1 );

   /// Convert to HSV
   cvtColor( src_base, hsv_base, CV_BGR2HSV );
   cvtColor( src_test1, hsv_test1, CV_BGR2HSV );
   cvtColor( src_test2, hsv_test2, CV_BGR2HSV );

   hsv_half_down = hsv_base( Range( hsv_base.rows/2, hsv_base.rows - 1 ), Range( 0, hsv_base.cols - 1 ) );  

   /// Using 30 bins for hue and 32 for saturation
    int h_bins = 50; int s_bins = 60;
    int histSize[] = { h_bins, s_bins };

    // hue varies from 0 to 256, saturation from 0 to 180
    float h_ranges[] = { 0, 256 };
    float s_ranges[] = { 0, 180 };

    const float* ranges[] = { h_ranges, s_ranges };<commit_msg>fixed typo in the tutorial code (thanks to <NAME>; ticket #2016)<commit_after>/**
 * @file compareHist_Demo.cpp
 * @brief Sample code to use the function compareHist
 * @author OpenCV team
 */

#include "opencv2/highgui/highgui.hpp"
#include "opencv2/imgproc/imgproc.hpp"
#include <iostream>
#include <stdio.h>

using namespace std;
using namespace cv;

/**
 * @function main
 */
int main( int argc, char** argv )
{
    Mat src_base, hsv_base;
    Mat src_test1, hsv_test1;
    Mat src_test2, hsv_test2;
    Mat hsv_half_down;

   /// Load three images with different environment settings
   if( argc < 4 )
     { printf("** Error. Usage: ./compareHist_Demo <image_settings0> <image_setting1> <image_settings2>\n");
       return -1; 
     }

   src_base = imread( argv[1], 1 );
   src_test1 = imread( argv[2], 1 );
   src_test2 = imread( argv[3], 1 );

   /// Convert to HSV
   cvtColor( src_base, hsv_base, CV_BGR2HSV );
   cvtColor( src_test1, hsv_test1, CV_BGR2HSV );
   cvtColor( src_test2, hsv_test2, CV_BGR2HSV );

   hsv_half_down = hsv_base( Range( hsv_base.rows/2, hsv_base.rows - 1 ), Range( 0, hsv_base.cols - 1 ) );  

   /// Using 30 bins for hue and 32 for saturation
    int h_bins = 50; int s_bins = 60;
    int histSize[] = { h_bins, s_bins };

    // hue varies from 0 to 256, saturation from 0 to 180
    float s_ranges[] = { 0, 256 };
    float h_ranges[] = { 0, 180 };

    const float* ranges[] = { h_ranges, s_ranges };
{'fraction_non_alphanumeric': 0.12839506172839507, 'fraction_numerical': 0.03950617283950617, 'mean_word_length': 3.1767304860088363, 'pattern_counts': {'":': 0, '<': 16, '<?xml version=': 0, '>': 14, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '5527573', 'n_tokens_mistral': 1161, 'n_tokens_neox': 1049, 'n_words': 302}