Visual Servoing Platform version 3.6.0
Loading...
Searching...
No Matches
vpImgproc.h
1/*
2 * ViSP, open source Visual Servoing Platform software.
3 * Copyright (C) 2005 - 2023 by Inria. All rights reserved.
4 *
5 * This software is free software; you can redistribute it and/or modify
6 * it under the terms of the GNU General Public License as published by
7 * the Free Software Foundation; either version 2 of the License, or
8 * (at your option) any later version.
9 * See the file LICENSE.txt at the root directory of this source
10 * distribution for additional information about the GNU GPL.
11 *
12 * For using ViSP with software that can not be combined with the GNU
13 * GPL, please contact Inria about acquiring a ViSP Professional
14 * Edition License.
15 *
16 * See https://visp.inria.fr for more information.
17 *
18 * This software was developed at:
19 * Inria Rennes - Bretagne Atlantique
20 * Campus Universitaire de Beaulieu
21 * 35042 Rennes Cedex
22 * France
23 *
24 * If you have questions regarding the use of this file, please contact
25 * Inria at visp@inria.fr
26 *
27 * This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE
28 * WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
29 *
30 * Description:
31 * Static functions for basic image processing functions.
32 */
33
40#ifndef _vpImgproc_h_
41#define _vpImgproc_h_
42
43#include <visp3/core/vpImage.h>
44#include <visp3/core/vpImageMorphology.h>
45#include <visp3/imgproc/vpContours.h>
46
47#define USE_OLD_FILL_HOLE 0
48
49namespace vp
50{
61
93
104VISP_EXPORT void adjust(vpImage<unsigned char> &I, double alpha, double beta);
105
117VISP_EXPORT void adjust(const vpImage<unsigned char> &I1, vpImage<unsigned char> &I2, double alpha, double beta);
118
129VISP_EXPORT void adjust(vpImage<vpRGBa> &I, const double alpha, double beta);
130
142VISP_EXPORT void adjust(const vpImage<vpRGBa> &I1, vpImage<vpRGBa> &I2, double alpha, double beta);
143
173VISP_EXPORT void clahe(const vpImage<unsigned char> &I1, vpImage<unsigned char> &I2, int blockRadius = 150,
174 int bins = 256, float slope = 3.0f, bool fast = true);
175
203VISP_EXPORT void clahe(const vpImage<vpRGBa> &I1, vpImage<vpRGBa> &I2, int blockRadius = 150, int bins = 256,
204 float slope = 3.0f, bool fast = true);
205
215VISP_EXPORT void equalizeHistogram(vpImage<unsigned char> &I);
216
228
242VISP_EXPORT void equalizeHistogram(vpImage<vpRGBa> &I, bool useHSV = false);
243
258VISP_EXPORT void equalizeHistogram(const vpImage<vpRGBa> &I1, vpImage<vpRGBa> &I2, bool useHSV = false);
259
268VISP_EXPORT void gammaCorrection(vpImage<unsigned char> &I, double gamma);
269
279VISP_EXPORT void gammaCorrection(const vpImage<unsigned char> &I1, vpImage<unsigned char> &I2, double gamma);
280
289VISP_EXPORT void gammaCorrection(vpImage<vpRGBa> &I, double gamma);
290
300VISP_EXPORT void gammaCorrection(const vpImage<vpRGBa> &I1, vpImage<vpRGBa> &I2, double gamma);
301
323VISP_EXPORT void retinex(vpImage<vpRGBa> &I, int scale = 240, int scaleDiv = 3, int level = RETINEX_UNIFORM,
324 double dynamic = 1.2, int kernelSize = -1);
325
348VISP_EXPORT void retinex(const vpImage<vpRGBa> &I1, vpImage<vpRGBa> &I2, int scale = 240, int scaleDiv = 3,
349 int level = RETINEX_UNIFORM, double dynamic = 1.2, int kernelSize = -1);
350
358VISP_EXPORT void stretchContrast(vpImage<unsigned char> &I);
359
368VISP_EXPORT void stretchContrast(const vpImage<unsigned char> &I1, vpImage<unsigned char> &I2);
369
377VISP_EXPORT void stretchContrast(vpImage<vpRGBa> &I);
378
387VISP_EXPORT void stretchContrast(const vpImage<vpRGBa> &I1, vpImage<vpRGBa> &I2);
388
397VISP_EXPORT void stretchContrastHSV(vpImage<vpRGBa> &I);
398
408VISP_EXPORT void stretchContrastHSV(const vpImage<vpRGBa> &I1, vpImage<vpRGBa> &I2);
409
410#if defined(VISP_BUILD_DEPRECATED_FUNCTIONS)
415vp_deprecated VISP_EXPORT void unsharpMask(vpImage<unsigned char> &I, unsigned int size = 7, double weight = 0.6);
416vp_deprecated VISP_EXPORT void unsharpMask(const vpImage<unsigned char> &I, vpImage<unsigned char> &Ires,
417 unsigned int size = 7, double weight = 0.6);
418vp_deprecated VISP_EXPORT void unsharpMask(vpImage<vpRGBa> &I, unsigned int size = 7, double weight = 0.6);
419vp_deprecated VISP_EXPORT void unsharpMask(const vpImage<vpRGBa> &I, vpImage<vpRGBa> &Ires, unsigned int size = 7,
420 double weight = 0.6);
422#endif
423
433VISP_EXPORT void unsharpMask(vpImage<unsigned char> &I, float sigma, double weight = 0.6);
434
445VISP_EXPORT void unsharpMask(const vpImage<unsigned char> &I, vpImage<unsigned char> &Ires, float sigma,
446 double weight = 0.6);
447
457VISP_EXPORT void unsharpMask(vpImage<vpRGBa> &I, float sigma, double weight = 0.6);
458
469VISP_EXPORT void unsharpMask(const vpImage<vpRGBa> &I, vpImage<vpRGBa> &Ires, float sigma, double weight = 0.6);
470
481VISP_EXPORT void connectedComponents(const vpImage<unsigned char> &I, vpImage<int> &labels, int &nbComponents,
483
491VISP_EXPORT void fillHoles(vpImage<unsigned char> &I
492#if USE_OLD_FILL_HOLE
493 ,
495#endif
496);
497
509VISP_EXPORT void floodFill(vpImage<unsigned char> &I, const vpImagePoint &seedPoint, const unsigned char oldValue,
510 const unsigned char newValue,
512
531VISP_EXPORT void reconstruct(const vpImage<unsigned char> &marker, const vpImage<unsigned char> &mask,
532 vpImage<unsigned char> &h_kp1 /*alias I */,
534
545VISP_EXPORT unsigned char autoThreshold(vpImage<unsigned char> &I, const vp::vpAutoThresholdMethod &method,
546 const unsigned char backgroundValue = 0,
547 const unsigned char foregroundValue = 255);
548} // namespace vp
549
550#endif
Class that defines a 2D point in an image. This class is useful for image processing and stores only ...
Definition of the vpImage class member functions.
Definition vpImage.h:135
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:196
VISP_EXPORT void adjust(vpImage< unsigned char > &I, double alpha, double beta)
Definition vpImgproc.cpp:68
VISP_EXPORT void stretchContrast(vpImage< unsigned char > &I)
VISP_EXPORT void stretchContrastHSV(vpImage< vpRGBa > &I)
VISP_EXPORT void gammaCorrection(vpImage< unsigned char > &I, double gamma)
VISP_EXPORT void equalizeHistogram(vpImage< unsigned char > &I)
VISP_EXPORT void retinex(vpImage< vpRGBa > &I, int scale=240, int scaleDiv=3, int level=RETINEX_UNIFORM, double dynamic=1.2, int kernelSize=-1)
vp_deprecated VISP_EXPORT void unsharpMask(vpImage< unsigned char > &I, unsigned int size=7, double weight=0.6)
VISP_EXPORT void fillHoles(vpImage< unsigned char > &I)
Definition vpMorph.cpp:45
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)
VISP_EXPORT void reconstruct(const vpImage< unsigned char > &marker, const vpImage< unsigned char > &mask, vpImage< unsigned char > &h_kp1, const vpImageMorphology::vpConnexityType &connexity=vpImageMorphology::CONNEXITY_4)
Definition vpMorph.cpp:119
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
Enhances the bright regions of the image.
Definition vpImgproc.h:59
@ RETINEX_LOW
Enhances dark regions of the image.
Definition vpImgproc.h:58
@ RETINEX_UNIFORM
Tends to treat all image intensities similarly.
Definition vpImgproc.h:57
vpAutoThresholdMethod
Definition vpImgproc.h:66
@ AUTO_THRESHOLD_ISODATA
Definition vpImgproc.h:75
@ AUTO_THRESHOLD_HUANG
Definition vpImgproc.h:67
@ AUTO_THRESHOLD_INTERMODES
Definition vpImgproc.h:71
@ AUTO_THRESHOLD_TRIANGLE
Definition vpImgproc.h:87
@ AUTO_THRESHOLD_MEAN
Definition vpImgproc.h:79
@ AUTO_THRESHOLD_OTSU
Definition vpImgproc.h:83