Commit f86e3156 authored by Bellaktris's avatar Bellaktris

another try

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