Merge remote-tracking branch 'origin/2.4' into merge-2.4
Conflicts: modules/ocl/include/opencv2/ocl/ocl.hpp modules/ocl/src/arithm.cpp modules/ocl/src/build_warps.cpp modules/ocl/src/color.cpp modules/ocl/src/haar.cpp modules/ocl/src/imgproc.cpp modules/ocl/src/split_merge.cpp modules/ocl/test/test_color.cpp samples/cpp/3calibration.cpp samples/cpp/OpenEXRimages_HDR_Retina_toneMapping.cpp samples/cpp/OpenEXRimages_HDR_Retina_toneMapping_video.cpp samples/cpp/Qt_sample/main.cpp samples/cpp/camshiftdemo.cpp samples/cpp/descriptor_extractor_matcher.cpp samples/cpp/distrans.cpp samples/cpp/generic_descriptor_match.cpp samples/cpp/grabcut.cpp samples/cpp/morphology2.cpp samples/cpp/segment_objects.cpp samples/cpp/stereo_calib.cpp samples/cpp/tutorial_code/Histograms_Matching/compareHist_Demo.cpp samples/cpp/tutorial_code/core/mat_mask_operations/mat_mask_operations.cpp samples/cpp/tutorial_code/introduction/display_image/display_image.cpp samples/cpp/tutorial_code/introduction/windows_visual_studio_Opencv/Test.cpp samples/cpp/tutorial_code/objectDetection/objectDetection.cpp samples/cpp/tutorial_code/objectDetection/objectDetection2.cpp samples/cpp/video_dmtx.cpp
This commit is contained in:
@@ -24,17 +24,14 @@ Mat image;
|
||||
*/
|
||||
static void on_trackbar( int, void* )
|
||||
{
|
||||
Mat new_image = Mat::zeros( image.size(), image.type() );
|
||||
Mat new_image = Mat::zeros( image.size(), image.type() );
|
||||
|
||||
for( int y = 0; y < image.rows; y++ )
|
||||
{ for( int x = 0; x < image.cols; x++ )
|
||||
{ for( int c = 0; c < 3; c++ )
|
||||
{
|
||||
new_image.at<Vec3b>(y,x)[c] = saturate_cast<uchar>( alpha*( image.at<Vec3b>(y,x)[c] ) + beta );
|
||||
}
|
||||
}
|
||||
}
|
||||
imshow("New Image", new_image);
|
||||
for( int y = 0; y < image.rows; y++ )
|
||||
for( int x = 0; x < image.cols; x++ )
|
||||
for( int c = 0; c < 3; c++ )
|
||||
new_image.at<Vec3b>(y,x)[c] = saturate_cast<uchar>( alpha*( image.at<Vec3b>(y,x)[c] ) + beta );
|
||||
|
||||
imshow("New Image", new_image);
|
||||
}
|
||||
|
||||
|
||||
|
@@ -22,24 +22,25 @@ int main( int argc, char** argv )
|
||||
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;
|
||||
}
|
||||
/// 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 );
|
||||
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, COLOR_BGR2HSV );
|
||||
cvtColor( src_test1, hsv_test1, COLOR_BGR2HSV );
|
||||
cvtColor( src_test2, hsv_test2, COLOR_BGR2HSV );
|
||||
/// Convert to HSV
|
||||
cvtColor( src_base, hsv_base, COLOR_BGR2HSV );
|
||||
cvtColor( src_test1, hsv_test1, COLOR_BGR2HSV );
|
||||
cvtColor( src_test2, hsv_test2, COLOR_BGR2HSV );
|
||||
|
||||
hsv_half_down = hsv_base( Range( hsv_base.rows/2, hsv_base.rows - 1 ), Range( 0, hsv_base.cols - 1 ) );
|
||||
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
|
||||
/// Using 30 bins for hue and 32 for saturation
|
||||
int h_bins = 50; int s_bins = 60;
|
||||
int histSize[] = { h_bins, s_bins };
|
||||
|
||||
@@ -74,14 +75,15 @@ int main( int argc, char** argv )
|
||||
|
||||
/// Apply the histogram comparison methods
|
||||
for( int i = 0; i < 4; i++ )
|
||||
{ int compare_method = i;
|
||||
double base_base = compareHist( hist_base, hist_base, compare_method );
|
||||
double base_half = compareHist( hist_base, hist_half_down, compare_method );
|
||||
double base_test1 = compareHist( hist_base, hist_test1, compare_method );
|
||||
double base_test2 = compareHist( hist_base, hist_test2, compare_method );
|
||||
{
|
||||
int compare_method = i;
|
||||
double base_base = compareHist( hist_base, hist_base, compare_method );
|
||||
double base_half = compareHist( hist_base, hist_half_down, compare_method );
|
||||
double base_test1 = compareHist( hist_base, hist_test1, compare_method );
|
||||
double base_test2 = compareHist( hist_base, hist_test2, compare_method );
|
||||
|
||||
printf( " Method [%d] Perfect, Base-Half, Base-Test(1), Base-Test(2) : %f, %f, %f, %f \n", i, base_base, base_half , base_test1, base_test2 );
|
||||
}
|
||||
printf( " Method [%d] Perfect, Base-Half, Base-Test(1), Base-Test(2) : %f, %f, %f, %f \n", i, base_base, base_half , base_test1, base_test2 );
|
||||
}
|
||||
|
||||
printf( "Done \n" );
|
||||
|
||||
|
@@ -46,13 +46,13 @@ int main( int, char** argv )
|
||||
|
||||
/// Create Trackbar to select kernel type
|
||||
createTrackbar( "Element:\n 0: Rect - 1: Cross - 2: Ellipse", window_name,
|
||||
&morph_elem, max_elem,
|
||||
Morphology_Operations );
|
||||
&morph_elem, max_elem,
|
||||
Morphology_Operations );
|
||||
|
||||
/// Create Trackbar to choose kernel size
|
||||
createTrackbar( "Kernel size:\n 2n +1", window_name,
|
||||
&morph_size, max_kernel_size,
|
||||
Morphology_Operations );
|
||||
&morph_size, max_kernel_size,
|
||||
Morphology_Operations );
|
||||
|
||||
/// Default start
|
||||
Morphology_Operations( 0, 0 );
|
||||
|
@@ -44,12 +44,12 @@ int main( int, char** argv )
|
||||
|
||||
/// Create Trackbar to choose type of Threshold
|
||||
createTrackbar( trackbar_type,
|
||||
window_name, &threshold_type,
|
||||
max_type, Threshold_Demo );
|
||||
window_name, &threshold_type,
|
||||
max_type, Threshold_Demo );
|
||||
|
||||
createTrackbar( trackbar_value,
|
||||
window_name, &threshold_value,
|
||||
max_value, Threshold_Demo );
|
||||
window_name, &threshold_value,
|
||||
max_value, Threshold_Demo );
|
||||
|
||||
/// Call the function to initialize
|
||||
Threshold_Demo( 0, 0 );
|
||||
|
@@ -62,7 +62,7 @@ void thresh_callback(int, void* )
|
||||
findContours( threshold_output, contours, hierarchy, RETR_TREE, CHAIN_APPROX_SIMPLE, Point(0, 0) );
|
||||
|
||||
/// Find the convex hull object for each contour
|
||||
vector<vector<Point> >hull( contours.size() );
|
||||
vector<vector<Point> >hull( contours.size() );
|
||||
for( size_t i = 0; i < contours.size(); i++ )
|
||||
{ convexHull( Mat(contours[i]), hull[i], false ); }
|
||||
|
||||
|
@@ -43,7 +43,7 @@ int main( int argc, char* argv[])
|
||||
cout << "Hand written function times passed in seconds: " << t << endl;
|
||||
|
||||
imshow("Output", J);
|
||||
waitKey();
|
||||
waitKey(0);
|
||||
|
||||
Mat kern = (Mat_<char>(3,3) << 0, -1, 0,
|
||||
-1, 5, -1,
|
||||
@@ -55,7 +55,7 @@ int main( int argc, char* argv[])
|
||||
|
||||
imshow("Output", K);
|
||||
|
||||
waitKey();
|
||||
waitKey(0);
|
||||
return 0;
|
||||
}
|
||||
void Sharpen(const Mat& myImage,Mat& Result)
|
||||
|
@@ -76,8 +76,8 @@ int main(int argc, char *argv[])
|
||||
// Windows
|
||||
namedWindow(WIN_RF, WINDOW_AUTOSIZE );
|
||||
namedWindow(WIN_UT, WINDOW_AUTOSIZE );
|
||||
moveWindow(WIN_RF, 400 , 0); //750, 2 (bernat =0)
|
||||
moveWindow(WIN_UT, refS.width, 0); //1500, 2
|
||||
moveWindow(WIN_RF, 400 , 0); //750, 2 (bernat =0)
|
||||
moveWindow(WIN_UT, refS.width, 0); //1500, 2
|
||||
|
||||
cout << "Frame resolution: Width=" << refS.width << " Height=" << refS.height
|
||||
<< " of nr#: " << captRefrnc.get(CAP_PROP_FRAME_COUNT) << endl;
|
||||
|
Reference in New Issue
Block a user