Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 3 additions & 2 deletions modules/tracking/doc/tracking.rst
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
Tracking API
============
******************************************
tracking. Tracking API
******************************************

.. highlight:: cpp

Expand Down
4 changes: 2 additions & 2 deletions modules/ximgproc/doc/structured_edge_detection.rst
Original file line number Diff line number Diff line change
Expand Up @@ -50,8 +50,8 @@ StructuredEdgeDetection::detectEdges

.. seealso::

:ocv:class:`Sobel`,
:ocv:class:`Canny`
:ocv:func:`Sobel`,
:ocv:func:`Canny`

createStructuredEdgeDetection
+++++++++++++++++++++++++++++
Expand Down
2 changes: 1 addition & 1 deletion modules/ximgproc/doc/ximgproc.rst
Original file line number Diff line number Diff line change
Expand Up @@ -7,5 +7,5 @@ ximgproc. Extended image processing module.
.. toctree::
:maxdepth: 2

edge_aware_filters
structured_edge_detection
edge_aware_filters
2 changes: 1 addition & 1 deletion modules/ximgproc/test/test_main.cpp
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
#include "test_precomp.hpp"

CV_TEST_MAIN("ximpgroc")
CV_TEST_MAIN("")
6 changes: 4 additions & 2 deletions modules/ximgproc/test/test_structured_edge_detection.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -5,10 +5,11 @@ namespace cvtest

TEST(ximpgroc_StructuredEdgeDetection, regression)
{
cv::String dir = cvtest::TS::ptr()->get_data_path();
cv::String subfolder = "cv/ximgproc/";
cv::String dir = cvtest::TS::ptr()->get_data_path() + subfolder;
int nTests = 12;
float threshold = 0.01f;

cv::String modelName = dir + "model.yml.gz";
cv::Ptr<cv::ximgproc::StructuredEdgeDetection> pDollar =
cv::ximgproc::createStructuredEdgeDetection(modelName);
Expand All @@ -17,6 +18,7 @@ TEST(ximpgroc_StructuredEdgeDetection, regression)
{
cv::String srcName = dir + cv::format( "sources/%02d.png", i + 1);
cv::Mat src = cv::imread( srcName, 1 );
ASSERT_TRUE(!src.empty());

cv::String previousResultName = dir + cv::format( "results/%02d.png", i + 1 );
cv::Mat previousResult = cv::imread( previousResultName, 0 );
Expand Down
19 changes: 8 additions & 11 deletions modules/xphoto/doc/colorbalance/whitebalance.rst
Original file line number Diff line number Diff line change
Expand Up @@ -5,21 +5,18 @@ Automatic white balance correction

balanceWhite
------------

.. ocv:function:: void balanceWhite(const Mat &src, Mat &dst, const int algorithmType, const float inputMin = 0.0f, const float inputMax = 255.0f, const float outputMin = 0.0f, const float outputMax = 255.0f)

The function implements different algorithm of automatic white balance, i.e.
it tries to map image's white color to perceptual white (this can be violated
due to specific illumination or camera settings).
The function implements different algorithm of automatic white balance, i.e. it tries to map image's white color to perceptual white (this can be violated due to specific illumination or camera settings).

:param src : source image
:param dst : destination image
:param algorithmType : type of the algorithm to use. Use WHITE_BALANCE_SIMPLE to perform smart histogram adjustments (ignoring 4% pixels with minimal and maximal values) for each channel.
:param inputMin : minimum value in the input image
:param inputMax : maximum value in the input image
:param outputMin : minimum value in the output image
:param outputMax : maximum value in the output image
:param algorithmType: type of the algorithm to use. Use WHITE_BALANCE_SIMPLE to perform smart histogram adjustments (ignoring 4% pixels with minimal and maximal values) for each channel.
:param inputMin: minimum value in the input image
:param inputMax: maximum value in the input image
:param outputMin: minimum value in the output image
:param outputMax: maximum value in the output image

.. seealso::

:ocv:func:`cvtColor`,
:ocv:func:`equalizeHist`
:ocv:func:`equalizeHist`
12 changes: 6 additions & 6 deletions modules/xphoto/doc/denoising/denoising.rst
Original file line number Diff line number Diff line change
Expand Up @@ -7,13 +7,13 @@ dctDenoising
------------
.. ocv:function:: void dctDenoising(const Mat &src, Mat &dst, const float sigma)

The function implements simple dct-based denoising,
link: http://www.ipol.im/pub/art/2011/ys-dct/.
The function implements simple dct-based denoising,
link: http://www.ipol.im/pub/art/2011/ys-dct/.

:param src : source image
:param dst : destination image
:param sigma : expected noise standard deviation
:param psize : size of block side where dct is computed
:param src: source image
:param dst: destination image
:param sigma: expected noise standard deviation
:param psize: size of block side where dct is computed

.. seealso::

Expand Down
10 changes: 5 additions & 5 deletions modules/xphoto/doc/inpainting/inpainting.rst
Original file line number Diff line number Diff line change
Expand Up @@ -7,12 +7,12 @@ Inpainting
----------
.. ocv:function:: void inpaint(const Mat &src, const Mat &mask, Mat &dst, const int algorithmType)

The function implements different single-image inpainting algorithms.
The function implements different single-image inpainting algorithms.

:param src : source image, it could be of any type and any number of channels from 1 to 4. In case of 3- and 4-channels images the function expect them in CIELab colorspace or similar one, where first color component shows intensity, while second and third shows colors. Nonetheless you can try any colorspaces.
:param mask : mask (CV_8UC1), where non-zero pixels indicate valid image area, while zero pixels indicate area to be inpainted
:param dst : destination image
:param algorithmType : expected noise standard deviation
:param src: source image, it could be of any type and any number of channels from 1 to 4. In case of 3- and 4-channels images the function expect them in CIELab colorspace or similar one, where first color component shows intensity, while second and third shows colors. Nonetheless you can try any colorspaces.
:param mask: mask (CV_8UC1), where non-zero pixels indicate valid image area, while zero pixels indicate area to be inpainted
:param dst: destination image
:param algorithmType: expected noise standard deviation
* INPAINT_SHIFTMAP: This algorithm searches for dominant correspondences (transformations) of image patches and tries to seamlessly fill-in the area to be inpainted using this transformations. Look in the original paper [He2012]_ for details.

.. [He2012] K. He, J. Sun., "Statistics of Patch Offsets for Image Completion",
Expand Down
11 changes: 5 additions & 6 deletions modules/xphoto/include/opencv2/xphoto.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -40,11 +40,10 @@
//
//M*/

#ifndef __OPENCV_EDGEDETECTION_HPP__
#define __OPENCV_EDGEDETECTION_HPP__
#ifndef __OPENCV_XPHOTO_HPP__
#define __OPENCV_XPHOTO_HPP__

#include "opencv2/xphoto.hpp"
#include "opencv2/xphoto/inpainting.hpp"
#include "opencv2/xphoto/simple_color_balance.hpp"
#include "opencv2/xphoto/dct_image_denoising.hpp"
#include "xphoto/inpainting.hpp"
#include "xphoto/simple_color_balance.hpp"
#include "xphoto/dct_image_denoising.hpp"
#endif
3 changes: 3 additions & 0 deletions modules/xphoto/include/opencv2/xphoto/dct_image_denoising.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,8 @@
Namespace where all the C++ OpenCV functionality resides
*/
namespace cv
{
namespace xphoto
{
/*! This function implements simple dct-based image denoising,
* link: http://www.ipol.im/pub/art/2011/ys-dct/
Expand All @@ -67,5 +69,6 @@ namespace cv
*/
CV_EXPORTS_W void dctDenoising(const Mat &src, Mat &dst, const double sigma, const int psize = 16);
}
}

#endif // __OPENCV_DCT_IMAGE_DENOISING_HPP__
3 changes: 3 additions & 0 deletions modules/xphoto/include/opencv2/xphoto/inpainting.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,8 @@
Namespace where all the C++ OpenCV functionality resides
*/
namespace cv
{
namespace xphoto
{
//! various inpainting algorithms
enum
Expand All @@ -71,5 +73,6 @@ namespace cv
*/
CV_EXPORTS_W void inpaint(const Mat &src, const Mat &mask, Mat &dst, const int algorithmType);
}
}

#endif // __OPENCV_INPAINTING_HPP__
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,8 @@
Namespace where all the C++ OpenCV functionality resides
*/
namespace cv
{
namespace xphoto
{
//! various white balance algorithms
enum
Expand All @@ -77,5 +79,6 @@ namespace cv
const float inputMin = 0.0f, const float inputMax = 255.0f,
const float outputMin = 0.0f, const float outputMax = 255.0f);
}
}

#endif // __OPENCV_SIMPLE_COLOR_BALANCE_HPP__
2 changes: 1 addition & 1 deletion modules/xphoto/samples/dct_image_denoising.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ int main( int argc, const char** argv )
psize = 16;

cv::Mat res(src.size(), src.type());
cv::dctDenoising(src, res, sigma, psize);
cv::xphoto::dctDenoising(src, res, sigma, psize);

if ( outFilename == "" )
{
Expand Down
2 changes: 1 addition & 1 deletion modules/xphoto/samples/inpainting.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ int main( int argc, const char** argv )
}

cv::Mat res(src.size(), src.type());
cv::inpaint( src, mask, res, cv::INPAINT_SHIFTMAP );
cv::xphoto::inpaint( src, mask, res, cv::xphoto::INPAINT_SHIFTMAP );
cv::cvtColor(res, res, CV_Lab2RGB);

if ( outFilename == "" )
Expand Down
2 changes: 1 addition & 1 deletion modules/xphoto/samples/simple_color_balance.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ int main( int argc, const char** argv )
}

cv::Mat res(src.size(), src.type());
cv::balanceWhite(src, res, cv::WHITE_BALANCE_SIMPLE);
cv::xphoto::balanceWhite(src, res, cv::xphoto::WHITE_BALANCE_SIMPLE);

if ( outFilename == "" )
{
Expand Down
4 changes: 4 additions & 0 deletions modules/xphoto/src/dct_image_denoising.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,9 @@

namespace cv
{
namespace xphoto
{

void grayDctDenoising(const Mat &, Mat &, const double, const int);
void rgbDctDenoising(const Mat &, Mat &, const double, const int);
void dctDenoising(const Mat &, Mat &, const double, const int);
Expand Down Expand Up @@ -179,3 +182,4 @@ namespace cv
}

}
}
6 changes: 5 additions & 1 deletion modules/xphoto/src/inpainting.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -67,6 +67,9 @@ namespace xphotoInternal

namespace cv
{
namespace xphoto
{

template <typename Tp, unsigned int cn>
static void shiftMapInpaint(const Mat &src, const Mat &mask, Mat &dst,
const int nTransform = 60, const int psize = 8)
Expand Down Expand Up @@ -117,7 +120,7 @@ namespace cv

switch ( algorithmType )
{
case INPAINT_SHIFTMAP:
case xphoto::INPAINT_SHIFTMAP:
shiftMapInpaint <Tp, cn>(src, mask, dst);
break;
default:
Expand Down Expand Up @@ -232,3 +235,4 @@ namespace cv
}
}
}
}
4 changes: 4 additions & 0 deletions modules/xphoto/src/simple_color_balance.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,9 @@

namespace cv
{
namespace xphoto
{

template <typename T>
void balanceWhite(std::vector < Mat_<T> > &src, Mat &dst,
const float inputMin, const float inputMax,
Expand Down Expand Up @@ -205,3 +208,4 @@ namespace cv
}
}
}
}
11 changes: 7 additions & 4 deletions modules/xphoto/test/dct_image_denoising.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,11 @@ namespace cvtest
{
TEST(xphoto_dctimagedenoising, regression)
{
cv::String dir = cvtest::TS::ptr()->get_data_path() + "dct_image_denoising/";
cv::String subfolder = "cv/xphoto/";
cv::String dir = cvtest::TS::ptr()->get_data_path() + subfolder + "dct_image_denoising/";
int nTests = 1;

double thresholds[] = {0.1};
double thresholds[] = {0.2};

int psize[] = {8};
double sigma[] = {9.0};
Expand All @@ -16,13 +17,15 @@ namespace cvtest
{
cv::String srcName = dir + cv::format( "sources/%02d.png", i + 1);
cv::Mat src = cv::imread( srcName, 1 );
ASSERT_TRUE(!src.empty());

cv::String previousResultName = dir + cv::format( "results/%02d.png", i + 1 );
cv::Mat previousResult = cv::imread( previousResultName, 1 );
ASSERT_TRUE(!src.empty());

cv::Mat currentResult, fastNlMeansResult;
cv::Mat currentResult;

cv::dctDenoising(src, currentResult, sigma[i], psize[i]);
cv::xphoto::dctDenoising(src, currentResult, sigma[i], psize[i]);

cv::Mat sqrError = ( currentResult - previousResult )
.mul( currentResult - previousResult );
Expand Down
6 changes: 4 additions & 2 deletions modules/xphoto/test/simple_color_balance.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -4,20 +4,22 @@ namespace cvtest
{
TEST(xphoto_simplecolorbalance, regression)
{
cv::String dir = cvtest::TS::ptr()->get_data_path() + "simple_white_balance/";
cv::String subfolder = "cv/xphoto/";
cv::String dir = cvtest::TS::ptr()->get_data_path() + subfolder + "simple_white_balance/";
int nTests = 12;
float threshold = 0.005f;

for (int i = 0; i < nTests; ++i)
{
cv::String srcName = dir + cv::format( "sources/%02d.png", i + 1);
cv::Mat src = cv::imread( srcName, 1 );
ASSERT_TRUE(!src.empty());

cv::String previousResultName = dir + cv::format( "results/%02d.png", i + 1 );
cv::Mat previousResult = cv::imread( previousResultName, 1 );

cv::Mat currentResult;
cv::balanceWhite(src, currentResult, cv::WHITE_BALANCE_SIMPLE);
cv::xphoto::balanceWhite(src, currentResult, cv::xphoto::WHITE_BALANCE_SIMPLE);

cv::Mat sqrError = ( currentResult - previousResult )
.mul( currentResult - previousResult );
Expand Down
2 changes: 1 addition & 1 deletion modules/xphoto/test/test_main.cpp
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
#include "test_precomp.hpp"

CV_TEST_MAIN("xphoto")
CV_TEST_MAIN("")
Binary file not shown.
Empty file removed modules/xphoto/testdata/x.png
Diff not rendered.
Binary file not shown.