Visual Servoing Platform version 3.5.0
vpImgproc.h
1/****************************************************************************
2 *
3 * ViSP, open source Visual Servoing Platform software.
4 * Copyright (C) 2005 - 2019 by Inria. All rights reserved.
5 *
6 * This software is free software; you can redistribute it and/or modify
7 * it under the terms of the GNU General Public License as published by
8 * the Free Software Foundation; either version 2 of the License, or
9 * (at your option) any later version.
10 * See the file LICENSE.txt at the root directory of this source
11 * distribution for additional information about the GNU GPL.
12 *
13 * For using ViSP with software that can not be combined with the GNU
14 * GPL, please contact Inria about acquiring a ViSP Professional
15 * Edition License.
16 *
17 * See http://visp.inria.fr for more information.
18 *
19 * This software was developed at:
20 * Inria Rennes - Bretagne Atlantique
21 * Campus Universitaire de Beaulieu
22 * 35042 Rennes Cedex
23 * France
24 *
25 * If you have questions regarding the use of this file, please contact
26 * Inria at visp@inria.fr
27 *
28 * This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE
29 * WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
30 *
31 * Description:
32 * Static functions for basic image processing functions.
33 *
34 * Authors:
35 * Souriya Trinh
36 *
37 *****************************************************************************/
38
45#ifndef _vpImgproc_h_
46#define _vpImgproc_h_
47
48#include <visp3/core/vpImage.h>
49#include <visp3/core/vpImageMorphology.h>
50#include <visp3/imgproc/vpContours.h>
51
52#define USE_OLD_FILL_HOLE 0
53
54namespace vp
55{
57
58typedef enum {
85
86VISP_EXPORT void adjust(vpImage<unsigned char> &I, double alpha, double beta);
87VISP_EXPORT void adjust(const vpImage<unsigned char> &I1, vpImage<unsigned char> &I2, double alpha,
88 double beta);
89VISP_EXPORT void adjust(vpImage<vpRGBa> &I, const double alpha, double beta);
90VISP_EXPORT void adjust(const vpImage<vpRGBa> &I1, vpImage<vpRGBa> &I2, double alpha, double beta);
91
92VISP_EXPORT void clahe(const vpImage<unsigned char> &I1, vpImage<unsigned char> &I2, int blockRadius = 150,
93 int bins = 256, float slope = 3.0f, bool fast = true);
94VISP_EXPORT void clahe(const vpImage<vpRGBa> &I1, vpImage<vpRGBa> &I2, int blockRadius = 150,
95 int bins = 256, float slope = 3.0f, bool fast = true);
96
97VISP_EXPORT void equalizeHistogram(vpImage<unsigned char> &I);
99VISP_EXPORT void equalizeHistogram(vpImage<vpRGBa> &I, bool useHSV = false);
100VISP_EXPORT void equalizeHistogram(const vpImage<vpRGBa> &I1, vpImage<vpRGBa> &I2, bool useHSV = false);
101
102VISP_EXPORT void gammaCorrection(vpImage<unsigned char> &I, double gamma);
103VISP_EXPORT void gammaCorrection(const vpImage<unsigned char> &I1, vpImage<unsigned char> &I2, double gamma);
104VISP_EXPORT void gammaCorrection(vpImage<vpRGBa> &I, double gamma);
105VISP_EXPORT void gammaCorrection(const vpImage<vpRGBa> &I1, vpImage<vpRGBa> &I2, double gamma);
106
107VISP_EXPORT void retinex(vpImage<vpRGBa> &I, int scale = 240, int scaleDiv = 3,
108 int level = RETINEX_UNIFORM, double dynamic = 1.2, int kernelSize = -1);
109VISP_EXPORT void retinex(const vpImage<vpRGBa> &I1, vpImage<vpRGBa> &I2, int scale = 240, int scaleDiv = 3,
110 int level = RETINEX_UNIFORM, double dynamic = 1.2, int kernelSize = -1);
111
112VISP_EXPORT void stretchContrast(vpImage<unsigned char> &I);
113VISP_EXPORT void stretchContrast(const vpImage<unsigned char> &I1, vpImage<unsigned char> &I2);
114VISP_EXPORT void stretchContrast(vpImage<vpRGBa> &I);
115VISP_EXPORT void stretchContrast(const vpImage<vpRGBa> &I1, vpImage<vpRGBa> &I2);
116
117VISP_EXPORT void stretchContrastHSV(vpImage<vpRGBa> &I);
118VISP_EXPORT void stretchContrastHSV(const vpImage<vpRGBa> &I1, vpImage<vpRGBa> &I2);
119
120#if defined(VISP_BUILD_DEPRECATED_FUNCTIONS)
125vp_deprecated VISP_EXPORT void unsharpMask(vpImage<unsigned char> &I, unsigned int size = 7, double weight = 0.6);
126vp_deprecated VISP_EXPORT void unsharpMask(const vpImage<unsigned char> &I, vpImage<unsigned char> &Ires, unsigned int size = 7,
127 double weight = 0.6);
128vp_deprecated VISP_EXPORT void unsharpMask(vpImage<vpRGBa> &I, unsigned int size = 7, double weight = 0.6);
129vp_deprecated VISP_EXPORT void unsharpMask(const vpImage<vpRGBa> &I, vpImage<vpRGBa> &Ires, unsigned int size = 7,
130 double weight = 0.6);
132#endif
133
134VISP_EXPORT void unsharpMask(vpImage<unsigned char> &I, float sigma, double weight = 0.6);
135VISP_EXPORT void unsharpMask(const vpImage<unsigned char> &I, vpImage<unsigned char> &Ires, float sigma,
136 double weight = 0.6);
137VISP_EXPORT void unsharpMask(vpImage<vpRGBa> &I, float sigma, double weight = 0.6);
138VISP_EXPORT void unsharpMask(const vpImage<vpRGBa> &I, vpImage<vpRGBa> &Ires, float sigma,
139 double weight = 0.6);
140
141VISP_EXPORT void
142connectedComponents(const vpImage<unsigned char> &I, vpImage<int> &labels, int &nbComponents,
144
145VISP_EXPORT void fillHoles(vpImage<unsigned char> &I
146#if USE_OLD_FILL_HOLE
147 ,
149#endif
150);
151
152VISP_EXPORT void floodFill(vpImage<unsigned char> &I, const vpImagePoint &seedPoint, const unsigned char oldValue,
153 const unsigned char newValue,
155
156VISP_EXPORT void reconstruct(const vpImage<unsigned char> &marker, const vpImage<unsigned char> &mask,
159
160VISP_EXPORT unsigned char autoThreshold(vpImage<unsigned char> &I, const vp::vpAutoThresholdMethod &method,
161 const unsigned char backgroundValue = 0,
162 const unsigned char foregroundValue = 255);
163}
164
165#endif
Class that defines a 2D point in an image. This class is useful for image processing and stores only ...
Definition: vpImagePoint.h:88
VISP_EXPORT void clahe(const vpImage< unsigned char > &I1, vpImage< unsigned char > &I2, int blockRadius=150, int bins=256, float slope=3.0f, bool fast=true)
Definition: vpCLAHE.cpp:228
VISP_EXPORT void adjust(vpImage< unsigned char > &I, double alpha, double beta)
Definition: vpImgproc.cpp:81
VISP_EXPORT void stretchContrast(vpImage< unsigned char > &I)
Definition: vpImgproc.cpp:419
VISP_EXPORT void stretchContrastHSV(vpImage< vpRGBa > &I)
Definition: vpImgproc.cpp:556
VISP_EXPORT void gammaCorrection(vpImage< unsigned char > &I, double gamma)
Definition: vpImgproc.cpp:335
VISP_EXPORT void equalizeHistogram(vpImage< unsigned char > &I)
Definition: vpImgproc.cpp:165
VISP_EXPORT void retinex(vpImage< vpRGBa > &I, int scale=240, int scaleDiv=3, int level=RETINEX_UNIFORM, double dynamic=1.2, int kernelSize=-1)
Definition: vpRetinex.cpp:264
VISP_EXPORT void reconstruct(const vpImage< unsigned char > &marker, const vpImage< unsigned char > &mask, vpImage< unsigned char > &I, const vpImageMorphology::vpConnexityType &connexity=vpImageMorphology::CONNEXITY_4)
Definition: vpMorph.cpp:145
vp_deprecated VISP_EXPORT void unsharpMask(vpImage< unsigned char > &I, unsigned int size=7, double weight=0.6)
Definition: vpImgproc.cpp:719
VISP_EXPORT void fillHoles(vpImage< unsigned char > &I)
Definition: vpMorph.cpp:54
VISP_EXPORT void floodFill(vpImage< unsigned char > &I, const vpImagePoint &seedPoint, const unsigned char oldValue, const unsigned char newValue, const vpImageMorphology::vpConnexityType &connexity=vpImageMorphology::CONNEXITY_4)
Definition: vpFloodFill.cpp:85
VISP_EXPORT void connectedComponents(const vpImage< unsigned char > &I, vpImage< int > &labels, int &nbComponents, const vpImageMorphology::vpConnexityType &connexity=vpImageMorphology::CONNEXITY_4)
VISP_EXPORT unsigned char autoThreshold(vpImage< unsigned char > &I, const vp::vpAutoThresholdMethod &method, const unsigned char backgroundValue=0, const unsigned char foregroundValue=255)
RETINEX_LEVEL
Definition: vpImgproc.h:56
@ RETINEX_HIGH
Definition: vpImgproc.h:56
@ RETINEX_LOW
Definition: vpImgproc.h:56
@ RETINEX_UNIFORM
Definition: vpImgproc.h:56
vpAutoThresholdMethod
Definition: vpImgproc.h:58
@ AUTO_THRESHOLD_ISODATA
Definition: vpImgproc.h:67
@ AUTO_THRESHOLD_HUANG
Definition: vpImgproc.h:59
@ AUTO_THRESHOLD_INTERMODES
Definition: vpImgproc.h:63
@ AUTO_THRESHOLD_TRIANGLE
Definition: vpImgproc.h:79
@ AUTO_THRESHOLD_MEAN
Definition: vpImgproc.h:71
@ AUTO_THRESHOLD_OTSU
Definition: vpImgproc.h:75