OpenCV453
photo.hpp
1/*M///////////////////////////////////////////////////////////////////////////////////////
2//
3// IMPORTANT: READ BEFORE DOWNLOADING, COPYING, INSTALLING OR USING.
4//
5// By downloading, copying, installing or using the software you agree to this license.
6// If you do not agree to this license, do not download, install,
7// copy or use the software.
8//
9//
10// License Agreement
11// For Open Source Computer Vision Library
12//
13// Copyright (C) 2000-2008, Intel Corporation, all rights reserved.
14// Copyright (C) 2008-2012, Willow Garage Inc., all rights reserved.
15// Third party copyrights are property of their respective owners.
16//
17// Redistribution and use in source and binary forms, with or without modification,
18// are permitted provided that the following conditions are met:
19//
20// * Redistribution's of source code must retain the above copyright notice,
21// this list of conditions and the following disclaimer.
22//
23// * Redistribution's in binary form must reproduce the above copyright notice,
24// this list of conditions and the following disclaimer in the documentation
25// and/or other materials provided with the distribution.
26//
27// * The name of the copyright holders may not be used to endorse or promote products
28// derived from this software without specific prior written permission.
29//
30// This software is provided by the copyright holders and contributors "as is" and
31// any express or implied warranties, including, but not limited to, the implied
32// warranties of merchantability and fitness for a particular purpose are disclaimed.
33// In no event shall the Intel Corporation or contributors be liable for any direct,
34// indirect, incidental, special, exemplary, or consequential damages
35// (including, but not limited to, procurement of substitute goods or services;
36// loss of use, data, or profits; or business interruption) however caused
37// and on any theory of liability, whether in contract, strict liability,
38// or tort (including negligence or otherwise) arising in any way out of
39// the use of this software, even if advised of the possibility of such damage.
40//
41//M*/
42
43#ifndef OPENCV_PHOTO_HPP
44#define OPENCV_PHOTO_HPP
45
46#include "opencv2/core.hpp"
47#include "opencv2/imgproc.hpp"
48
85namespace cv
86{
87
90
94enum
95{
97 INPAINT_TELEA = 1
98};
99
120CV_EXPORTS_W void inpaint( InputArray src, InputArray inpaintMask,
121 OutputArray dst, double inpaintRadius, int flags );
122
124
127
148CV_EXPORTS_W void fastNlMeansDenoising( InputArray src, OutputArray dst, float h = 3,
149 int templateWindowSize = 7, int searchWindowSize = 21);
150
175CV_EXPORTS_W void fastNlMeansDenoising( InputArray src, OutputArray dst,
176 const std::vector<float>& h,
177 int templateWindowSize = 7, int searchWindowSize = 21,
178 int normType = NORM_L2);
179
198CV_EXPORTS_W void fastNlMeansDenoisingColored( InputArray src, OutputArray dst,
199 float h = 3, float hColor = 3,
200 int templateWindowSize = 7, int searchWindowSize = 21);
201
225CV_EXPORTS_W void fastNlMeansDenoisingMulti( InputArrayOfArrays srcImgs, OutputArray dst,
226 int imgToDenoiseIndex, int temporalWindowSize,
227 float h = 3, int templateWindowSize = 7, int searchWindowSize = 21);
228
254CV_EXPORTS_W void fastNlMeansDenoisingMulti( InputArrayOfArrays srcImgs, OutputArray dst,
255 int imgToDenoiseIndex, int temporalWindowSize,
256 const std::vector<float>& h,
257 int templateWindowSize = 7, int searchWindowSize = 21,
258 int normType = NORM_L2);
259
283CV_EXPORTS_W void fastNlMeansDenoisingColoredMulti( InputArrayOfArrays srcImgs, OutputArray dst,
284 int imgToDenoiseIndex, int temporalWindowSize,
285 float h = 3, float hColor = 3,
286 int templateWindowSize = 7, int searchWindowSize = 21);
287
325CV_EXPORTS_W void denoise_TVL1(const std::vector<Mat>& observations,Mat& result, double lambda=1.0, int niters=30);
326
328
331
332enum { LDR_SIZE = 256 };
333
336class CV_EXPORTS_W Tonemap : public Algorithm
337{
338public:
344 CV_WRAP virtual void process(InputArray src, OutputArray dst) = 0;
345
346 CV_WRAP virtual float getGamma() const = 0;
347 CV_WRAP virtual void setGamma(float gamma) = 0;
348};
349
356CV_EXPORTS_W Ptr<Tonemap> createTonemap(float gamma = 1.0f);
357
368class CV_EXPORTS_W TonemapDrago : public Tonemap
369{
370public:
371
372 CV_WRAP virtual float getSaturation() const = 0;
373 CV_WRAP virtual void setSaturation(float saturation) = 0;
374
375 CV_WRAP virtual float getBias() const = 0;
376 CV_WRAP virtual void setBias(float bias) = 0;
377};
378
387CV_EXPORTS_W Ptr<TonemapDrago> createTonemapDrago(float gamma = 1.0f, float saturation = 1.0f, float bias = 0.85f);
388
389
397class CV_EXPORTS_W TonemapReinhard : public Tonemap
398{
399public:
400 CV_WRAP virtual float getIntensity() const = 0;
401 CV_WRAP virtual void setIntensity(float intensity) = 0;
402
403 CV_WRAP virtual float getLightAdaptation() const = 0;
404 CV_WRAP virtual void setLightAdaptation(float light_adapt) = 0;
405
406 CV_WRAP virtual float getColorAdaptation() const = 0;
407 CV_WRAP virtual void setColorAdaptation(float color_adapt) = 0;
408};
409
419CV_EXPORTS_W Ptr<TonemapReinhard>
420createTonemapReinhard(float gamma = 1.0f, float intensity = 0.0f, float light_adapt = 1.0f, float color_adapt = 0.0f);
421
428class CV_EXPORTS_W TonemapMantiuk : public Tonemap
429{
430public:
431 CV_WRAP virtual float getScale() const = 0;
432 CV_WRAP virtual void setScale(float scale) = 0;
433
434 CV_WRAP virtual float getSaturation() const = 0;
435 CV_WRAP virtual void setSaturation(float saturation) = 0;
436};
437
445CV_EXPORTS_W Ptr<TonemapMantiuk>
446createTonemapMantiuk(float gamma = 1.0f, float scale = 0.7f, float saturation = 1.0f);
447
450class CV_EXPORTS_W AlignExposures : public Algorithm
451{
452public:
461 CV_WRAP virtual void process(InputArrayOfArrays src, std::vector<Mat>& dst,
462 InputArray times, InputArray response) = 0;
463};
464
474class CV_EXPORTS_W AlignMTB : public AlignExposures
475{
476public:
477 CV_WRAP virtual void process(InputArrayOfArrays src, std::vector<Mat>& dst,
478 InputArray times, InputArray response) CV_OVERRIDE = 0;
479
485 CV_WRAP virtual void process(InputArrayOfArrays src, std::vector<Mat>& dst) = 0;
486
493 CV_WRAP virtual Point calculateShift(InputArray img0, InputArray img1) = 0;
500 CV_WRAP virtual void shiftMat(InputArray src, OutputArray dst, const Point shift) = 0;
507 CV_WRAP virtual void computeBitmaps(InputArray img, OutputArray tb, OutputArray eb) = 0;
508
509 CV_WRAP virtual int getMaxBits() const = 0;
510 CV_WRAP virtual void setMaxBits(int max_bits) = 0;
511
512 CV_WRAP virtual int getExcludeRange() const = 0;
513 CV_WRAP virtual void setExcludeRange(int exclude_range) = 0;
514
515 CV_WRAP virtual bool getCut() const = 0;
516 CV_WRAP virtual void setCut(bool value) = 0;
517};
518
527CV_EXPORTS_W Ptr<AlignMTB> createAlignMTB(int max_bits = 6, int exclude_range = 4, bool cut = true);
528
531class CV_EXPORTS_W CalibrateCRF : public Algorithm
532{
533public:
540 CV_WRAP virtual void process(InputArrayOfArrays src, OutputArray dst, InputArray times) = 0;
541};
542
549class CV_EXPORTS_W CalibrateDebevec : public CalibrateCRF
550{
551public:
552 CV_WRAP virtual float getLambda() const = 0;
553 CV_WRAP virtual void setLambda(float lambda) = 0;
554
555 CV_WRAP virtual int getSamples() const = 0;
556 CV_WRAP virtual void setSamples(int samples) = 0;
557
558 CV_WRAP virtual bool getRandom() const = 0;
559 CV_WRAP virtual void setRandom(bool random) = 0;
560};
561
570CV_EXPORTS_W Ptr<CalibrateDebevec> createCalibrateDebevec(int samples = 70, float lambda = 10.0f, bool random = false);
571
577class CV_EXPORTS_W CalibrateRobertson : public CalibrateCRF
578{
579public:
580 CV_WRAP virtual int getMaxIter() const = 0;
581 CV_WRAP virtual void setMaxIter(int max_iter) = 0;
582
583 CV_WRAP virtual float getThreshold() const = 0;
584 CV_WRAP virtual void setThreshold(float threshold) = 0;
585
586 CV_WRAP virtual Mat getRadiance() const = 0;
587};
588
594CV_EXPORTS_W Ptr<CalibrateRobertson> createCalibrateRobertson(int max_iter = 30, float threshold = 0.01f);
595
598class CV_EXPORTS_W MergeExposures : public Algorithm
599{
600public:
609 CV_WRAP virtual void process(InputArrayOfArrays src, OutputArray dst,
610 InputArray times, InputArray response) = 0;
611};
612
618class CV_EXPORTS_W MergeDebevec : public MergeExposures
619{
620public:
621 CV_WRAP virtual void process(InputArrayOfArrays src, OutputArray dst,
622 InputArray times, InputArray response) CV_OVERRIDE = 0;
623 CV_WRAP virtual void process(InputArrayOfArrays src, OutputArray dst, InputArray times) = 0;
624};
625
629
641class CV_EXPORTS_W MergeMertens : public MergeExposures
642{
643public:
644 CV_WRAP virtual void process(InputArrayOfArrays src, OutputArray dst,
645 InputArray times, InputArray response) CV_OVERRIDE = 0;
651 CV_WRAP virtual void process(InputArrayOfArrays src, OutputArray dst) = 0;
652
653 CV_WRAP virtual float getContrastWeight() const = 0;
654 CV_WRAP virtual void setContrastWeight(float contrast_weiht) = 0;
655
656 CV_WRAP virtual float getSaturationWeight() const = 0;
657 CV_WRAP virtual void setSaturationWeight(float saturation_weight) = 0;
658
659 CV_WRAP virtual float getExposureWeight() const = 0;
660 CV_WRAP virtual void setExposureWeight(float exposure_weight) = 0;
661};
662
669CV_EXPORTS_W Ptr<MergeMertens>
670createMergeMertens(float contrast_weight = 1.0f, float saturation_weight = 1.0f, float exposure_weight = 0.0f);
671
677class CV_EXPORTS_W MergeRobertson : public MergeExposures
678{
679public:
680 CV_WRAP virtual void process(InputArrayOfArrays src, OutputArray dst,
681 InputArray times, InputArray response) CV_OVERRIDE = 0;
682 CV_WRAP virtual void process(InputArrayOfArrays src, OutputArray dst, InputArray times) = 0;
683};
684
688
690
693
704CV_EXPORTS_W void decolor( InputArray src, OutputArray grayscale, OutputArray color_boost);
705
707
710
711
713enum
714{
722
723
740CV_EXPORTS_W void seamlessClone( InputArray src, InputArray dst, InputArray mask, Point p,
741 OutputArray blend, int flags);
742
755CV_EXPORTS_W void colorChange(InputArray src, InputArray mask, OutputArray dst, float red_mul = 1.0f,
756 float green_mul = 1.0f, float blue_mul = 1.0f);
757
769CV_EXPORTS_W void illuminationChange(InputArray src, InputArray mask, OutputArray dst,
770 float alpha = 0.2f, float beta = 0.4f);
771
787CV_EXPORTS_W void textureFlattening(InputArray src, InputArray mask, OutputArray dst,
788 float low_threshold = 30, float high_threshold = 45,
789 int kernel_size = 3);
790
792
795
797enum
798{
800 NORMCONV_FILTER = 2
802
812CV_EXPORTS_W void edgePreservingFilter(InputArray src, OutputArray dst, int flags = 1,
813 float sigma_s = 60, float sigma_r = 0.4f);
814
822CV_EXPORTS_W void detailEnhance(InputArray src, OutputArray dst, float sigma_s = 10,
823 float sigma_r = 0.15f);
824
837CV_EXPORTS_W void pencilSketch(InputArray src, OutputArray dst1, OutputArray dst2,
838 float sigma_s = 60, float sigma_r = 0.07f, float shade_factor = 0.02f);
839
849CV_EXPORTS_W void stylization(InputArray src, OutputArray dst, float sigma_s = 60,
850 float sigma_r = 0.45f);
851
853
855
856} // cv
857
858#endif
This type is very similar to InputArray except that it is used for input/output and output function p...
Definition: mat.hpp:295
This is a base class for all more or less complex algorithms in OpenCV
Definition: core.hpp:3091
The base class for algorithms that align images of the same scene with different exposures
Definition: photo.hpp:451
This algorithm converts images to median threshold bitmaps (1 for pixels brighter than median luminan...
Definition: photo.hpp:475
The base class for camera response calibration algorithms.
Definition: photo.hpp:532
Inverse camera response function is extracted for each brightness value by minimizing an objective fu...
Definition: photo.hpp:550
Inverse camera response function is extracted for each brightness value by minimizing an objective fu...
Definition: photo.hpp:578
n-dimensional dense array class
Definition: mat.hpp:802
The resulting HDR image is calculated as weighted average of the exposures considering exposure value...
Definition: photo.hpp:619
The base class algorithms that can merge exposure sequence to a single image.
Definition: photo.hpp:599
Pixels are weighted using contrast, saturation and well-exposedness measures, than images are combine...
Definition: photo.hpp:642
The resulting HDR image is calculated as weighted average of the exposures considering exposure value...
Definition: photo.hpp:678
Adaptive logarithmic mapping is a fast global tonemapping algorithm that scales the image in logarith...
Definition: photo.hpp:369
Base class for tonemapping algorithms - tools that are used to map HDR image to 8-bit range.
Definition: photo.hpp:337
This algorithm transforms image to contrast using gradients on all levels of gaussian pyramid,...
Definition: photo.hpp:429
This is a global tonemapping operator that models human visual system.
Definition: photo.hpp:398
@ NORM_L2
Definition: base.hpp:185
CV_EXPORTS_W double threshold(InputArray src, OutputArray dst, double thresh, double maxval, int type)
Applies a fixed-level threshold to each array element.
CV_EXPORTS_W void seamlessClone(InputArray src, InputArray dst, InputArray mask, Point p, OutputArray blend, int flags)
Image editing tasks concern either global changes (color/intensity corrections, filters,...
CV_EXPORTS_W void colorChange(InputArray src, InputArray mask, OutputArray dst, float red_mul=1.0f, float green_mul=1.0f, float blue_mul=1.0f)
Given an original color image, two differently colored versions of this image can be mixed seamlessly...
CV_EXPORTS_W void illuminationChange(InputArray src, InputArray mask, OutputArray dst, float alpha=0.2f, float beta=0.4f)
Applying an appropriate non-linear transformation to the gradient field inside the selection and then...
CV_EXPORTS_W void textureFlattening(InputArray src, InputArray mask, OutputArray dst, float low_threshold=30, float high_threshold=45, int kernel_size=3)
By retaining only the gradients at edge locations, before integrating with the Poisson solver,...
@ MONOCHROME_TRANSFER
Definition: photo.hpp:721
@ NORMAL_CLONE
Definition: photo.hpp:716
@ MIXED_CLONE
Definition: photo.hpp:719
CV_EXPORTS_W void decolor(InputArray src, OutputArray grayscale, OutputArray color_boost)
Transforms a color image to a grayscale image. It is a basic tool in digital printing,...
CV_EXPORTS_W void fastNlMeansDenoisingMulti(InputArrayOfArrays srcImgs, OutputArray dst, int imgToDenoiseIndex, int temporalWindowSize, float h=3, int templateWindowSize=7, int searchWindowSize=21)
Modification of fastNlMeansDenoising function for images sequence where consecutive images have been ...
CV_EXPORTS_W void denoise_TVL1(const std::vector< Mat > &observations, Mat &result, double lambda=1.0, int niters=30)
Primal-dual algorithm is an algorithm for solving special types of variational problems (that is,...
CV_EXPORTS_W void fastNlMeansDenoisingColoredMulti(InputArrayOfArrays srcImgs, OutputArray dst, int imgToDenoiseIndex, int temporalWindowSize, float h=3, float hColor=3, int templateWindowSize=7, int searchWindowSize=21)
Modification of fastNlMeansDenoisingMulti function for colored images sequences
CV_EXPORTS_W void fastNlMeansDenoising(InputArray src, OutputArray dst, float h=3, int templateWindowSize=7, int searchWindowSize=21)
Perform image denoising using Non-local Means Denoising algorithm http://www.ipol....
CV_EXPORTS_W void fastNlMeansDenoisingColored(InputArray src, OutputArray dst, float h=3, float hColor=3, int templateWindowSize=7, int searchWindowSize=21)
Modification of fastNlMeansDenoising function for colored images
CV_EXPORTS_W Ptr< MergeRobertson > createMergeRobertson()
Creates MergeRobertson object
CV_EXPORTS_W Ptr< AlignMTB > createAlignMTB(int max_bits=6, int exclude_range=4, bool cut=true)
Creates AlignMTB object
CV_EXPORTS_W Ptr< CalibrateDebevec > createCalibrateDebevec(int samples=70, float lambda=10.0f, bool random=false)
Creates CalibrateDebevec object
CV_EXPORTS_W Ptr< Tonemap > createTonemap(float gamma=1.0f)
Creates simple linear mapper with gamma correction
CV_EXPORTS_W Ptr< TonemapDrago > createTonemapDrago(float gamma=1.0f, float saturation=1.0f, float bias=0.85f)
Creates TonemapDrago object
CV_EXPORTS_W Ptr< TonemapMantiuk > createTonemapMantiuk(float gamma=1.0f, float scale=0.7f, float saturation=1.0f)
Creates TonemapMantiuk object
CV_EXPORTS_W Ptr< MergeMertens > createMergeMertens(float contrast_weight=1.0f, float saturation_weight=1.0f, float exposure_weight=0.0f)
Creates MergeMertens object
CV_EXPORTS_W Ptr< MergeDebevec > createMergeDebevec()
Creates MergeDebevec object
CV_EXPORTS_W Ptr< TonemapReinhard > createTonemapReinhard(float gamma=1.0f, float intensity=0.0f, float light_adapt=1.0f, float color_adapt=0.0f)
Creates TonemapReinhard object
CV_EXPORTS_W Ptr< CalibrateRobertson > createCalibrateRobertson(int max_iter=30, float threshold=0.01f)
Creates CalibrateRobertson object
CV_EXPORTS_W void inpaint(InputArray src, InputArray inpaintMask, OutputArray dst, double inpaintRadius, int flags)
Restores the selected region in an image using the region neighborhood.
@ INPAINT_NS
Use Navier-Stokes based method
Definition: photo.hpp:96
@ INPAINT_TELEA
Use the algorithm proposed by Alexandru Telea
Definition: photo.hpp:97
CV_EXPORTS_W void stylization(InputArray src, OutputArray dst, float sigma_s=60, float sigma_r=0.45f)
Stylization aims to produce digital imagery with a wide variety of effects not focused on photorealis...
CV_EXPORTS_W void pencilSketch(InputArray src, OutputArray dst1, OutputArray dst2, float sigma_s=60, float sigma_r=0.07f, float shade_factor=0.02f)
Pencil-like non-photorealistic line drawing
CV_EXPORTS_W void edgePreservingFilter(InputArray src, OutputArray dst, int flags=1, float sigma_s=60, float sigma_r=0.4f)
Filtering is the fundamental operation in image and video processing. Edge-preserving smoothing filte...
CV_EXPORTS_W void detailEnhance(InputArray src, OutputArray dst, float sigma_s=10, float sigma_r=0.15f)
This filter enhances the details of a particular image.
@ RECURS_FILTER
Recursive Filtering
Definition: photo.hpp:799
@ NORMCONV_FILTER
Normalized Convolution Filtering
Definition: photo.hpp:800
"black box" representation of the file storage associated with a file on disk.
Definition: aruco.hpp:75
Definition: cvstd_wrapper.hpp:74