Commit f86e3156 authored by Bellaktris's avatar Bellaktris

another try

parent 97d602ff
...@@ -5,7 +5,7 @@ Automatic white balance correction ...@@ -5,7 +5,7 @@ Automatic white balance correction
balanceWhite balanceWhite
------------ ------------
.. ocv:function:: (const Mat &src, Mat &dst, const int algorithmType, .. ocv:function:: void balanceWhite(const Mat &src, Mat &dst, const int algorithmType,
const float inputMin = 0.0f, const float inputMax = 255.0f, const float inputMin = 0.0f, const float inputMax = 255.0f,
const float outputMin = 0.0f, const float outputMax = 255.0f) const float outputMin = 0.0f, const float outputMax = 255.0f)
......
...@@ -5,7 +5,7 @@ Image denoising techniques ...@@ -5,7 +5,7 @@ Image denoising techniques
dctDenoising dctDenoising
------------ ------------
.. ocv:function:: (const Mat &src, Mat &dst, const float sigma) .. ocv:function:: void dctDenoising(const Mat &src, Mat &dst, const float sigma)
The function implements simple dct-based denoising, The function implements simple dct-based denoising,
link: http://www.ipol.im/pub/art/2011/ys-dct/. link: http://www.ipol.im/pub/art/2011/ys-dct/.
......
...@@ -40,6 +40,7 @@ ...@@ -40,6 +40,7 @@
#ifndef __ANNF_HPP__ #ifndef __ANNF_HPP__
#define __ANNF_HPP__ #define __ANNF_HPP__
#include <vector>
#include "algo.hpp" #include "algo.hpp"
static void plusToMinusUpdate(const cv::Mat &current, cv::Mat &next, const int dx, const int dy) static void plusToMinusUpdate(const cv::Mat &current, cv::Mat &next, const int dx, const int dy)
......
...@@ -54,6 +54,11 @@ ...@@ -54,6 +54,11 @@
namespace cv namespace cv
{ {
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);
struct grayDctDenoisingInvoker : public ParallelLoopBody struct grayDctDenoisingInvoker : public ParallelLoopBody
{ {
public: public:
...@@ -71,9 +76,9 @@ namespace cv ...@@ -71,9 +76,9 @@ namespace cv
const double thresh; // thresholding estimate const double thresh; // thresholding estimate
}; };
grayDctDenoisingInvoker::grayDctDenoisingInvoker(const Mat &src, std::vector <Mat> &patches, grayDctDenoisingInvoker::grayDctDenoisingInvoker(const Mat &_src, std::vector <Mat> &_patches,
const double sigma, const int psize) const double _sigma, const int _psize)
: src(src), patches(patches), sigma(sigma), thresh(3*sigma), psize(psize) {} : src(_src), patches(_patches), sigma(_sigma), thresh(3*_sigma), psize(_psize) {}
grayDctDenoisingInvoker::~grayDctDenoisingInvoker(){} grayDctDenoisingInvoker::~grayDctDenoisingInvoker(){}
void grayDctDenoisingInvoker::operator() (const Range &range) const void grayDctDenoisingInvoker::operator() (const Range &range) const
......
...@@ -42,6 +42,10 @@ ...@@ -42,6 +42,10 @@
#ifndef _CV_GCGRAPH_H_ #ifndef _CV_GCGRAPH_H_
#define _CV_GCGRAPH_H_ #define _CV_GCGRAPH_H_
#include <vector>
#include <opencv2/core.hpp>
template <class TWeight> class GCGraph template <class TWeight> class GCGraph
{ {
public: public:
......
...@@ -75,7 +75,7 @@ private: ...@@ -75,7 +75,7 @@ private:
public: public:
Photomontage <Tp> *main; Photomontage <Tp> *main;
ParallelExpansion(Photomontage <Tp> *main) : main(main){} ParallelExpansion(Photomontage <Tp> *_main) : main(_main){}
~ParallelExpansion(){}; ~ParallelExpansion(){};
void operator () (const cv::Range &range) const void operator () (const cv::Range &range) const
...@@ -109,10 +109,10 @@ setWeights(GCGraph <double> &graph, const cv::Point &pA, const cv::Point &pB, co ...@@ -109,10 +109,10 @@ setWeights(GCGraph <double> &graph, const cv::Point &pA, const cv::Point &pB, co
if (lA == lB) if (lA == lB)
{ {
/** Link from A to B **/ /** Link from A to B **/
double weightAB = dist( typename images[lA].at<Tp>(pA), double weightAB = dist( images[lA].at<typename Tp>(pA),
typename images[lA].at<Tp>(pB), images[lA].at<typename Tp>(pB),
typename images[lX].at<Tp>(pA), images[lX].at<typename Tp>(pA),
typename images[lX].at<Tp>(pB) ); images[lX].at<typename Tp>(pB) );
graph.addEdges( int(pA.y*width + pA.x), int(pB.y*width + pB.x), weightAB, weightAB); graph.addEdges( int(pA.y*width + pA.x), int(pB.y*width + pB.x), weightAB, weightAB);
} }
else else
...@@ -120,24 +120,24 @@ setWeights(GCGraph <double> &graph, const cv::Point &pA, const cv::Point &pB, co ...@@ -120,24 +120,24 @@ setWeights(GCGraph <double> &graph, const cv::Point &pA, const cv::Point &pB, co
int X = graph.addVtx(); int X = graph.addVtx();
/** Link from X to sink **/ /** Link from X to sink **/
double weightXS = dist( typename images[lA].at<Tp>(pA), double weightXS = dist( images[lA].at<typename Tp>(pA),
typename images[lA].at<Tp>(pB), images[lA].at<typename Tp>(pB),
typename images[lB].at<Tp>(pA), images[lB].at<typename Tp>(pA),
typename images[lB].at<Tp>(pB) ); images[lB].at<typename Tp>(pB) );
graph.addTermWeights(X, 0, weightXS); graph.addTermWeights(X, 0, weightXS);
/** Link from A to X **/ /** Link from A to X **/
double weightAX = dist( typename images[lA].at<Tp>(pA), double weightAX = dist( images[lA].at<typename Tp>(pA),
typename images[lA].at<Tp>(pB), images[lA].at<typename Tp>(pB),
typename images[lX].at<Tp>(pA), images[lX].at<typename Tp>(pA),
typename images[lX].at<Tp>(pB) ); images[lX].at<typename Tp>(pB) );
graph.addEdges( int(pA.y*width + pA.x), X, weightAX, weightAX); graph.addEdges( int(pA.y*width + pA.x), X, weightAX, weightAX);
/** Link from X to B **/ /** Link from X to B **/
double weightXB = dist( typename images[lX].at<Tp>(pA), double weightXB = dist( images[lX].at<typename Tp>(pA),
typename images[lX].at<Tp>(pB), images[lX].at<typename Tp>(pB),
typename images[lB].at<Tp>(pA), images[lB].at<typename Tp>(pA),
typename images[lB].at<Tp>(pB) ); images[lB].at<typename Tp>(pB) );
graph.addEdges(X, int(pB.y*width + pB.x), weightXB, weightXB); graph.addEdges(X, int(pB.y*width + pB.x), weightXB, weightXB);
} }
} }
...@@ -242,9 +242,9 @@ assignResImage(cv::Mat &img) ...@@ -242,9 +242,9 @@ assignResImage(cv::Mat &img)
} }
template <typename Tp> Photomontage <Tp>:: template <typename Tp> Photomontage <Tp>::
Photomontage(const std::vector <cv::Mat> &images, const std::vector <cv::Mat> &masks) Photomontage(const std::vector <cv::Mat> &_images, const std::vector <cv::Mat> &_masks)
: :
images(images), masks(masks), height(int(images[0].rows)), width(int(images[0].cols)), images(_images), masks(_masks), height(int(images[0].rows)), width(int(images[0].cols)),
type(images[0].type()), x_i(height, width, CV_32SC1), channels(images[0].channels()), type(images[0].type()), x_i(height, width, CV_32SC1), channels(images[0].channels()),
lsize(int(images.size())), labelings(images.size()), distances(images.size()) lsize(int(images.size())), labelings(images.size()), distances(images.size())
{ {
......
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