Skip to content
Projects
Groups
Snippets
Help
Loading...
Sign in / Register
Toggle navigation
O
opencv
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Packages
Packages
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
submodule
opencv
Commits
8f32902c
Commit
8f32902c
authored
Apr 15, 2013
by
Andrey Kamaev
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Minimize usages of legacy C API inside the library
parent
4223a594
Hide whitespace changes
Inline
Side-by-side
Showing
45 changed files
with
184 additions
and
239 deletions
+184
-239
OpenCVDetectAndroidSDK.cmake
cmake/OpenCVDetectAndroidSDK.cmake
+1
-1
adding_images.rst
doc/tutorials/core/adding_images/adding_images.rst
+1
-2
basic_linear_transform.rst
...ls/core/basic_linear_transform/basic_linear_transform.rst
+1
-2
trackbar.rst
doc/tutorials/highgui/trackbar/trackbar.rst
+23
-25
linux_eclipse.rst
doc/tutorials/introduction/linux_eclipse/linux_eclipse.rst
+9
-17
load_save_image.rst
...utorials/introduction/load_save_image/load_save_image.rst
+4
-5
opencv.hpp
include/opencv2/opencv.hpp
+1
-2
drawing_functions.rst
modules/core/doc/drawing_functions.rst
+5
-4
intro.rst
modules/core/doc/intro.rst
+3
-3
main.cpp
modules/gpu/app/nv_perf_test/main.cpp
+0
-1
perf_core.cpp
modules/gpu/perf/perf_core.cpp
+4
-2
perf_imgproc.cpp
modules/gpu/perf/perf_imgproc.cpp
+2
-2
perf_precomp.hpp
modules/gpu/perf/perf_precomp.hpp
+0
-1
perf_video.cpp
modules/gpu/perf/perf_video.cpp
+1
-0
main.cpp
modules/gpu/perf4au/main.cpp
+0
-1
test_precomp.hpp
modules/gpu/test/test_precomp.hpp
+0
-1
feature_detection.rst
modules/imgproc/doc/feature_detection.rst
+7
-8
histograms.rst
modules/imgproc/doc/histograms.rst
+3
-3
imgproc_c.h
modules/imgproc/include/opencv2/imgproc/imgproc_c.h
+0
-1
compat.hpp
modules/legacy/include/opencv2/legacy/compat.hpp
+0
-8
corrimages.cpp
modules/legacy/src/corrimages.cpp
+0
-5
levmarprojbandle.cpp
modules/legacy/src/levmarprojbandle.cpp
+0
-3
trifocal.cpp
modules/legacy/src/trifocal.cpp
+0
-4
octave.cpp
modules/softcascade/src/octave.cpp
+1
-0
precomp.hpp
modules/softcascade/src/precomp.hpp
+0
-1
softcascade_init.cpp
modules/softcascade/src/softcascade_init.cpp
+0
-19
precomp.hpp
modules/ts/src/precomp.hpp
+0
-3
ts.cpp
modules/ts/src/ts.cpp
+2
-0
ts_arrtest.cpp
modules/ts/src/ts_arrtest.cpp
+1
-0
ts_func.cpp
modules/ts/src/ts_func.cpp
+25
-25
optflowgf.cpp
modules/video/src/optflowgf.cpp
+1
-1
precomp.hpp
modules/video/src/precomp.hpp
+0
-2
OpenEXRimages_HighDynamicRange_Retina_toneMapping.cpp
...cpp/OpenEXRimages_HighDynamicRange_Retina_toneMapping.cpp
+4
-4
OpenEXRimages_HighDynamicRange_Retina_toneMapping_video.cpp
...enEXRimages_HighDynamicRange_Retina_toneMapping_video.cpp
+3
-2
bgfg_gmg.cpp
samples/cpp/bgfg_gmg.cpp
+2
-1
detector_descriptor_evaluation.cpp
samples/cpp/detector_descriptor_evaluation.cpp
+7
-7
em.cpp
samples/cpp/em.cpp
+5
-5
fabmap_sample.cpp
samples/cpp/fabmap_sample.cpp
+4
-2
freak_demo.cpp
samples/cpp/freak_demo.cpp
+2
-3
hybridtrackingsample.cpp
samples/cpp/hybridtrackingsample.cpp
+0
-4
logpolar_bsm.cpp
samples/cpp/logpolar_bsm.cpp
+3
-1
morphology2.cpp
samples/cpp/morphology2.cpp
+0
-2
retinaDemo.cpp
samples/cpp/retinaDemo.cpp
+2
-1
retina_tutorial.cpp
samples/cpp/tutorial_code/contrib/retina_tutorial.cpp
+2
-1
tests.cpp
samples/gpu/performance/tests.cpp
+55
-54
No files found.
cmake/OpenCVDetectAndroidSDK.cmake
View file @
8f32902c
...
...
@@ -275,7 +275,7 @@ macro(add_android_project target path)
ocv_include_modules_recurse
(
${
android_proj_NATIVE_DEPS
}
)
ocv_include_directories
(
"
${
path
}
/jni"
)
if
(
NATIVE_APP_GLUE
)
if
(
NATIVE_APP_GLUE
AND 0
)
include_directories
(
${
ANDROID_NDK
}
/sources/android/native_app_glue
)
list
(
APPEND android_proj_jni_files
${
ANDROID_NDK
}
/sources/android/native_app_glue/android_native_app_glue.c
)
ocv_warnings_disable
(
CMAKE_C_FLAGS -Wstrict-prototypes -Wunused-parameter -Wmissing-prototypes
)
...
...
doc/tutorials/core/adding_images/adding_images.rst
View file @
8f32902c
...
...
@@ -35,8 +35,7 @@ As usual, after the not-so-lengthy explanation, let's go to the code:
.. code-block:: cpp
#include <cv.h>
#include <highgui.h>
#include <opencv2/opencv.hpp>
#include <iostream>
using namespace cv;
...
...
doc/tutorials/core/basic_linear_transform/basic_linear_transform.rst
View file @
8f32902c
...
...
@@ -72,8 +72,7 @@ Code
.. code-block:: cpp
#include <cv.h>
#include <highgui.h>
#include <opencv2/opencv.hpp>
#include <iostream>
using namespace cv;
...
...
doc/tutorials/highgui/trackbar/trackbar.rst
View file @
8f32902c
...
...
@@ -28,9 +28,7 @@ Let's modify the program made in the tutorial :ref:`Adding_Images`. We will let
.. code-block:: cpp
#include <cv.h>
#include <highgui.h>
#include <opencv2/opencv.hpp>
using namespace cv;
/// Global Variables
...
...
@@ -50,41 +48,41 @@ Let's modify the program made in the tutorial :ref:`Adding_Images`. We will let
*/
void on_trackbar( int, void* )
{
alpha = (double) alpha_slider/alpha_slider_max ;
beta = ( 1.0 - alpha );
alpha = (double) alpha_slider/alpha_slider_max ;
beta = ( 1.0 - alpha );
addWeighted( src1, alpha, src2, beta, 0.0, dst);
addWeighted( src1, alpha, src2, beta, 0.0, dst);
imshow( "Linear Blend", dst );
imshow( "Linear Blend", dst );
}
int main( int argc, char** argv )
{
/// Read image ( same size, same type )
src1 = imread("../../images/LinuxLogo.jpg");
src2 = imread("../../images/WindowsLogo.jpg");
/// Read image ( same size, same type )
src1 = imread("../../images/LinuxLogo.jpg");
src2 = imread("../../images/WindowsLogo.jpg");
if( !src1.data ) { printf("Error loading src1 \n"); return -1; }
if( !src2.data ) { printf("Error loading src2 \n"); return -1; }
if( !src1.data ) { printf("Error loading src1 \n"); return -1; }
if( !src2.data ) { printf("Error loading src2 \n"); return -1; }
/// Initialize values
alpha_slider = 0;
/// Initialize values
alpha_slider = 0;
/// Create Windows
namedWindow("Linear Blend", 1);
/// Create Windows
namedWindow("Linear Blend", 1);
/// Create Trackbars
char TrackbarName[50];
sprintf( TrackbarName, "Alpha x %d", alpha_slider_max );
/// Create Trackbars
char TrackbarName[50];
sprintf( TrackbarName, "Alpha x %d", alpha_slider_max );
createTrackbar( TrackbarName, "Linear Blend", &alpha_slider, alpha_slider_max, on_trackbar );
createTrackbar( TrackbarName, "Linear Blend", &alpha_slider, alpha_slider_max, on_trackbar );
/// Show some stuff
on_trackbar( alpha_slider, 0 );
/// Show some stuff
on_trackbar( alpha_slider, 0 );
/// Wait until user press some key
waitKey(0);
return 0;
/// Wait until user press some key
waitKey(0);
return 0;
}
...
...
doc/tutorials/introduction/linux_eclipse/linux_eclipse.rst
View file @
8f32902c
...
...
@@ -65,8 +65,7 @@ Making a project
.. code-block:: cpp
#include <cv.h>
#include <highgui.h>
#include <opencv2/opencv.hpp>
using namespace cv;
...
...
@@ -81,7 +80,7 @@ Making a project
return -1;
}
namedWindow( "Display Image",
CV_
WINDOW_AUTOSIZE );
namedWindow( "Display Image", WINDOW_AUTOSIZE );
imshow( "Display Image", image );
waitKey(0);
...
...
@@ -206,22 +205,15 @@ Say you have or create a new file, *helloworld.cpp* in a directory called *foo*:
.. code-block:: cpp
#include <cv.h>
#include <highgui.h>
#include <opencv2/opencv.hpp>
using namespace cv;
int main ( int argc, char **argv )
{
cvNamedWindow( "My Window", 1 );
IplImage *img = cvCreateImage( cvSize( 640, 480 ), IPL_DEPTH_8U, 1 );
CvFont font;
double hScale = 1.0;
double vScale = 1.0;
int lineWidth = 1;
cvInitFont( &font, CV_FONT_HERSHEY_SIMPLEX | CV_FONT_ITALIC,
hScale, vScale, 0, lineWidth );
cvPutText( img, "Hello World!", cvPoint( 200, 400 ), &font,
cvScalar( 255, 255, 0 ) );
cvShowImage( "My Window", img );
cvWaitKey();
Mat img(480, 640, CV_8U);
putText(img, "Hello World!", Point( 200, 400 ), FONT_HERSHEY_SIMPLEX | FONT_ITALIC, 1.0, Scalar( 255, 255, 0 ));
imshow("My Window", img);
waitKey();
return 0;
}
...
...
doc/tutorials/introduction/load_save_image/load_save_image.rst
View file @
8f32902c
...
...
@@ -26,8 +26,7 @@ Here it is:
.. code-block:: cpp
:linenos:
#include <cv.h>
#include <highgui.h>
#include <opencv2/opencv.hpp>
using namespace cv;
...
...
@@ -45,12 +44,12 @@ Here it is:
}
Mat gray_image;
cvtColor( image, gray_image, C
V
_BGR2GRAY );
cvtColor( image, gray_image, C
OLOR
_BGR2GRAY );
imwrite( "../../images/Gray_Image.jpg", gray_image );
namedWindow( imageName,
CV_
WINDOW_AUTOSIZE );
namedWindow( "Gray image",
CV_
WINDOW_AUTOSIZE );
namedWindow( imageName, WINDOW_AUTOSIZE );
namedWindow( "Gray image", WINDOW_AUTOSIZE );
imshow( imageName, image );
imshow( "Gray image", gray_image );
...
...
include/opencv2/opencv.hpp
View file @
8f32902c
...
...
@@ -44,15 +44,14 @@
#define __OPENCV_ALL_HPP__
#include "opencv2/core.hpp"
#include "opencv2/flann/miniflann.hpp"
#include "opencv2/imgproc.hpp"
#include "opencv2/photo.hpp"
#include "opencv2/video.hpp"
#include "opencv2/features2d.hpp"
#include "opencv2/objdetect.hpp"
#include "opencv2/calib3d.hpp"
#include "opencv2/ml.hpp"
#include "opencv2/highgui.hpp"
#include "opencv2/contrib.hpp"
#include "opencv2/ml.hpp"
#endif
modules/core/doc/drawing_functions.rst
View file @
8f32902c
...
...
@@ -507,10 +507,11 @@ The function draws contour outlines in the image if
:math:`\texttt{thickness} \ge 0` or fills the area bounded by the contours if
:math:`\texttt{thickness}<0` . The example below shows how to retrieve connected components from the binary image and label them: ::
#include "
cv.h
"
#include "
highgui.h
"
#include "
opencv2/imgproc.hpp
"
#include "
opencv2/highgui.hpp
"
using namespace cv;
using namespace std;
int main( int argc, char** argv )
{
...
...
@@ -530,7 +531,7 @@ The function draws contour outlines in the image if
vector<Vec4i> hierarchy;
findContours( src, contours, hierarchy,
CV_RETR_CCOMP, CV_
CHAIN_APPROX_SIMPLE );
RETR_CCOMP,
CHAIN_APPROX_SIMPLE );
// iterate through all the top-level contours,
// draw each connected component with its own random color
...
...
@@ -538,7 +539,7 @@ The function draws contour outlines in the image if
for( ; idx >= 0; idx = hierarchy[idx][0] )
{
Scalar color( rand()&255, rand()&255, rand()&255 );
drawContours( dst, contours, idx, color,
CV_
FILLED, 8, hierarchy );
drawContours( dst, contours, idx, color, FILLED, 8, hierarchy );
}
namedWindow( "Components", 1 );
...
...
modules/core/doc/intro.rst
View file @
8f32902c
...
...
@@ -104,8 +104,8 @@ OpenCV deallocates the memory automatically, as well as automatically allocates
Example: ::
#include "
cv.h
"
#include "
highgui.h
"
#include "
opencv2/imgproc.hpp
"
#include "
opencv2/highgui.hpp
"
using namespace cv;
...
...
@@ -119,7 +119,7 @@ Example: ::
for(;;)
{
cap >> frame;
cvtColor(frame, edges, C
V
_BGR2GRAY);
cvtColor(frame, edges, C
OLOR
_BGR2GRAY);
GaussianBlur(edges, edges, Size(7,7), 1.5, 1.5);
Canny(edges, edges, 0, 30, 3);
imshow("edges", edges);
...
...
modules/gpu/app/nv_perf_test/main.cpp
View file @
8f32902c
...
...
@@ -4,7 +4,6 @@
#include <opencv2/gpu.hpp>
#include <opencv2/highgui.hpp>
#include <opencv2/video.hpp>
#include <opencv2/legacy.hpp>
#include <opencv2/ts.hpp>
static
void
printOsInfo
()
...
...
modules/gpu/perf/perf_core.cpp
View file @
8f32902c
...
...
@@ -1305,7 +1305,9 @@ PERF_TEST_P(Sz_3Depth, Core_AddWeighted,
// GEMM
CV_FLAGS
(
GemmFlags
,
0
,
cv
::
GEMM_1_T
,
cv
::
GEMM_2_T
,
cv
::
GEMM_3_T
)
#define ALL_GEMM_FLAGS Values(0, CV_GEMM_A_T, CV_GEMM_B_T, CV_GEMM_C_T, CV_GEMM_A_T | CV_GEMM_B_T, CV_GEMM_A_T | CV_GEMM_C_T, CV_GEMM_A_T | CV_GEMM_B_T | CV_GEMM_C_T)
#define ALL_GEMM_FLAGS Values(0, (int)cv::GEMM_1_T, (int)cv::GEMM_2_T, (int)cv::GEMM_3_T, \
(int)cv::GEMM_1_T | cv::GEMM_2_T, (int)cv::GEMM_1_T | cv::GEMM_3_T, \
(int)cv::GEMM_1_T | cv::GEMM_2_T | cv::GEMM_3_T)
DEF_PARAM_TEST
(
Sz_Type_Flags
,
cv
::
Size
,
MatType
,
GemmFlags
);
...
...
@@ -2071,7 +2073,7 @@ PERF_TEST_P(Sz_Depth, Core_CountNonZero,
//////////////////////////////////////////////////////////////////////
// Reduce
CV_ENUM
(
ReduceCode
,
CV_REDUCE_SUM
,
CV_REDUCE_AVG
,
CV_REDUCE_MAX
,
CV_
REDUCE_MIN
)
CV_ENUM
(
ReduceCode
,
cv
::
REDUCE_SUM
,
cv
::
REDUCE_AVG
,
cv
::
REDUCE_MAX
,
cv
::
REDUCE_MIN
)
#define ALL_REDUCE_CODES ValuesIn(ReduceCode::all())
enum
{
Rows
=
0
,
Cols
=
1
};
...
...
modules/gpu/perf/perf_imgproc.cpp
View file @
8f32902c
...
...
@@ -1794,7 +1794,7 @@ PERF_TEST_P(Sz_Dp_MinDist, ImgProc_HoughCircles,
cv
::
gpu
::
GpuMat
d_circles
;
cv
::
gpu
::
HoughCirclesBuf
d_buf
;
TEST_CYCLE
()
cv
::
gpu
::
HoughCircles
(
d_src
,
d_circles
,
d_buf
,
CV_
HOUGH_GRADIENT
,
dp
,
minDist
,
cannyThreshold
,
votesThreshold
,
minRadius
,
maxRadius
);
TEST_CYCLE
()
cv
::
gpu
::
HoughCircles
(
d_src
,
d_circles
,
d_buf
,
cv
::
HOUGH_GRADIENT
,
dp
,
minDist
,
cannyThreshold
,
votesThreshold
,
minRadius
,
maxRadius
);
cv
::
Mat
gpu_circles
(
d_circles
);
cv
::
Vec3f
*
begin
=
gpu_circles
.
ptr
<
cv
::
Vec3f
>
(
0
);
...
...
@@ -1806,7 +1806,7 @@ PERF_TEST_P(Sz_Dp_MinDist, ImgProc_HoughCircles,
{
std
::
vector
<
cv
::
Vec3f
>
cpu_circles
;
TEST_CYCLE
()
cv
::
HoughCircles
(
src
,
cpu_circles
,
CV_
HOUGH_GRADIENT
,
dp
,
minDist
,
cannyThreshold
,
votesThreshold
,
minRadius
,
maxRadius
);
TEST_CYCLE
()
cv
::
HoughCircles
(
src
,
cpu_circles
,
cv
::
HOUGH_GRADIENT
,
dp
,
minDist
,
cannyThreshold
,
votesThreshold
,
minRadius
,
maxRadius
);
SANITY_CHECK
(
cpu_circles
);
}
...
...
modules/gpu/perf/perf_precomp.hpp
View file @
8f32902c
...
...
@@ -63,7 +63,6 @@
#include "opencv2/calib3d.hpp"
#include "opencv2/imgproc.hpp"
#include "opencv2/video.hpp"
#include "opencv2/legacy.hpp"
#include "opencv2/photo.hpp"
#include "opencv2/core/gpu_private.hpp"
...
...
modules/gpu/perf/perf_video.cpp
View file @
8f32902c
...
...
@@ -41,6 +41,7 @@
//M*/
#include "perf_precomp.hpp"
#include "opencv2/legacy.hpp"
using
namespace
std
;
using
namespace
testing
;
...
...
modules/gpu/perf4au/main.cpp
View file @
8f32902c
...
...
@@ -49,7 +49,6 @@
#include "opencv2/gpu.hpp"
#include "opencv2/highgui.hpp"
#include "opencv2/video.hpp"
#include "opencv2/legacy.hpp"
#include "opencv2/ts.hpp"
#include "opencv2/ts/gpu_perf.hpp"
...
...
modules/gpu/test/test_precomp.hpp
View file @
8f32902c
...
...
@@ -73,7 +73,6 @@
#include "opencv2/ts.hpp"
#include "opencv2/ts/gpu_test.hpp"
#include "opencv2/gpu.hpp"
#include "opencv2/legacy.hpp"
#include "interpolation.hpp"
#include "main_test_nvidia.h"
...
...
modules/imgproc/doc/feature_detection.rst
View file @
8f32902c
...
...
@@ -306,8 +306,8 @@ The function finds circles in a grayscale image using a modification of the Houg
Example: ::
#include <
cv.h
>
#include <
highgui.h
>
#include <
opencv2/imgproc.hpp
>
#include <
opencv2/highgui.hpp
>
#include <math.h>
using namespace cv;
...
...
@@ -317,11 +317,11 @@ Example: ::
Mat img, gray;
if( argc != 2 && !(img=imread(argv[1], 1)).data)
return -1;
cvtColor(img, gray, C
V
_BGR2GRAY);
cvtColor(img, gray, C
OLOR
_BGR2GRAY);
// smooth it, otherwise a lot of false circles may be detected
GaussianBlur( gray, gray, Size(9, 9), 2, 2 );
vector<Vec3f> circles;
HoughCircles(gray, circles,
CV_
HOUGH_GRADIENT,
HoughCircles(gray, circles, HOUGH_GRADIENT,
2, gray->rows/4, 200, 100 );
for( size_t i = 0; i < circles.size(); i++ )
{
...
...
@@ -426,9 +426,8 @@ The function implements the probabilistic Hough transform algorithm for line det
/* This is a standalone program. Pass an image name as the first parameter
of the program. Switch between standard and probabilistic Hough transform
by changing "#if 1" to "#if 0" and back */
#include <cv.h>
#include <highgui.h>
#include <math.h>
#include <opencv2/imgproc.hpp>
#include <opencv2/highgui.hpp>
using namespace cv;
...
...
@@ -439,7 +438,7 @@ The function implements the probabilistic Hough transform algorithm for line det
return -1;
Canny( src, dst, 50, 200, 3 );
cvtColor( dst, color_dst, C
V
_GRAY2BGR );
cvtColor( dst, color_dst, C
OLOR
_GRAY2BGR );
#if 0
vector<Vec2f> lines;
...
...
modules/imgproc/doc/histograms.rst
View file @
8f32902c
...
...
@@ -42,8 +42,8 @@ arrays. The elements of a tuple used to increment
a histogram bin are taken from the corresponding
input arrays at the same location. The sample below shows how to compute a 2D Hue-Saturation histogram for a color image. ::
#include <
cv.h
>
#include <
highgui.h
>
#include <
opencv2/imgproc.hpp
>
#include <
opencv2/highgui.hpp
>
using namespace cv;
...
...
@@ -53,7 +53,7 @@ input arrays at the same location. The sample below shows how to compute a 2D Hu
if( argc != 2 || !(src=imread(argv[1], 1)).data )
return -1;
cvtColor(src, hsv, C
V
_BGR2HSV);
cvtColor(src, hsv, C
OLOR
_BGR2HSV);
// Quantize the hue to 30 levels
// and the saturation to 32 levels
...
...
modules/imgproc/include/opencv2/imgproc/imgproc_c.h
View file @
8f32902c
...
...
@@ -43,7 +43,6 @@
#ifndef __OPENCV_IMGPROC_IMGPROC_C_H__
#define __OPENCV_IMGPROC_IMGPROC_C_H__
#include "opencv2/core/core_c.h"
#include "opencv2/imgproc/types_c.h"
#ifdef __cplusplus
...
...
modules/legacy/include/opencv2/legacy/compat.hpp
View file @
8f32902c
...
...
@@ -39,14 +39,6 @@
//
//M*/
/*
A few macros and definitions for backward compatibility
with the previous versions of OpenCV. They are obsolete and
are likely to be removed in future. To check whether your code
uses any of these, define CV_NO_BACKWARD_COMPATIBILITY before
including cv.h.
*/
#ifndef __OPENCV_COMPAT_HPP__
#define __OPENCV_COMPAT_HPP__
...
...
modules/legacy/src/corrimages.cpp
View file @
8f32902c
...
...
@@ -40,11 +40,6 @@
//M*/
#include "precomp.hpp"
//#include "cvtypes.h"
//#include <float.h>
//#include <limits.h>
//#include "cv.h"
//#include "highgui.h"
#if 0
#include <stdio.h>
...
...
modules/legacy/src/levmarprojbandle.cpp
View file @
8f32902c
...
...
@@ -41,11 +41,8 @@
#include "precomp.hpp"
//#include "cvtypes.h"
#include <float.h>
#include <limits.h>
//#include "cv.h"
#include <stdio.h>
void
icvReconstructPoints4DStatus
(
CvMat
**
projPoints
,
CvMat
**
projMatrs
,
CvMat
**
presPoints
,
CvMat
*
points4D
,
int
numImages
,
CvMat
**
projError
=
0
);
...
...
modules/legacy/src/trifocal.cpp
View file @
8f32902c
...
...
@@ -42,12 +42,8 @@
#include "precomp.hpp"
#include "opencv2/calib3d/calib3d_c.h"
//#include "cvtypes.h"
#include <float.h>
#include <limits.h>
//#include "cv.h"
//#include "windows.h"
#include <stdio.h>
/* Valery Mosyagin */
...
...
modules/softcascade/src/octave.cpp
View file @
8f32902c
...
...
@@ -41,6 +41,7 @@
//M*/
#include "precomp.hpp"
#include "opencv2/ml.hpp"
#include <queue>
using
cv
::
InputArray
;
...
...
modules/softcascade/src/precomp.hpp
View file @
8f32902c
...
...
@@ -45,7 +45,6 @@
#include "opencv2/softcascade.hpp"
#include "opencv2/imgproc.hpp"
#include "opencv2/ml.hpp"
#include "opencv2/core/private.hpp"
#include "opencv2/core/gpu_private.hpp"
...
...
modules/softcascade/src/softcascade_init.cpp
View file @
8f32902c
...
...
@@ -63,22 +63,4 @@ bool initModule_softcascade(void)
return
(
sc1
->
info
()
!=
0
)
&&
(
sc
->
info
()
!=
0
);
}
namespace
internal
{
void
error
(
const
char
*
error_string
,
const
char
*
file
,
const
int
line
,
const
char
*
func
)
{
int
code
=
CV_GpuApiCallError
;
if
(
std
::
uncaught_exception
())
{
const
char
*
errorStr
=
cvErrorStr
(
code
);
const
char
*
function
=
func
?
func
:
"unknown function"
;
std
::
cerr
<<
"OpenCV Error: "
<<
errorStr
<<
"("
<<
error_string
<<
") in "
<<
function
<<
", file "
<<
file
<<
", line "
<<
line
;
std
::
cerr
.
flush
();
}
else
cv
::
error
(
cv
::
Exception
(
code
,
error_string
,
func
,
file
,
line
)
);
}
}
}
}
\ No newline at end of file
modules/ts/src/precomp.hpp
View file @
8f32902c
#include "opencv2/ts.hpp"
#include "opencv2/core/core_c.h"
#include "opencv2/core/utility.hpp"
#include "opencv2/core/private.hpp"
#ifdef GTEST_LINKED_AS_SHARED_LIBRARY
...
...
modules/ts/src/ts.cpp
View file @
8f32902c
...
...
@@ -40,6 +40,8 @@
//M*/
#include "precomp.hpp"
#include "opencv2/core/core_c.h"
#include <ctype.h>
#include <stdarg.h>
#include <stdlib.h>
...
...
modules/ts/src/ts_arrtest.cpp
View file @
8f32902c
...
...
@@ -40,6 +40,7 @@
//M*/
#include "precomp.hpp"
#include "opencv2/core/core_c.h"
namespace
cvtest
{
...
...
modules/ts/src/ts_func.cpp
View file @
8f32902c
...
...
@@ -645,7 +645,7 @@ void erode(const Mat& _src, Mat& dst, const Mat& _kernel, Point anchor,
}
if
(
anchor
==
Point
(
-
1
,
-
1
)
)
anchor
=
Point
(
kernel
.
cols
/
2
,
kernel
.
rows
/
2
);
if
(
borderType
==
IPL_
BORDER_CONSTANT
)
if
(
borderType
==
BORDER_CONSTANT
)
borderValue
=
getMaxVal
(
src
.
depth
());
copyMakeBorder
(
_src
,
src
,
anchor
.
y
,
kernel
.
rows
-
anchor
.
y
-
1
,
anchor
.
x
,
kernel
.
cols
-
anchor
.
x
-
1
,
...
...
@@ -702,7 +702,7 @@ void dilate(const Mat& _src, Mat& dst, const Mat& _kernel, Point anchor,
}
if
(
anchor
==
Point
(
-
1
,
-
1
)
)
anchor
=
Point
(
kernel
.
cols
/
2
,
kernel
.
rows
/
2
);
if
(
borderType
==
IPL_
BORDER_CONSTANT
)
if
(
borderType
==
BORDER_CONSTANT
)
borderValue
=
getMinVal
(
src
.
depth
());
copyMakeBorder
(
_src
,
src
,
anchor
.
y
,
kernel
.
rows
-
anchor
.
y
-
1
,
anchor
.
x
,
kernel
.
cols
-
anchor
.
x
-
1
,
...
...
@@ -778,7 +778,7 @@ void filter2D(const Mat& _src, Mat& dst, int ddepth, const Mat& kernel,
CV_Assert
(
kernel
.
type
()
==
CV_32F
||
kernel
.
type
()
==
CV_64F
);
if
(
anchor
==
Point
(
-
1
,
-
1
)
)
anchor
=
Point
(
kernel
.
cols
/
2
,
kernel
.
rows
/
2
);
if
(
borderType
==
IPL_
BORDER_CONSTANT
)
if
(
borderType
==
BORDER_CONSTANT
)
borderValue
=
getMinVal
(
src
.
depth
());
copyMakeBorder
(
_src
,
src
,
anchor
.
y
,
kernel
.
rows
-
anchor
.
y
-
1
,
anchor
.
x
,
kernel
.
cols
-
anchor
.
x
-
1
,
...
...
@@ -830,11 +830,11 @@ static int borderInterpolate( int p, int len, int borderType )
{
if
(
(
unsigned
)
p
<
(
unsigned
)
len
)
;
else
if
(
borderType
==
IPL_
BORDER_REPLICATE
)
else
if
(
borderType
==
BORDER_REPLICATE
)
p
=
p
<
0
?
0
:
len
-
1
;
else
if
(
borderType
==
IPL_BORDER_REFLECT
||
borderType
==
IPL_
BORDER_REFLECT_101
)
else
if
(
borderType
==
BORDER_REFLECT
||
borderType
==
BORDER_REFLECT_101
)
{
int
delta
=
borderType
==
IPL_
BORDER_REFLECT_101
;
int
delta
=
borderType
==
BORDER_REFLECT_101
;
if
(
len
==
1
)
return
0
;
do
...
...
@@ -846,17 +846,17 @@ static int borderInterpolate( int p, int len, int borderType )
}
while
(
(
unsigned
)
p
>=
(
unsigned
)
len
);
}
else
if
(
borderType
==
IPL_
BORDER_WRAP
)
else
if
(
borderType
==
BORDER_WRAP
)
{
if
(
p
<
0
)
p
-=
((
p
-
len
+
1
)
/
len
)
*
len
;
if
(
p
>=
len
)
p
%=
len
;
}
else
if
(
borderType
==
IPL_
BORDER_CONSTANT
)
else
if
(
borderType
==
BORDER_CONSTANT
)
p
=
-
1
;
else
CV_Error
(
CV_
StsBadArg
,
"Unknown/unsupported border type"
);
CV_Error
(
Error
::
StsBadArg
,
"Unknown/unsupported border type"
);
return
p
;
}
...
...
@@ -868,7 +868,7 @@ void copyMakeBorder(const Mat& src, Mat& dst, int top, int bottom, int left, int
int
i
,
j
,
k
,
esz
=
(
int
)
src
.
elemSize
();
int
width
=
src
.
cols
*
esz
,
width1
=
dst
.
cols
*
esz
;
if
(
borderType
==
IPL_
BORDER_CONSTANT
)
if
(
borderType
==
BORDER_CONSTANT
)
{
vector
<
uchar
>
valvec
((
src
.
cols
+
left
+
right
)
*
esz
);
uchar
*
val
=
&
valvec
[
0
];
...
...
@@ -1304,7 +1304,7 @@ double norm(const Mat& src, int normType, const Mat& mask)
result
=
norm_
((
const
double
*
)
sptr
,
total
,
cn
,
normType
,
result
,
mptr
);
break
;
default
:
CV_Error
(
CV_
StsUnsupportedFormat
,
""
);
CV_Error
(
Error
::
StsUnsupportedFormat
,
""
);
};
}
if
(
normType0
==
NORM_L2
)
...
...
@@ -1382,7 +1382,7 @@ double norm(const Mat& src1, const Mat& src2, int normType, const Mat& mask)
result
=
norm_
((
const
double
*
)
sptr1
,
(
const
double
*
)
sptr2
,
total
,
cn
,
normType
,
result
,
mptr
);
break
;
default
:
CV_Error
(
CV_
StsUnsupportedFormat
,
""
);
CV_Error
(
Error
::
StsUnsupportedFormat
,
""
);
};
}
if
(
normType0
==
NORM_L2
)
...
...
@@ -1441,7 +1441,7 @@ double crossCorr(const Mat& src1, const Mat& src2)
result
+=
crossCorr_
((
const
double
*
)
sptr1
,
(
const
double
*
)
sptr2
,
total
);
break
;
default
:
CV_Error
(
CV_
StsUnsupportedFormat
,
""
);
CV_Error
(
Error
::
StsUnsupportedFormat
,
""
);
};
}
return
result
;
...
...
@@ -1574,7 +1574,7 @@ compare_(const _Tp* src1, const _Tp* src2, uchar* dst, size_t total, int cmpop)
dst
[
i
]
=
src1
[
i
]
>
src2
[
i
]
?
255
:
0
;
break
;
default
:
CV_Error
(
CV_
StsBadArg
,
"Unknown comparison operation"
);
CV_Error
(
Error
::
StsBadArg
,
"Unknown comparison operation"
);
}
}
...
...
@@ -1610,7 +1610,7 @@ compareS_(const _Tp* src1, _WTp value, uchar* dst, size_t total, int cmpop)
dst
[
i
]
=
src1
[
i
]
>
value
?
255
:
0
;
break
;
default
:
CV_Error
(
CV_
StsBadArg
,
"Unknown comparison operation"
);
CV_Error
(
Error
::
StsBadArg
,
"Unknown comparison operation"
);
}
}
...
...
@@ -1657,7 +1657,7 @@ void compare(const Mat& src1, const Mat& src2, Mat& dst, int cmpop)
compare_
((
const
double
*
)
sptr1
,
(
const
double
*
)
sptr2
,
dptr
,
total
,
cmpop
);
break
;
default
:
CV_Error
(
CV_
StsUnsupportedFormat
,
""
);
CV_Error
(
Error
::
StsUnsupportedFormat
,
""
);
}
}
}
...
...
@@ -1704,7 +1704,7 @@ void compare(const Mat& src, double value, Mat& dst, int cmpop)
compareS_
((
const
double
*
)
sptr
,
value
,
dptr
,
total
,
cmpop
);
break
;
default
:
CV_Error
(
CV_
StsUnsupportedFormat
,
""
);
CV_Error
(
Error
::
StsUnsupportedFormat
,
""
);
}
}
}
...
...
@@ -1836,7 +1836,7 @@ bool cmpUlps(const Mat& src1, const Mat& src2, int imaxDiff, double* _realmaxdif
realmaxdiff
=
cmpUlpsFlt_
((
const
int64
*
)
sptr1
,
(
const
int64
*
)
sptr2
,
total
,
imaxDiff
,
startidx
,
idx
);
break
;
default
:
CV_Error
(
CV_
StsUnsupportedFormat
,
""
);
CV_Error
(
Error
::
StsUnsupportedFormat
,
""
);
}
if
(
_realmaxdiff
)
...
...
@@ -1925,7 +1925,7 @@ int check( const Mat& a, double fmin, double fmax, vector<int>* _idx )
checkFlt_
((
const
double
*
)
aptr
,
total
,
fmin
,
fmax
,
startidx
,
idx
);
break
;
default
:
CV_Error
(
CV_
StsUnsupportedFormat
,
""
);
CV_Error
(
Error
::
StsUnsupportedFormat
,
""
);
}
if
(
idx
!=
0
)
...
...
@@ -2344,7 +2344,7 @@ void transform( const Mat& src, Mat& dst, const Mat& transmat, const Mat& _shift
transform_
((
const
double
*
)
sptr
,
(
double
*
)
dptr
,
total
,
scn
,
dcn
,
mat
);
break
;
default
:
CV_Error
(
CV_
StsUnsupportedFormat
,
""
);
CV_Error
(
Error
::
StsUnsupportedFormat
,
""
);
}
}
}
...
...
@@ -2401,7 +2401,7 @@ static void minmax(const Mat& src1, const Mat& src2, Mat& dst, char op)
minmax_
((
const
double
*
)
sptr1
,
(
const
double
*
)
sptr2
,
(
double
*
)
dptr
,
total
,
op
);
break
;
default
:
CV_Error
(
CV_
StsUnsupportedFormat
,
""
);
CV_Error
(
Error
::
StsUnsupportedFormat
,
""
);
}
}
}
...
...
@@ -2469,7 +2469,7 @@ static void minmax(const Mat& src1, double val, Mat& dst, char op)
minmax_
((
const
double
*
)
sptr1
,
saturate_cast
<
double
>
(
val
),
(
double
*
)
dptr
,
total
,
op
);
break
;
default
:
CV_Error
(
CV_
StsUnsupportedFormat
,
""
);
CV_Error
(
Error
::
StsUnsupportedFormat
,
""
);
}
}
}
...
...
@@ -2541,7 +2541,7 @@ static void muldiv(const Mat& src1, const Mat& src2, Mat& dst, double scale, cha
muldiv_
((
const
double
*
)
sptr1
,
(
const
double
*
)
sptr2
,
(
double
*
)
dptr
,
total
,
scale
,
op
);
break
;
default
:
CV_Error
(
CV_
StsUnsupportedFormat
,
""
);
CV_Error
(
Error
::
StsUnsupportedFormat
,
""
);
}
}
}
...
...
@@ -2626,7 +2626,7 @@ Scalar mean(const Mat& src, const Mat& mask)
mean_
((
const
double
*
)
sptr
,
mptr
,
total
,
cn
,
sum
,
nz
);
break
;
default
:
CV_Error
(
CV_
StsUnsupportedFormat
,
""
);
CV_Error
(
Error
::
StsUnsupportedFormat
,
""
);
}
}
...
...
@@ -2863,7 +2863,7 @@ static void writeElems(std::ostream& out, const void* data, int nelems, int dept
out
.
precision
(
pp
);
}
else
CV_Error
(
CV_
StsUnsupportedFormat
,
""
);
CV_Error
(
Error
::
StsUnsupportedFormat
,
""
);
}
...
...
modules/video/src/optflowgf.cpp
View file @
8f32902c
...
...
@@ -56,7 +56,7 @@ FarnebackPolyExp( const Mat& src, Mat& dst, int n, double sigma )
{
int
k
,
x
,
y
;
a
ssert
(
src
.
type
()
==
CV_32FC1
);
CV_A
ssert
(
src
.
type
()
==
CV_32FC1
);
int
width
=
src
.
cols
;
int
height
=
src
.
rows
;
AutoBuffer
<
float
>
kbuf
(
n
*
6
+
3
),
_row
((
width
+
n
*
2
)
*
3
);
...
...
modules/video/src/precomp.hpp
View file @
8f32902c
...
...
@@ -44,8 +44,6 @@
#define __OPENCV_PRECOMP_H__
#include "opencv2/video.hpp"
#include "opencv2/video/tracking_c.h"
#include "opencv2/core/utility.hpp"
#include "opencv2/core/private.hpp"
...
...
samples/cpp/OpenEXRimages_HighDynamicRange_Retina_toneMapping.cpp
View file @
8f32902c
...
...
@@ -10,7 +10,8 @@
#include <iostream>
#include <cstring>
#include "opencv2/opencv.hpp"
#include "opencv2/contrib.hpp"
#include "opencv2/highgui.hpp"
static
void
help
(
std
::
string
errorMessage
)
{
...
...
@@ -28,7 +29,7 @@ static void drawPlot(const cv::Mat curve, const std::string figureTitle, const i
cv
::
Mat
displayedCurveImage
=
cv
::
Mat
::
ones
(
200
,
curve
.
size
().
height
,
CV_8U
);
cv
::
Mat
windowNormalizedCurve
;
normalize
(
curve
,
windowNormalizedCurve
,
0
,
200
,
CV
_MINMAX
,
CV_32F
);
normalize
(
curve
,
windowNormalizedCurve
,
0
,
200
,
cv
::
NORM
_MINMAX
,
CV_32F
);
displayedCurveImage
=
cv
::
Scalar
::
all
(
255
);
// set a white background
int
binW
=
cvRound
((
double
)
displayedCurveImage
.
cols
/
curve
.
size
().
height
);
...
...
@@ -80,8 +81,7 @@ static void drawPlot(const cv::Mat curve, const std::string figureTitle, const i
normalize
(
hist
,
normalizedHist
,
1
,
0
,
cv
::
NORM_L1
,
CV_32F
);
// normalize histogram so that its sum equals 1
double
min_val
,
max_val
;
CvMat
histArr
(
normalizedHist
);
cvMinMaxLoc
(
&
histArr
,
&
min_val
,
&
max_val
);
minMaxLoc
(
normalizedHist
,
&
min_val
,
&
max_val
);
//std::cout<<"Hist max,min = "<<max_val<<", "<<min_val<<std::endl;
// compute density probability
...
...
samples/cpp/OpenEXRimages_HighDynamicRange_Retina_toneMapping_video.cpp
View file @
8f32902c
...
...
@@ -14,7 +14,8 @@
#include <stdio.h>
#include <cstring>
#include "opencv2/opencv.hpp"
#include "opencv2/contrib.hpp"
#include "opencv2/highgui.hpp"
static
void
help
(
std
::
string
errorMessage
)
{
...
...
@@ -38,7 +39,7 @@ static void drawPlot(const cv::Mat curve, const std::string figureTitle, const i
cv
::
Mat
displayedCurveImage
=
cv
::
Mat
::
ones
(
200
,
curve
.
size
().
height
,
CV_8U
);
cv
::
Mat
windowNormalizedCurve
;
normalize
(
curve
,
windowNormalizedCurve
,
0
,
200
,
CV
_MINMAX
,
CV_32F
);
normalize
(
curve
,
windowNormalizedCurve
,
0
,
200
,
cv
::
NORM
_MINMAX
,
CV_32F
);
displayedCurveImage
=
cv
::
Scalar
::
all
(
255
);
// set a white background
int
binW
=
cvRound
((
double
)
displayedCurveImage
.
cols
/
curve
.
size
().
height
);
...
...
samples/cpp/bgfg_gmg.cpp
View file @
8f32902c
...
...
@@ -5,7 +5,8 @@
* Author: Andrew B. Godbehere
*/
#include <opencv2/opencv.hpp>
#include "opencv2/video.hpp"
#include "opencv2/highgui.hpp"
#include <opencv2/core/utility.hpp>
#include <iostream>
...
...
samples/cpp/detector_descriptor_evaluation.cpp
View file @
8f32902c
...
...
@@ -39,10 +39,10 @@
//
//M*/
#include "opencv2/imgproc
/imgproc
.hpp"
#include "opencv2/highgui
/highgui
.hpp"
#include "opencv2/features2d
/features2d
.hpp"
#include "opencv2/legacy
/legacy
.hpp"
#include "opencv2/imgproc.hpp"
#include "opencv2/highgui.hpp"
#include "opencv2/features2d.hpp"
#include "opencv2/legacy.hpp"
#include <limits>
#include <cstdio>
...
...
@@ -93,7 +93,7 @@ static void calcKeyPointProjections( const vector<KeyPoint>& src, const Mat_<dou
{
if
(
!
src
.
empty
()
)
{
a
ssert
(
!
H
.
empty
()
&&
H
.
cols
==
3
&&
H
.
rows
==
3
);
CV_A
ssert
(
!
H
.
empty
()
&&
H
.
cols
==
3
&&
H
.
rows
==
3
);
dst
.
resize
(
src
.
size
());
vector
<
KeyPoint
>::
const_iterator
srcIt
=
src
.
begin
();
vector
<
KeyPoint
>::
iterator
dstIt
=
dst
.
begin
();
...
...
@@ -109,7 +109,7 @@ static void calcKeyPointProjections( const vector<KeyPoint>& src, const Mat_<dou
Mat_
<
double
>
Aff
;
linearizeHomographyAt
(
H
,
srcIt
->
pt
,
Aff
);
Mat_
<
double
>
dstM
;
invert
(
Aff
*
invM
*
Aff
.
t
(),
dstM
);
Mat_
<
double
>
eval
;
eigen
(
dstM
,
eval
);
a
ssert
(
eval
(
0
,
0
)
&&
eval
(
1
,
0
)
);
CV_A
ssert
(
eval
(
0
,
0
)
&&
eval
(
1
,
0
)
);
float
dstSize
=
(
float
)
pow
(
1.
/
(
eval
(
0
,
0
)
*
eval
(
1
,
0
)),
0.25
);
// TODO: check angle projection
...
...
@@ -526,7 +526,7 @@ inline void writeKeypoints( FileStorage& fs, const vector<KeyPoint>& keypoints,
inline
void
readKeypoints
(
FileStorage
&
fs
,
vector
<
KeyPoint
>&
keypoints
,
int
imgIdx
)
{
a
ssert
(
fs
.
isOpened
()
);
CV_A
ssert
(
fs
.
isOpened
()
);
stringstream
imgName
;
imgName
<<
"img"
<<
imgIdx
;
read
(
fs
[
imgName
.
str
()],
keypoints
);
}
...
...
samples/cpp/em.cpp
View file @
8f32902c
#include "opencv2/
legacy/legacy
.hpp"
#include "opencv2/
highgui/highgui
.hpp"
#include "opencv2/
highgui
.hpp"
#include "opencv2/
legacy
.hpp"
using
namespace
cv
;
...
...
@@ -45,7 +45,7 @@ int main( int /*argc*/, char** /*argv*/ )
params
.
start_step
=
CvEM
::
START_AUTO_STEP
;
params
.
term_crit
.
max_iter
=
300
;
params
.
term_crit
.
epsilon
=
0.1
;
params
.
term_crit
.
type
=
CV_TERMCRIT_ITER
|
CV_TERMCRIT_
EPS
;
params
.
term_crit
.
type
=
TermCriteria
::
COUNT
|
TermCriteria
::
EPS
;
// cluster the data
em_model
.
train
(
samples
,
Mat
(),
params
,
&
labels
);
...
...
@@ -76,7 +76,7 @@ int main( int /*argc*/, char** /*argv*/ )
int
response
=
cvRound
(
em_model
.
predict
(
sample
));
Scalar
c
=
colors
[
response
];
circle
(
img
,
Point
(
j
,
i
),
1
,
c
*
0.75
,
CV_
FILLED
);
circle
(
img
,
Point
(
j
,
i
),
1
,
c
*
0.75
,
FILLED
);
}
}
...
...
@@ -84,7 +84,7 @@ int main( int /*argc*/, char** /*argv*/ )
for
(
i
=
0
;
i
<
nsamples
;
i
++
)
{
Point
pt
(
cvRound
(
samples
.
at
<
float
>
(
i
,
0
)),
cvRound
(
samples
.
at
<
float
>
(
i
,
1
)));
circle
(
img
,
pt
,
1
,
colors
[
labels
.
at
<
int
>
(
i
)],
CV_
FILLED
);
circle
(
img
,
pt
,
1
,
colors
[
labels
.
at
<
int
>
(
i
)],
FILLED
);
}
imshow
(
"EM-clustering result"
,
img
);
...
...
samples/cpp/fabmap_sample.cpp
View file @
8f32902c
...
...
@@ -49,9 +49,11 @@
//
//M*/
#include <iostream>
#include "opencv2/opencv.hpp"
#include "opencv2/nonfree/nonfree.hpp"
#include "opencv2/contrib.hpp"
#include "opencv2/highgui.hpp"
#include "opencv2/nonfree.hpp"
using
namespace
cv
;
using
namespace
std
;
...
...
samples/cpp/freak_demo.cpp
View file @
8f32902c
...
...
@@ -43,7 +43,6 @@
#include <opencv2/highgui.hpp>
#include <opencv2/features2d.hpp>
#include <opencv2/nonfree.hpp>
#include <opencv2/legacy.hpp>
using
namespace
cv
;
...
...
@@ -95,9 +94,9 @@ int main( int argc, char** argv ) {
// MATCHER
// The standard Hamming distance can be used such as
// B
ruteForceMatcher<Hamming> matcher
;
// B
FMatcher matcher(NORM_HAMMING)
;
// or the proposed cascade of hamming distance using SSSE3
B
ruteForceMatcher
<
Hamming
>
matcher
;
B
FMatcher
matcher
(
NORM_HAMMING
)
;
// detect
double
t
=
(
double
)
getTickCount
();
...
...
samples/cpp/hybridtrackingsample.cpp
View file @
8f32902c
...
...
@@ -11,10 +11,6 @@
*
*/
//#include <cv.h>
//#include <ml.h>
//#include <cvaux.h>
//#include <highgui.h>
#include <stdio.h>
#include <time.h>
#include <iostream>
...
...
samples/cpp/logpolar_bsm.cpp
View file @
8f32902c
...
...
@@ -6,7 +6,9 @@
* PSPC-lab - University of Genoa
*/
#include "opencv2/opencv.hpp"
#include "opencv2/contrib.hpp"
#include "opencv2/highgui.hpp"
#include <iostream>
#include <cmath>
...
...
samples/cpp/morphology2.cpp
View file @
8f32902c
#define CV_NO_BACKWARD_COMPATIBILITY
#include "opencv2/imgproc/imgproc.hpp"
#include "opencv2/highgui/highgui.hpp"
#include <stdlib.h>
...
...
samples/cpp/retinaDemo.cpp
View file @
8f32902c
...
...
@@ -9,7 +9,8 @@
#include <iostream>
#include <cstring>
#include "opencv2/opencv.hpp"
#include "opencv2/contrib.hpp"
#include "opencv2/highgui.hpp"
static
void
help
(
std
::
string
errorMessage
)
{
...
...
samples/cpp/tutorial_code/contrib/retina_tutorial.cpp
View file @
8f32902c
...
...
@@ -9,7 +9,8 @@
#include <iostream>
#include <cstring>
#include "opencv2/opencv.hpp"
#include "opencv2/contrib.hpp"
#include "opencv2/highgui.hpp"
static
void
help
(
std
::
string
errorMessage
)
{
...
...
samples/gpu/performance/tests.cpp
View file @
8f32902c
#include <stdexcept>
#include "opencv2/imgproc/imgproc.hpp"
#include "opencv2/highgui/highgui.hpp"
#include "opencv2/calib3d/calib3d.hpp"
#include "opencv2/video/video.hpp"
#include "opencv2/gpu/gpu.hpp"
#include "opencv2/legacy/legacy.hpp"
#include "opencv2/imgproc.hpp"
#include "opencv2/highgui.hpp"
#include "opencv2/calib3d.hpp"
#include "opencv2/video.hpp"
#include "opencv2/gpu.hpp"
#include "opencv2/legacy.hpp"
#include "performance.h"
#include "opencv2/opencv_modules.hpp"
...
...
@@ -21,7 +22,7 @@ static void InitMatchTemplate()
Mat
src
;
gen
(
src
,
500
,
500
,
CV_32F
,
0
,
1
);
Mat
templ
;
gen
(
templ
,
500
,
500
,
CV_32F
,
0
,
1
);
gpu
::
GpuMat
d_src
(
src
),
d_templ
(
templ
),
d_dst
;
gpu
::
matchTemplate
(
d_src
,
d_templ
,
d_dst
,
CV_
TM_CCORR
);
gpu
::
matchTemplate
(
d_src
,
d_templ
,
d_dst
,
TM_CCORR
);
}
...
...
@@ -39,17 +40,17 @@ TEST(matchTemplate)
SUBTEST
<<
src
.
cols
<<
'x'
<<
src
.
rows
<<
", 32FC1"
<<
", templ "
<<
templ_size
<<
'x'
<<
templ_size
<<
", CCORR"
;
gen
(
templ
,
templ_size
,
templ_size
,
CV_32F
,
0
,
1
);
matchTemplate
(
src
,
templ
,
dst
,
CV_
TM_CCORR
);
matchTemplate
(
src
,
templ
,
dst
,
TM_CCORR
);
CPU_ON
;
matchTemplate
(
src
,
templ
,
dst
,
CV_
TM_CCORR
);
matchTemplate
(
src
,
templ
,
dst
,
TM_CCORR
);
CPU_OFF
;
d_templ
.
upload
(
templ
);
gpu
::
matchTemplate
(
d_src
,
d_templ
,
d_dst
,
CV_
TM_CCORR
);
gpu
::
matchTemplate
(
d_src
,
d_templ
,
d_dst
,
TM_CCORR
);
GPU_ON
;
gpu
::
matchTemplate
(
d_src
,
d_templ
,
d_dst
,
CV_
TM_CCORR
);
gpu
::
matchTemplate
(
d_src
,
d_templ
,
d_dst
,
TM_CCORR
);
GPU_OFF
;
}
}
...
...
@@ -604,120 +605,120 @@ TEST(cvtColor)
gen
(
src
,
4000
,
4000
,
CV_8UC1
,
0
,
255
);
d_src
.
upload
(
src
);
SUBTEST
<<
"4000x4000, 8UC1, C
V
_GRAY2BGRA"
;
SUBTEST
<<
"4000x4000, 8UC1, C
OLOR
_GRAY2BGRA"
;
cvtColor
(
src
,
dst
,
C
V
_GRAY2BGRA
,
4
);
cvtColor
(
src
,
dst
,
C
OLOR
_GRAY2BGRA
,
4
);
CPU_ON
;
cvtColor
(
src
,
dst
,
C
V
_GRAY2BGRA
,
4
);
cvtColor
(
src
,
dst
,
C
OLOR
_GRAY2BGRA
,
4
);
CPU_OFF
;
gpu
::
cvtColor
(
d_src
,
d_dst
,
C
V
_GRAY2BGRA
,
4
);
gpu
::
cvtColor
(
d_src
,
d_dst
,
C
OLOR
_GRAY2BGRA
,
4
);
GPU_ON
;
gpu
::
cvtColor
(
d_src
,
d_dst
,
C
V
_GRAY2BGRA
,
4
);
gpu
::
cvtColor
(
d_src
,
d_dst
,
C
OLOR
_GRAY2BGRA
,
4
);
GPU_OFF
;
cv
::
swap
(
src
,
dst
);
d_src
.
swap
(
d_dst
);
SUBTEST
<<
"4000x4000, 8UC3 vs 8UC4, C
V
_BGR2YCrCb"
;
SUBTEST
<<
"4000x4000, 8UC3 vs 8UC4, C
OLOR
_BGR2YCrCb"
;
cvtColor
(
src
,
dst
,
C
V
_BGR2YCrCb
);
cvtColor
(
src
,
dst
,
C
OLOR
_BGR2YCrCb
);
CPU_ON
;
cvtColor
(
src
,
dst
,
C
V
_BGR2YCrCb
);
cvtColor
(
src
,
dst
,
C
OLOR
_BGR2YCrCb
);
CPU_OFF
;
gpu
::
cvtColor
(
d_src
,
d_dst
,
C
V
_BGR2YCrCb
,
4
);
gpu
::
cvtColor
(
d_src
,
d_dst
,
C
OLOR
_BGR2YCrCb
,
4
);
GPU_ON
;
gpu
::
cvtColor
(
d_src
,
d_dst
,
C
V
_BGR2YCrCb
,
4
);
gpu
::
cvtColor
(
d_src
,
d_dst
,
C
OLOR
_BGR2YCrCb
,
4
);
GPU_OFF
;
cv
::
swap
(
src
,
dst
);
d_src
.
swap
(
d_dst
);
SUBTEST
<<
"4000x4000, 8UC4, C
V
_YCrCb2BGR"
;
SUBTEST
<<
"4000x4000, 8UC4, C
OLOR
_YCrCb2BGR"
;
cvtColor
(
src
,
dst
,
C
V
_YCrCb2BGR
,
4
);
cvtColor
(
src
,
dst
,
C
OLOR
_YCrCb2BGR
,
4
);
CPU_ON
;
cvtColor
(
src
,
dst
,
C
V
_YCrCb2BGR
,
4
);
cvtColor
(
src
,
dst
,
C
OLOR
_YCrCb2BGR
,
4
);
CPU_OFF
;
gpu
::
cvtColor
(
d_src
,
d_dst
,
C
V
_YCrCb2BGR
,
4
);
gpu
::
cvtColor
(
d_src
,
d_dst
,
C
OLOR
_YCrCb2BGR
,
4
);
GPU_ON
;
gpu
::
cvtColor
(
d_src
,
d_dst
,
C
V
_YCrCb2BGR
,
4
);
gpu
::
cvtColor
(
d_src
,
d_dst
,
C
OLOR
_YCrCb2BGR
,
4
);
GPU_OFF
;
cv
::
swap
(
src
,
dst
);
d_src
.
swap
(
d_dst
);
SUBTEST
<<
"4000x4000, 8UC3 vs 8UC4, C
V
_BGR2XYZ"
;
SUBTEST
<<
"4000x4000, 8UC3 vs 8UC4, C
OLOR
_BGR2XYZ"
;
cvtColor
(
src
,
dst
,
C
V
_BGR2XYZ
);
cvtColor
(
src
,
dst
,
C
OLOR
_BGR2XYZ
);
CPU_ON
;
cvtColor
(
src
,
dst
,
C
V
_BGR2XYZ
);
cvtColor
(
src
,
dst
,
C
OLOR
_BGR2XYZ
);
CPU_OFF
;
gpu
::
cvtColor
(
d_src
,
d_dst
,
C
V
_BGR2XYZ
,
4
);
gpu
::
cvtColor
(
d_src
,
d_dst
,
C
OLOR
_BGR2XYZ
,
4
);
GPU_ON
;
gpu
::
cvtColor
(
d_src
,
d_dst
,
C
V
_BGR2XYZ
,
4
);
gpu
::
cvtColor
(
d_src
,
d_dst
,
C
OLOR
_BGR2XYZ
,
4
);
GPU_OFF
;
cv
::
swap
(
src
,
dst
);
d_src
.
swap
(
d_dst
);
SUBTEST
<<
"4000x4000, 8UC4, C
V
_XYZ2BGR"
;
SUBTEST
<<
"4000x4000, 8UC4, C
OLOR
_XYZ2BGR"
;
cvtColor
(
src
,
dst
,
C
V
_XYZ2BGR
,
4
);
cvtColor
(
src
,
dst
,
C
OLOR
_XYZ2BGR
,
4
);
CPU_ON
;
cvtColor
(
src
,
dst
,
C
V
_XYZ2BGR
,
4
);
cvtColor
(
src
,
dst
,
C
OLOR
_XYZ2BGR
,
4
);
CPU_OFF
;
gpu
::
cvtColor
(
d_src
,
d_dst
,
C
V
_XYZ2BGR
,
4
);
gpu
::
cvtColor
(
d_src
,
d_dst
,
C
OLOR
_XYZ2BGR
,
4
);
GPU_ON
;
gpu
::
cvtColor
(
d_src
,
d_dst
,
C
V
_XYZ2BGR
,
4
);
gpu
::
cvtColor
(
d_src
,
d_dst
,
C
OLOR
_XYZ2BGR
,
4
);
GPU_OFF
;
cv
::
swap
(
src
,
dst
);
d_src
.
swap
(
d_dst
);
SUBTEST
<<
"4000x4000, 8UC3 vs 8UC4, C
V
_BGR2HSV"
;
SUBTEST
<<
"4000x4000, 8UC3 vs 8UC4, C
OLOR
_BGR2HSV"
;
cvtColor
(
src
,
dst
,
C
V
_BGR2HSV
);
cvtColor
(
src
,
dst
,
C
OLOR
_BGR2HSV
);
CPU_ON
;
cvtColor
(
src
,
dst
,
C
V
_BGR2HSV
);
cvtColor
(
src
,
dst
,
C
OLOR
_BGR2HSV
);
CPU_OFF
;
gpu
::
cvtColor
(
d_src
,
d_dst
,
C
V
_BGR2HSV
,
4
);
gpu
::
cvtColor
(
d_src
,
d_dst
,
C
OLOR
_BGR2HSV
,
4
);
GPU_ON
;
gpu
::
cvtColor
(
d_src
,
d_dst
,
C
V
_BGR2HSV
,
4
);
gpu
::
cvtColor
(
d_src
,
d_dst
,
C
OLOR
_BGR2HSV
,
4
);
GPU_OFF
;
cv
::
swap
(
src
,
dst
);
d_src
.
swap
(
d_dst
);
SUBTEST
<<
"4000x4000, 8UC4, C
V
_HSV2BGR"
;
SUBTEST
<<
"4000x4000, 8UC4, C
OLOR
_HSV2BGR"
;
cvtColor
(
src
,
dst
,
C
V
_HSV2BGR
,
4
);
cvtColor
(
src
,
dst
,
C
OLOR
_HSV2BGR
,
4
);
CPU_ON
;
cvtColor
(
src
,
dst
,
C
V
_HSV2BGR
,
4
);
cvtColor
(
src
,
dst
,
C
OLOR
_HSV2BGR
,
4
);
CPU_OFF
;
gpu
::
cvtColor
(
d_src
,
d_dst
,
C
V
_HSV2BGR
,
4
);
gpu
::
cvtColor
(
d_src
,
d_dst
,
C
OLOR
_HSV2BGR
,
4
);
GPU_ON
;
gpu
::
cvtColor
(
d_src
,
d_dst
,
C
V
_HSV2BGR
,
4
);
gpu
::
cvtColor
(
d_src
,
d_dst
,
C
OLOR
_HSV2BGR
,
4
);
GPU_OFF
;
cv
::
swap
(
src
,
dst
);
...
...
@@ -1093,30 +1094,30 @@ TEST(reduce)
SUBTEST
<<
size
<<
'x'
<<
size
<<
", dim = 0"
;
reduce
(
src
,
dst0
,
0
,
CV_
REDUCE_MIN
);
reduce
(
src
,
dst0
,
0
,
REDUCE_MIN
);
CPU_ON
;
reduce
(
src
,
dst0
,
0
,
CV_
REDUCE_MIN
);
reduce
(
src
,
dst0
,
0
,
REDUCE_MIN
);
CPU_OFF
;
gpu
::
reduce
(
d_src
,
d_dst0
,
0
,
CV_
REDUCE_MIN
);
gpu
::
reduce
(
d_src
,
d_dst0
,
0
,
REDUCE_MIN
);
GPU_ON
;
gpu
::
reduce
(
d_src
,
d_dst0
,
0
,
CV_
REDUCE_MIN
);
gpu
::
reduce
(
d_src
,
d_dst0
,
0
,
REDUCE_MIN
);
GPU_OFF
;
SUBTEST
<<
size
<<
'x'
<<
size
<<
", dim = 1"
;
reduce
(
src
,
dst1
,
1
,
CV_
REDUCE_MIN
);
reduce
(
src
,
dst1
,
1
,
REDUCE_MIN
);
CPU_ON
;
reduce
(
src
,
dst1
,
1
,
CV_
REDUCE_MIN
);
reduce
(
src
,
dst1
,
1
,
REDUCE_MIN
);
CPU_OFF
;
gpu
::
reduce
(
d_src
,
d_dst1
,
1
,
CV_
REDUCE_MIN
);
gpu
::
reduce
(
d_src
,
d_dst1
,
1
,
REDUCE_MIN
);
GPU_ON
;
gpu
::
reduce
(
d_src
,
d_dst1
,
1
,
CV_
REDUCE_MIN
);
gpu
::
reduce
(
d_src
,
d_dst1
,
1
,
REDUCE_MIN
);
GPU_OFF
;
}
}
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment