Commit bbda6c63 authored by Alexander Shishkov's avatar Alexander Shishkov

added internal namespace for photo module

parent 8923915a
......@@ -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
......@@ -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/
......@@ -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__
\ No newline at end of file
......@@ -56,6 +56,8 @@
Namespace where all the C++ OpenCV functionality resides
*/
namespace cv
{
namespace xphoto
{
//! various inpainting algorithms
enum
......@@ -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__
\ No newline at end of file
......@@ -56,6 +56,8 @@
Namespace where all the C++ OpenCV functionality resides
*/
namespace cv
{
namespace xphoto
{
//! various white balance algorithms
enum
......@@ -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__
\ No newline at end of file
......@@ -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 == "" )
{
......
......@@ -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 == "" )
......
......@@ -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 == "" )
{
......
......@@ -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);
......@@ -179,3 +182,4 @@ namespace cv
}
}
}
\ No newline at end of file
......@@ -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)
......@@ -117,7 +120,7 @@ namespace cv
switch ( algorithmType )
{
case INPAINT_SHIFTMAP:
case xphoto::INPAINT_SHIFTMAP:
shiftMapInpaint <Tp, cn>(src, mask, dst);
break;
default:
......@@ -232,3 +235,4 @@ namespace cv
}
}
}
}
......@@ -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,
......@@ -205,3 +208,4 @@ namespace cv
}
}
}
}
......@@ -25,7 +25,7 @@ namespace cvtest
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 );
......
......@@ -19,7 +19,7 @@ namespace cvtest
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 );
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment