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
69648f0a
Commit
69648f0a
authored
Apr 07, 2013
by
Andrey Kamaev
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Make photo.hpp independent from C API
parent
0738ea7d
Hide whitespace changes
Inline
Side-by-side
Showing
11 changed files
with
26 additions
and
25 deletions
+26
-25
CMakeLists.txt
apps/haartraining/CMakeLists.txt
+1
-1
CMakeLists.txt
apps/traincascade/CMakeLists.txt
+1
-1
cv.h
include/opencv/cv.h
+2
-0
cv.hpp
include/opencv/cv.hpp
+1
-0
cvaux.h
include/opencv/cvaux.h
+2
-0
photo.hpp
modules/photo/include/opencv2/photo.hpp
+3
-9
denoising.cpp
modules/photo/src/denoising.cpp
+8
-8
inpaint.cpp
modules/photo/src/inpaint.cpp
+4
-3
test_inpaint.cpp
modules/photo/test/test_inpaint.cpp
+2
-2
cv2.cpp
modules/python/src2/cv2.cpp
+1
-0
inpaint.cpp
samples/cpp/inpaint.cpp
+1
-1
No files found.
apps/haartraining/CMakeLists.txt
View file @
69648f0a
SET
(
OPENCV_HAARTRAINING_DEPS opencv_core opencv_imgproc opencv_highgui opencv_objdetect opencv_calib3d opencv_video opencv_features2d opencv_flann opencv_legacy
)
SET
(
OPENCV_HAARTRAINING_DEPS opencv_core opencv_imgproc opencv_
photo opencv_
highgui opencv_objdetect opencv_calib3d opencv_video opencv_features2d opencv_flann opencv_legacy
)
ocv_check_dependencies
(
${
OPENCV_HAARTRAINING_DEPS
}
)
if
(
NOT OCV_DEPENDENCIES_FOUND
)
...
...
apps/traincascade/CMakeLists.txt
View file @
69648f0a
set
(
OPENCV_TRAINCASCADE_DEPS opencv_core opencv_ml opencv_imgproc opencv_objdetect opencv_highgui opencv_calib3d opencv_video opencv_features2d opencv_flann opencv_legacy
)
set
(
OPENCV_TRAINCASCADE_DEPS opencv_core opencv_ml opencv_imgproc opencv_
photo opencv_
objdetect opencv_highgui opencv_calib3d opencv_video opencv_features2d opencv_flann opencv_legacy
)
ocv_check_dependencies
(
${
OPENCV_TRAINCASCADE_DEPS
}
)
if
(
NOT OCV_DEPENDENCIES_FOUND
)
...
...
include/opencv/cv.h
View file @
69648f0a
...
...
@@ -62,6 +62,8 @@
#include "opencv2/core/core_c.h"
#include "opencv2/imgproc/imgproc_c.h"
#include "opencv2/photo/photo_c.h"
#include "opencv2/video.hpp"
#include "opencv2/features2d.hpp"
#include "opencv2/flann.hpp"
...
...
include/opencv/cv.hpp
View file @
69648f0a
...
...
@@ -50,6 +50,7 @@
#include "cv.h"
#include "opencv2/core.hpp"
#include "opencv2/imgproc.hpp"
#include "opencv2/photo.hpp"
#include "opencv2/highgui.hpp"
#endif
include/opencv/cvaux.h
View file @
69648f0a
...
...
@@ -48,6 +48,8 @@
#include "opencv2/core/core_c.h"
#include "opencv2/imgproc/imgproc_c.h"
#include "opencv2/photo/photo_c.h"
#include "opencv2/video.hpp"
#include "opencv2/features2d.hpp"
#include "opencv2/calib3d.hpp"
...
...
modules/photo/include/opencv2/photo.hpp
View file @
69648f0a
...
...
@@ -46,10 +46,6 @@
#include "opencv2/core.hpp"
#include "opencv2/imgproc.hpp"
#include "opencv2/photo/photo_c.h"
#ifdef __cplusplus
/*! \namespace cv
Namespace where all the C++ OpenCV functionality resides
*/
...
...
@@ -59,8 +55,8 @@ namespace cv
//! the inpainting algorithm
enum
{
INPAINT_NS
=
CV_INPAINT_NS
,
// Navier-Stokes algorithm
INPAINT_TELEA
=
CV_INPAINT_TELEA
// A. Telea algorithm
INPAINT_NS
=
0
,
// Navier-Stokes algorithm
INPAINT_TELEA
=
1
// A. Telea algorithm
};
//! restores the damaged image areas using one of the available intpainting algorithms
...
...
@@ -84,8 +80,6 @@ CV_EXPORTS_W void fastNlMeansDenoisingColoredMulti( InputArrayOfArrays srcImgs,
float
h
=
3
,
float
hColor
=
3
,
int
templateWindowSize
=
7
,
int
searchWindowSize
=
21
);
}
#endif //__cplusplus
}
// cv
#endif
modules/photo/src/denoising.cpp
View file @
69648f0a
...
...
@@ -74,7 +74,7 @@ void cv::fastNlMeansDenoising( InputArray _src, OutputArray _dst, float h,
src
,
dst
,
templateWindowSize
,
searchWindowSize
,
h
));
break
;
default
:
CV_Error
(
CV_
StsBadArg
,
CV_Error
(
Error
::
StsBadArg
,
"Unsupported image format! Only CV_8UC1, CV_8UC2 and CV_8UC3 are supported"
);
}
}
...
...
@@ -88,7 +88,7 @@ void cv::fastNlMeansDenoisingColored( InputArray _src, OutputArray _dst,
Mat
dst
=
_dst
.
getMat
();
if
(
src
.
type
()
!=
CV_8UC3
)
{
CV_Error
(
CV_
StsBadArg
,
"Type of input image should be CV_8UC3!"
);
CV_Error
(
Error
::
StsBadArg
,
"Type of input image should be CV_8UC3!"
);
return
;
}
...
...
@@ -118,27 +118,27 @@ static void fastNlMeansDenoisingMultiCheckPreconditions(
{
int
src_imgs_size
=
(
int
)
srcImgs
.
size
();
if
(
src_imgs_size
==
0
)
{
CV_Error
(
CV_
StsBadArg
,
"Input images vector should not be empty!"
);
CV_Error
(
Error
::
StsBadArg
,
"Input images vector should not be empty!"
);
}
if
(
temporalWindowSize
%
2
==
0
||
searchWindowSize
%
2
==
0
||
templateWindowSize
%
2
==
0
)
{
CV_Error
(
CV_
StsBadArg
,
"All windows sizes should be odd!"
);
CV_Error
(
Error
::
StsBadArg
,
"All windows sizes should be odd!"
);
}
int
temporalWindowHalfSize
=
temporalWindowSize
/
2
;
if
(
imgToDenoiseIndex
-
temporalWindowHalfSize
<
0
||
imgToDenoiseIndex
+
temporalWindowHalfSize
>=
src_imgs_size
)
{
CV_Error
(
CV_
StsBadArg
,
CV_Error
(
Error
::
StsBadArg
,
"imgToDenoiseIndex and temporalWindowSize "
"should be choosen corresponding srcImgs size!"
);
}
for
(
int
i
=
1
;
i
<
src_imgs_size
;
i
++
)
{
if
(
srcImgs
[
0
].
size
()
!=
srcImgs
[
i
].
size
()
||
srcImgs
[
0
].
type
()
!=
srcImgs
[
i
].
type
())
{
CV_Error
(
CV_
StsBadArg
,
"Input images should have the same size and type!"
);
CV_Error
(
Error
::
StsBadArg
,
"Input images should have the same size and type!"
);
}
}
}
...
...
@@ -177,7 +177,7 @@ void cv::fastNlMeansDenoisingMulti( InputArrayOfArrays _srcImgs, OutputArray _ds
dst
,
templateWindowSize
,
searchWindowSize
,
h
));
break
;
default
:
CV_Error
(
CV_
StsBadArg
,
CV_Error
(
Error
::
StsBadArg
,
"Unsupported matrix format! Only uchar, Vec2b, Vec3b are supported"
);
}
}
...
...
@@ -201,7 +201,7 @@ void cv::fastNlMeansDenoisingColoredMulti( InputArrayOfArrays _srcImgs, OutputAr
int
src_imgs_size
=
(
int
)
srcImgs
.
size
();
if
(
srcImgs
[
0
].
type
()
!=
CV_8UC3
)
{
CV_Error
(
CV_
StsBadArg
,
"Type of input images should be CV_8UC3!"
);
CV_Error
(
Error
::
StsBadArg
,
"Type of input images should be CV_8UC3!"
);
return
;
}
...
...
modules/photo/src/inpaint.cpp
View file @
69648f0a
...
...
@@ -47,6 +47,7 @@
#include "precomp.hpp"
#include "opencv2/imgproc/imgproc_c.h"
#include "opencv2/photo/photo_c.h"
#undef CV_MAT_ELEM_PTR_FAST
#define CV_MAT_ELEM_PTR_FAST( mat, row, col, pix_size ) \
...
...
@@ -782,7 +783,7 @@ cvInpaint( const CvArr* _input_img, const CvArr* _inpaint_mask, CvArr* _output_i
cvSet
(
f
,
cvScalar
(
INSIDE
,
0
,
0
,
0
),
mask
);
cvSet
(
t
,
cvScalar
(
0
,
0
,
0
,
0
),
band
);
if
(
flags
==
CV_
INPAINT_TELEA
)
if
(
flags
==
cv
::
INPAINT_TELEA
)
{
out
=
cvCreateMat
(
erows
,
ecols
,
CV_8UC1
);
el_range
=
cvCreateStructuringElementEx
(
2
*
range
+
1
,
2
*
range
+
1
,
...
...
@@ -799,10 +800,10 @@ cvInpaint( const CvArr* _input_img, const CvArr* _inpaint_mask, CvArr* _output_i
icvCalcFMM
(
out
,
t
,
Out
,
true
);
icvTeleaInpaintFMM
(
mask
,
t
,
output_img
,
range
,
Heap
);
}
else
if
(
flags
==
CV_
INPAINT_NS
)
{
else
if
(
flags
==
cv
::
INPAINT_NS
)
{
icvNSInpaintFMM
(
mask
,
t
,
output_img
,
range
,
Heap
);
}
else
{
CV_Error
(
CV_
StsBadArg
,
"The flags argument must be one of CV_INPAINT_TELEA or CV_INPAINT_NS"
);
CV_Error
(
cv
::
Error
::
StsBadArg
,
"The flags argument must be one of CV_INPAINT_TELEA or CV_INPAINT_NS"
);
}
}
...
...
modules/photo/test/test_inpaint.cpp
View file @
69648f0a
...
...
@@ -84,8 +84,8 @@ void CV_InpaintTest::run( int )
test
.
setTo
(
Scalar
::
all
(
255
),
mask1ch
);
Mat
res1
,
res2
;
inpaint
(
test
,
mask1ch
,
res1
,
5
,
CV_
INPAINT_NS
);
inpaint
(
test
,
mask1ch
,
res2
,
5
,
CV_
INPAINT_TELEA
);
inpaint
(
test
,
mask1ch
,
res1
,
5
,
INPAINT_NS
);
inpaint
(
test
,
mask1ch
,
res2
,
5
,
INPAINT_TELEA
);
Mat
diff1
,
diff2
;
absdiff
(
orig
,
res1
,
diff1
);
...
...
modules/python/src2/cv2.cpp
View file @
69648f0a
...
...
@@ -24,6 +24,7 @@
#include "opencv2/highgui.hpp"
#include "opencv2/highgui/highgui_c.h"
#include "opencv2/photo/photo_c.h"
#include "opencv2/opencv_modules.hpp"
...
...
samples/cpp/inpaint.cpp
View file @
69648f0a
...
...
@@ -81,7 +81,7 @@ int main( int argc, char** argv )
if
(
c
==
'i'
||
c
==
' '
)
{
Mat
inpainted
;
inpaint
(
img
,
inpaintMask
,
inpainted
,
3
,
CV_
INPAINT_TELEA
);
inpaint
(
img
,
inpaintMask
,
inpainted
,
3
,
INPAINT_TELEA
);
imshow
(
"inpainted image"
,
inpainted
);
}
}
...
...
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