public class Photo extends Object
Modifier and Type | Field and Description |
---|---|
static int |
INPAINT_NS |
static int |
INPAINT_TELEA |
static int |
LDR_SIZE |
static int |
MIXED_CLONE |
static int |
MONOCHROME_TRANSFER |
static int |
NORMAL_CLONE |
static int |
NORMCONV_FILTER |
static int |
RECURS_FILTER |
Constructor and Description |
---|
Photo() |
Modifier and Type | Method and Description |
---|---|
static void |
colorChange(Mat src,
Mat mask,
Mat dst)
Given an original color image, two differently colored versions of this image can be mixed
seamlessly.
|
static void |
colorChange(Mat src,
Mat mask,
Mat dst,
float red_mul)
Given an original color image, two differently colored versions of this image can be mixed
seamlessly.
|
static void |
colorChange(Mat src,
Mat mask,
Mat dst,
float red_mul,
float green_mul)
Given an original color image, two differently colored versions of this image can be mixed
seamlessly.
|
static void |
colorChange(Mat src,
Mat mask,
Mat dst,
float red_mul,
float green_mul,
float blue_mul)
Given an original color image, two differently colored versions of this image can be mixed
seamlessly.
|
static AlignMTB |
createAlignMTB()
Creates AlignMTB object
usually good enough (31 and 63 pixels shift respectively).
|
static AlignMTB |
createAlignMTB(int max_bits)
Creates AlignMTB object
|
static AlignMTB |
createAlignMTB(int max_bits,
int exclude_range)
Creates AlignMTB object
|
static AlignMTB |
createAlignMTB(int max_bits,
int exclude_range,
boolean cut)
Creates AlignMTB object
|
static CalibrateDebevec |
createCalibrateDebevec()
Creates CalibrateDebevec object
response.
|
static CalibrateDebevec |
createCalibrateDebevec(int samples)
Creates CalibrateDebevec object
|
static CalibrateDebevec |
createCalibrateDebevec(int samples,
float lambda)
Creates CalibrateDebevec object
|
static CalibrateDebevec |
createCalibrateDebevec(int samples,
float lambda,
boolean random)
Creates CalibrateDebevec object
|
static CalibrateRobertson |
createCalibrateRobertson()
Creates CalibrateRobertson object
|
static CalibrateRobertson |
createCalibrateRobertson(int max_iter)
Creates CalibrateRobertson object
|
static CalibrateRobertson |
createCalibrateRobertson(int max_iter,
float threshold)
Creates CalibrateRobertson object
|
static MergeDebevec |
createMergeDebevec()
Creates MergeDebevec object
|
static MergeMertens |
createMergeMertens()
Creates MergeMertens object
|
static MergeMertens |
createMergeMertens(float contrast_weight)
Creates MergeMertens object
|
static MergeMertens |
createMergeMertens(float contrast_weight,
float saturation_weight)
Creates MergeMertens object
|
static MergeMertens |
createMergeMertens(float contrast_weight,
float saturation_weight,
float exposure_weight)
Creates MergeMertens object
|
static MergeRobertson |
createMergeRobertson()
Creates MergeRobertson object
|
static Tonemap |
createTonemap()
Creates simple linear mapper with gamma correction
equal to 2.2f is suitable for most displays.
|
static Tonemap |
createTonemap(float gamma)
Creates simple linear mapper with gamma correction
|
static TonemapDrago |
createTonemapDrago()
Creates TonemapDrago object
than 1 increase saturation and values less than 1 decrease it.
|
static TonemapDrago |
createTonemapDrago(float gamma)
Creates TonemapDrago object
|
static TonemapDrago |
createTonemapDrago(float gamma,
float saturation)
Creates TonemapDrago object
|
static TonemapDrago |
createTonemapDrago(float gamma,
float saturation,
float bias)
Creates TonemapDrago object
|
static TonemapMantiuk |
createTonemapMantiuk()
Creates TonemapMantiuk object
dynamic range.
|
static TonemapMantiuk |
createTonemapMantiuk(float gamma)
Creates TonemapMantiuk object
|
static TonemapMantiuk |
createTonemapMantiuk(float gamma,
float scale)
Creates TonemapMantiuk object
|
static TonemapMantiuk |
createTonemapMantiuk(float gamma,
float scale,
float saturation)
Creates TonemapMantiuk object
|
static TonemapReinhard |
createTonemapReinhard()
Creates TonemapReinhard object
value, if 0 it's global, otherwise it's a weighted mean of this two cases.
|
static TonemapReinhard |
createTonemapReinhard(float gamma)
Creates TonemapReinhard object
|
static TonemapReinhard |
createTonemapReinhard(float gamma,
float intensity)
Creates TonemapReinhard object
|
static TonemapReinhard |
createTonemapReinhard(float gamma,
float intensity,
float light_adapt)
Creates TonemapReinhard object
|
static TonemapReinhard |
createTonemapReinhard(float gamma,
float intensity,
float light_adapt,
float color_adapt)
Creates TonemapReinhard object
|
static void |
decolor(Mat src,
Mat grayscale,
Mat color_boost)
Transforms a color image to a grayscale image.
|
static void |
denoise_TVL1(List<Mat> observations,
Mat result)
Primal-dual algorithm is an algorithm for solving special types of variational problems (that is,
finding a function to minimize some functional).
|
static void |
denoise_TVL1(List<Mat> observations,
Mat result,
double lambda)
Primal-dual algorithm is an algorithm for solving special types of variational problems (that is,
finding a function to minimize some functional).
|
static void |
denoise_TVL1(List<Mat> observations,
Mat result,
double lambda,
int niters)
Primal-dual algorithm is an algorithm for solving special types of variational problems (that is,
finding a function to minimize some functional).
|
static void |
detailEnhance(Mat src,
Mat dst)
This filter enhances the details of a particular image.
|
static void |
detailEnhance(Mat src,
Mat dst,
float sigma_s)
This filter enhances the details of a particular image.
|
static void |
detailEnhance(Mat src,
Mat dst,
float sigma_s,
float sigma_r)
This filter enhances the details of a particular image.
|
static void |
edgePreservingFilter(Mat src,
Mat dst)
Filtering is the fundamental operation in image and video processing.
|
static void |
edgePreservingFilter(Mat src,
Mat dst,
int flags)
Filtering is the fundamental operation in image and video processing.
|
static void |
edgePreservingFilter(Mat src,
Mat dst,
int flags,
float sigma_s)
Filtering is the fundamental operation in image and video processing.
|
static void |
edgePreservingFilter(Mat src,
Mat dst,
int flags,
float sigma_s,
float sigma_r)
Filtering is the fundamental operation in image and video processing.
|
static void |
fastNlMeansDenoising(Mat src,
Mat dst)
Perform image denoising using Non-local Means Denoising algorithm
<http://www.ipol.im/pub/algo/bcm_non_local_means_denoising/> with several computational
optimizations.
|
static void |
fastNlMeansDenoising(Mat src,
Mat dst,
float h)
Perform image denoising using Non-local Means Denoising algorithm
<http://www.ipol.im/pub/algo/bcm_non_local_means_denoising/> with several computational
optimizations.
|
static void |
fastNlMeansDenoising(Mat src,
Mat dst,
float h,
int templateWindowSize)
Perform image denoising using Non-local Means Denoising algorithm
<http://www.ipol.im/pub/algo/bcm_non_local_means_denoising/> with several computational
optimizations.
|
static void |
fastNlMeansDenoising(Mat src,
Mat dst,
float h,
int templateWindowSize,
int searchWindowSize)
Perform image denoising using Non-local Means Denoising algorithm
<http://www.ipol.im/pub/algo/bcm_non_local_means_denoising/> with several computational
optimizations.
|
static void |
fastNlMeansDenoising(Mat src,
Mat dst,
MatOfFloat h)
Perform image denoising using Non-local Means Denoising algorithm
<http://www.ipol.im/pub/algo/bcm_non_local_means_denoising/> with several computational
optimizations.
|
static void |
fastNlMeansDenoising(Mat src,
Mat dst,
MatOfFloat h,
int templateWindowSize)
Perform image denoising using Non-local Means Denoising algorithm
<http://www.ipol.im/pub/algo/bcm_non_local_means_denoising/> with several computational
optimizations.
|
static void |
fastNlMeansDenoising(Mat src,
Mat dst,
MatOfFloat h,
int templateWindowSize,
int searchWindowSize)
Perform image denoising using Non-local Means Denoising algorithm
<http://www.ipol.im/pub/algo/bcm_non_local_means_denoising/> with several computational
optimizations.
|
static void |
fastNlMeansDenoising(Mat src,
Mat dst,
MatOfFloat h,
int templateWindowSize,
int searchWindowSize,
int normType)
Perform image denoising using Non-local Means Denoising algorithm
<http://www.ipol.im/pub/algo/bcm_non_local_means_denoising/> with several computational
optimizations.
|
static void |
fastNlMeansDenoisingColored(Mat src,
Mat dst)
Modification of fastNlMeansDenoising function for colored images
|
static void |
fastNlMeansDenoisingColored(Mat src,
Mat dst,
float h)
Modification of fastNlMeansDenoising function for colored images
|
static void |
fastNlMeansDenoisingColored(Mat src,
Mat dst,
float h,
float hColor)
Modification of fastNlMeansDenoising function for colored images
|
static void |
fastNlMeansDenoisingColored(Mat src,
Mat dst,
float h,
float hColor,
int templateWindowSize)
Modification of fastNlMeansDenoising function for colored images
|
static void |
fastNlMeansDenoisingColored(Mat src,
Mat dst,
float h,
float hColor,
int templateWindowSize,
int searchWindowSize)
Modification of fastNlMeansDenoising function for colored images
|
static void |
fastNlMeansDenoisingColoredMulti(List<Mat> srcImgs,
Mat dst,
int imgToDenoiseIndex,
int temporalWindowSize)
Modification of fastNlMeansDenoisingMulti function for colored images sequences
|
static void |
fastNlMeansDenoisingColoredMulti(List<Mat> srcImgs,
Mat dst,
int imgToDenoiseIndex,
int temporalWindowSize,
float h)
Modification of fastNlMeansDenoisingMulti function for colored images sequences
|
static void |
fastNlMeansDenoisingColoredMulti(List<Mat> srcImgs,
Mat dst,
int imgToDenoiseIndex,
int temporalWindowSize,
float h,
float hColor)
Modification of fastNlMeansDenoisingMulti function for colored images sequences
|
static void |
fastNlMeansDenoisingColoredMulti(List<Mat> srcImgs,
Mat dst,
int imgToDenoiseIndex,
int temporalWindowSize,
float h,
float hColor,
int templateWindowSize)
Modification of fastNlMeansDenoisingMulti function for colored images sequences
|
static void |
fastNlMeansDenoisingColoredMulti(List<Mat> srcImgs,
Mat dst,
int imgToDenoiseIndex,
int temporalWindowSize,
float h,
float hColor,
int templateWindowSize,
int searchWindowSize)
Modification of fastNlMeansDenoisingMulti function for colored images sequences
|
static void |
fastNlMeansDenoisingMulti(List<Mat> srcImgs,
Mat dst,
int imgToDenoiseIndex,
int temporalWindowSize)
Modification of fastNlMeansDenoising function for images sequence where consecutive images have been
captured in small period of time.
|
static void |
fastNlMeansDenoisingMulti(List<Mat> srcImgs,
Mat dst,
int imgToDenoiseIndex,
int temporalWindowSize,
float h)
Modification of fastNlMeansDenoising function for images sequence where consecutive images have been
captured in small period of time.
|
static void |
fastNlMeansDenoisingMulti(List<Mat> srcImgs,
Mat dst,
int imgToDenoiseIndex,
int temporalWindowSize,
float h,
int templateWindowSize)
Modification of fastNlMeansDenoising function for images sequence where consecutive images have been
captured in small period of time.
|
static void |
fastNlMeansDenoisingMulti(List<Mat> srcImgs,
Mat dst,
int imgToDenoiseIndex,
int temporalWindowSize,
float h,
int templateWindowSize,
int searchWindowSize)
Modification of fastNlMeansDenoising function for images sequence where consecutive images have been
captured in small period of time.
|
static void |
fastNlMeansDenoisingMulti(List<Mat> srcImgs,
Mat dst,
int imgToDenoiseIndex,
int temporalWindowSize,
MatOfFloat h)
Modification of fastNlMeansDenoising function for images sequence where consecutive images have been
captured in small period of time.
|
static void |
fastNlMeansDenoisingMulti(List<Mat> srcImgs,
Mat dst,
int imgToDenoiseIndex,
int temporalWindowSize,
MatOfFloat h,
int templateWindowSize)
Modification of fastNlMeansDenoising function for images sequence where consecutive images have been
captured in small period of time.
|
static void |
fastNlMeansDenoisingMulti(List<Mat> srcImgs,
Mat dst,
int imgToDenoiseIndex,
int temporalWindowSize,
MatOfFloat h,
int templateWindowSize,
int searchWindowSize)
Modification of fastNlMeansDenoising function for images sequence where consecutive images have been
captured in small period of time.
|
static void |
fastNlMeansDenoisingMulti(List<Mat> srcImgs,
Mat dst,
int imgToDenoiseIndex,
int temporalWindowSize,
MatOfFloat h,
int templateWindowSize,
int searchWindowSize,
int normType)
Modification of fastNlMeansDenoising function for images sequence where consecutive images have been
captured in small period of time.
|
static void |
illuminationChange(Mat src,
Mat mask,
Mat dst)
Applying an appropriate non-linear transformation to the gradient field inside the selection and
then integrating back with a Poisson solver, modifies locally the apparent illumination of an image.
|
static void |
illuminationChange(Mat src,
Mat mask,
Mat dst,
float alpha)
Applying an appropriate non-linear transformation to the gradient field inside the selection and
then integrating back with a Poisson solver, modifies locally the apparent illumination of an image.
|
static void |
illuminationChange(Mat src,
Mat mask,
Mat dst,
float alpha,
float beta)
Applying an appropriate non-linear transformation to the gradient field inside the selection and
then integrating back with a Poisson solver, modifies locally the apparent illumination of an image.
|
static void |
inpaint(Mat src,
Mat inpaintMask,
Mat dst,
double inpaintRadius,
int flags)
Restores the selected region in an image using the region neighborhood.
|
static void |
pencilSketch(Mat src,
Mat dst1,
Mat dst2)
Pencil-like non-photorealistic line drawing
|
static void |
pencilSketch(Mat src,
Mat dst1,
Mat dst2,
float sigma_s)
Pencil-like non-photorealistic line drawing
|
static void |
pencilSketch(Mat src,
Mat dst1,
Mat dst2,
float sigma_s,
float sigma_r)
Pencil-like non-photorealistic line drawing
|
static void |
pencilSketch(Mat src,
Mat dst1,
Mat dst2,
float sigma_s,
float sigma_r,
float shade_factor)
Pencil-like non-photorealistic line drawing
|
static void |
seamlessClone(Mat src,
Mat dst,
Mat mask,
Point p,
Mat blend,
int flags)
Image editing tasks concern either global changes (color/intensity corrections, filters,
deformations) or local changes concerned to a selection.
|
static void |
stylization(Mat src,
Mat dst)
Stylization aims to produce digital imagery with a wide variety of effects not focused on
photorealism.
|
static void |
stylization(Mat src,
Mat dst,
float sigma_s)
Stylization aims to produce digital imagery with a wide variety of effects not focused on
photorealism.
|
static void |
stylization(Mat src,
Mat dst,
float sigma_s,
float sigma_r)
Stylization aims to produce digital imagery with a wide variety of effects not focused on
photorealism.
|
static void |
textureFlattening(Mat src,
Mat mask,
Mat dst)
By retaining only the gradients at edge locations, before integrating with the Poisson solver, one
washes out the texture of the selected region, giving its contents a flat aspect.
|
static void |
textureFlattening(Mat src,
Mat mask,
Mat dst,
float low_threshold)
By retaining only the gradients at edge locations, before integrating with the Poisson solver, one
washes out the texture of the selected region, giving its contents a flat aspect.
|
static void |
textureFlattening(Mat src,
Mat mask,
Mat dst,
float low_threshold,
float high_threshold)
By retaining only the gradients at edge locations, before integrating with the Poisson solver, one
washes out the texture of the selected region, giving its contents a flat aspect.
|
static void |
textureFlattening(Mat src,
Mat mask,
Mat dst,
float low_threshold,
float high_threshold,
int kernel_size)
By retaining only the gradients at edge locations, before integrating with the Poisson solver, one
washes out the texture of the selected region, giving its contents a flat aspect.
|
public static final int INPAINT_NS
public static final int INPAINT_TELEA
public static final int LDR_SIZE
public static final int NORMAL_CLONE
public static final int MIXED_CLONE
public static final int MONOCHROME_TRANSFER
public static final int RECURS_FILTER
public static final int NORMCONV_FILTER
public static AlignMTB createAlignMTB(int max_bits, int exclude_range, boolean cut)
max_bits
- logarithm to the base 2 of maximal shift in each dimension. Values of 5 and 6 are
usually good enough (31 and 63 pixels shift respectively).exclude_range
- range for exclusion bitmap that is constructed to suppress noise around the
median value.cut
- if true cuts images, otherwise fills the new regions with zeros.public static AlignMTB createAlignMTB(int max_bits, int exclude_range)
max_bits
- logarithm to the base 2 of maximal shift in each dimension. Values of 5 and 6 are
usually good enough (31 and 63 pixels shift respectively).exclude_range
- range for exclusion bitmap that is constructed to suppress noise around the
median value.public static AlignMTB createAlignMTB(int max_bits)
max_bits
- logarithm to the base 2 of maximal shift in each dimension. Values of 5 and 6 are
usually good enough (31 and 63 pixels shift respectively).
median value.public static AlignMTB createAlignMTB()
public static CalibrateDebevec createCalibrateDebevec(int samples, float lambda, boolean random)
samples
- number of pixel locations to uselambda
- smoothness term weight. Greater values produce smoother results, but can alter the
response.random
- if true sample pixel locations are chosen at random, otherwise they form a
rectangular grid.public static CalibrateDebevec createCalibrateDebevec(int samples, float lambda)
samples
- number of pixel locations to uselambda
- smoothness term weight. Greater values produce smoother results, but can alter the
response.
rectangular grid.public static CalibrateDebevec createCalibrateDebevec(int samples)
samples
- number of pixel locations to use
response.
rectangular grid.public static CalibrateDebevec createCalibrateDebevec()
public static CalibrateRobertson createCalibrateRobertson(int max_iter, float threshold)
max_iter
- maximal number of Gauss-Seidel solver iterations.threshold
- target difference between results of two successive steps of the minimization.public static CalibrateRobertson createCalibrateRobertson(int max_iter)
max_iter
- maximal number of Gauss-Seidel solver iterations.public static CalibrateRobertson createCalibrateRobertson()
public static MergeDebevec createMergeDebevec()
public static MergeMertens createMergeMertens(float contrast_weight, float saturation_weight, float exposure_weight)
contrast_weight
- contrast measure weight. See MergeMertens.saturation_weight
- saturation measure weightexposure_weight
- well-exposedness measure weightpublic static MergeMertens createMergeMertens(float contrast_weight, float saturation_weight)
contrast_weight
- contrast measure weight. See MergeMertens.saturation_weight
- saturation measure weightpublic static MergeMertens createMergeMertens(float contrast_weight)
contrast_weight
- contrast measure weight. See MergeMertens.public static MergeMertens createMergeMertens()
public static MergeRobertson createMergeRobertson()
public static Tonemap createTonemap(float gamma)
gamma
- positive value for gamma correction. Gamma value of 1.0 implies no correction, gamma
equal to 2.2f is suitable for most displays.
Generally gamma > 1 brightens the image and gamma < 1 darkens it.public static Tonemap createTonemap()
public static TonemapDrago createTonemapDrago(float gamma, float saturation, float bias)
gamma
- gamma value for gamma correction. See createTonemapsaturation
- positive saturation enhancement value. 1.0 preserves saturation, values greater
than 1 increase saturation and values less than 1 decrease it.bias
- value for bias function in [0, 1] range. Values from 0.7 to 0.9 usually give best
results, default value is 0.85.public static TonemapDrago createTonemapDrago(float gamma, float saturation)
gamma
- gamma value for gamma correction. See createTonemapsaturation
- positive saturation enhancement value. 1.0 preserves saturation, values greater
than 1 increase saturation and values less than 1 decrease it.
results, default value is 0.85.public static TonemapDrago createTonemapDrago(float gamma)
gamma
- gamma value for gamma correction. See createTonemap
than 1 increase saturation and values less than 1 decrease it.
results, default value is 0.85.public static TonemapDrago createTonemapDrago()
public static TonemapMantiuk createTonemapMantiuk(float gamma, float scale, float saturation)
gamma
- gamma value for gamma correction. See createTonemapscale
- contrast scale factor. HVS response is multiplied by this parameter, thus compressing
dynamic range. Values from 0.6 to 0.9 produce best results.saturation
- saturation enhancement value. See createTonemapDragopublic static TonemapMantiuk createTonemapMantiuk(float gamma, float scale)
gamma
- gamma value for gamma correction. See createTonemapscale
- contrast scale factor. HVS response is multiplied by this parameter, thus compressing
dynamic range. Values from 0.6 to 0.9 produce best results.public static TonemapMantiuk createTonemapMantiuk(float gamma)
gamma
- gamma value for gamma correction. See createTonemap
dynamic range. Values from 0.6 to 0.9 produce best results.public static TonemapMantiuk createTonemapMantiuk()
public static TonemapReinhard createTonemapReinhard(float gamma, float intensity, float light_adapt, float color_adapt)
gamma
- gamma value for gamma correction. See createTonemapintensity
- result intensity in [-8, 8] range. Greater intensity produces brighter results.light_adapt
- light adaptation in [0, 1] range. If 1 adaptation is based only on pixel
value, if 0 it's global, otherwise it's a weighted mean of this two cases.color_adapt
- chromatic adaptation in [0, 1] range. If 1 channels are treated independently,
if 0 adaptation level is the same for each channel.public static TonemapReinhard createTonemapReinhard(float gamma, float intensity, float light_adapt)
gamma
- gamma value for gamma correction. See createTonemapintensity
- result intensity in [-8, 8] range. Greater intensity produces brighter results.light_adapt
- light adaptation in [0, 1] range. If 1 adaptation is based only on pixel
value, if 0 it's global, otherwise it's a weighted mean of this two cases.
if 0 adaptation level is the same for each channel.public static TonemapReinhard createTonemapReinhard(float gamma, float intensity)
gamma
- gamma value for gamma correction. See createTonemapintensity
- result intensity in [-8, 8] range. Greater intensity produces brighter results.
value, if 0 it's global, otherwise it's a weighted mean of this two cases.
if 0 adaptation level is the same for each channel.public static TonemapReinhard createTonemapReinhard(float gamma)
gamma
- gamma value for gamma correction. See createTonemap
value, if 0 it's global, otherwise it's a weighted mean of this two cases.
if 0 adaptation level is the same for each channel.public static TonemapReinhard createTonemapReinhard()
public static void colorChange(Mat src, Mat mask, Mat dst, float red_mul, float green_mul, float blue_mul)
src
- Input 8-bit 3-channel image.mask
- Input 8-bit 1 or 3-channel image.dst
- Output image with the same size and type as src .red_mul
- R-channel multiply factor.green_mul
- G-channel multiply factor.blue_mul
- B-channel multiply factor.
Multiplication factor is between .5 to 2.5.public static void colorChange(Mat src, Mat mask, Mat dst, float red_mul, float green_mul)
src
- Input 8-bit 3-channel image.mask
- Input 8-bit 1 or 3-channel image.dst
- Output image with the same size and type as src .red_mul
- R-channel multiply factor.green_mul
- G-channel multiply factor.
Multiplication factor is between .5 to 2.5.public static void colorChange(Mat src, Mat mask, Mat dst, float red_mul)
src
- Input 8-bit 3-channel image.mask
- Input 8-bit 1 or 3-channel image.dst
- Output image with the same size and type as src .red_mul
- R-channel multiply factor.
Multiplication factor is between .5 to 2.5.public static void colorChange(Mat src, Mat mask, Mat dst)
src
- Input 8-bit 3-channel image.mask
- Input 8-bit 1 or 3-channel image.dst
- Output image with the same size and type as src .
Multiplication factor is between .5 to 2.5.public static void decolor(Mat src, Mat grayscale, Mat color_boost)
src
- Input 8-bit 3-channel image.grayscale
- Output 8-bit 1-channel image.color_boost
- Output 8-bit 3-channel image.
This function is to be applied on color images.public static void denoise_TVL1(List<Mat> observations, Mat result, double lambda, int niters)
observations
- This array should contain one or more noised versions of the image that is to
be restored.result
- Here the denoised image will be stored. There is no need to do pre-allocation of
storage space, as it will be automatically allocated, if necessary.lambda
- Corresponds to \(\lambda\) in the formulas above. As it is enlarged, the smooth
(blurred) images are treated more favorably than detailed (but maybe more noised) ones. Roughly
speaking, as it becomes smaller, the result will be more blur but more sever outliers will be
removed.niters
- Number of iterations that the algorithm will run. Of course, as more iterations as
better, but it is hard to quantitatively refine this statement, so just use the default and
increase it if the results are poor.public static void denoise_TVL1(List<Mat> observations, Mat result, double lambda)
observations
- This array should contain one or more noised versions of the image that is to
be restored.result
- Here the denoised image will be stored. There is no need to do pre-allocation of
storage space, as it will be automatically allocated, if necessary.lambda
- Corresponds to \(\lambda\) in the formulas above. As it is enlarged, the smooth
(blurred) images are treated more favorably than detailed (but maybe more noised) ones. Roughly
speaking, as it becomes smaller, the result will be more blur but more sever outliers will be
removed.
better, but it is hard to quantitatively refine this statement, so just use the default and
increase it if the results are poor.public static void denoise_TVL1(List<Mat> observations, Mat result)
observations
- This array should contain one or more noised versions of the image that is to
be restored.result
- Here the denoised image will be stored. There is no need to do pre-allocation of
storage space, as it will be automatically allocated, if necessary.
(blurred) images are treated more favorably than detailed (but maybe more noised) ones. Roughly
speaking, as it becomes smaller, the result will be more blur but more sever outliers will be
removed.
better, but it is hard to quantitatively refine this statement, so just use the default and
increase it if the results are poor.public static void detailEnhance(Mat src, Mat dst, float sigma_s, float sigma_r)
src
- Input 8-bit 3-channel image.dst
- Output image with the same size and type as src.sigma_s
- %Range between 0 to 200.sigma_r
- %Range between 0 to 1.public static void detailEnhance(Mat src, Mat dst, float sigma_s)
src
- Input 8-bit 3-channel image.dst
- Output image with the same size and type as src.sigma_s
- %Range between 0 to 200.public static void detailEnhance(Mat src, Mat dst)
src
- Input 8-bit 3-channel image.dst
- Output image with the same size and type as src.public static void edgePreservingFilter(Mat src, Mat dst, int flags, float sigma_s, float sigma_r)
src
- Input 8-bit 3-channel image.dst
- Output 8-bit 3-channel image.flags
- Edge preserving filters: cv::RECURS_FILTER or cv::NORMCONV_FILTERsigma_s
- %Range between 0 to 200.sigma_r
- %Range between 0 to 1.public static void edgePreservingFilter(Mat src, Mat dst, int flags, float sigma_s)
src
- Input 8-bit 3-channel image.dst
- Output 8-bit 3-channel image.flags
- Edge preserving filters: cv::RECURS_FILTER or cv::NORMCONV_FILTERsigma_s
- %Range between 0 to 200.public static void edgePreservingFilter(Mat src, Mat dst, int flags)
src
- Input 8-bit 3-channel image.dst
- Output 8-bit 3-channel image.flags
- Edge preserving filters: cv::RECURS_FILTER or cv::NORMCONV_FILTERpublic static void edgePreservingFilter(Mat src, Mat dst)
src
- Input 8-bit 3-channel image.dst
- Output 8-bit 3-channel image.public static void fastNlMeansDenoising(Mat src, Mat dst, float h, int templateWindowSize, int searchWindowSize)
src
- Input 8-bit 1-channel, 2-channel, 3-channel or 4-channel image.dst
- Output image with the same size and type as src .templateWindowSize
- Size in pixels of the template patch that is used to compute weights.
Should be odd. Recommended value 7 pixelssearchWindowSize
- Size in pixels of the window that is used to compute weighted average for
given pixel. Should be odd. Affect performance linearly: greater searchWindowsSize - greater
denoising time. Recommended value 21 pixelsh
- Parameter regulating filter strength. Big h value perfectly removes noise but also
removes image details, smaller h value preserves details but also preserves some noise
This function expected to be applied to grayscale images. For colored images look at
fastNlMeansDenoisingColored. Advanced usage of this functions can be manual denoising of colored
image in different colorspaces. Such approach is used in fastNlMeansDenoisingColored by converting
image to CIELAB colorspace and then separately denoise L and AB components with different h
parameter.public static void fastNlMeansDenoising(Mat src, Mat dst, float h, int templateWindowSize)
src
- Input 8-bit 1-channel, 2-channel, 3-channel or 4-channel image.dst
- Output image with the same size and type as src .templateWindowSize
- Size in pixels of the template patch that is used to compute weights.
Should be odd. Recommended value 7 pixels
given pixel. Should be odd. Affect performance linearly: greater searchWindowsSize - greater
denoising time. Recommended value 21 pixelsh
- Parameter regulating filter strength. Big h value perfectly removes noise but also
removes image details, smaller h value preserves details but also preserves some noise
This function expected to be applied to grayscale images. For colored images look at
fastNlMeansDenoisingColored. Advanced usage of this functions can be manual denoising of colored
image in different colorspaces. Such approach is used in fastNlMeansDenoisingColored by converting
image to CIELAB colorspace and then separately denoise L and AB components with different h
parameter.public static void fastNlMeansDenoising(Mat src, Mat dst, float h)
src
- Input 8-bit 1-channel, 2-channel, 3-channel or 4-channel image.dst
- Output image with the same size and type as src .
Should be odd. Recommended value 7 pixels
given pixel. Should be odd. Affect performance linearly: greater searchWindowsSize - greater
denoising time. Recommended value 21 pixelsh
- Parameter regulating filter strength. Big h value perfectly removes noise but also
removes image details, smaller h value preserves details but also preserves some noise
This function expected to be applied to grayscale images. For colored images look at
fastNlMeansDenoisingColored. Advanced usage of this functions can be manual denoising of colored
image in different colorspaces. Such approach is used in fastNlMeansDenoisingColored by converting
image to CIELAB colorspace and then separately denoise L and AB components with different h
parameter.public static void fastNlMeansDenoising(Mat src, Mat dst)
src
- Input 8-bit 1-channel, 2-channel, 3-channel or 4-channel image.dst
- Output image with the same size and type as src .
Should be odd. Recommended value 7 pixels
given pixel. Should be odd. Affect performance linearly: greater searchWindowsSize - greater
denoising time. Recommended value 21 pixels
removes image details, smaller h value preserves details but also preserves some noise
This function expected to be applied to grayscale images. For colored images look at
fastNlMeansDenoisingColored. Advanced usage of this functions can be manual denoising of colored
image in different colorspaces. Such approach is used in fastNlMeansDenoisingColored by converting
image to CIELAB colorspace and then separately denoise L and AB components with different h
parameter.public static void fastNlMeansDenoising(Mat src, Mat dst, MatOfFloat h, int templateWindowSize, int searchWindowSize, int normType)
src
- Input 8-bit or 16-bit (only with NORM_L1) 1-channel,
2-channel, 3-channel or 4-channel image.dst
- Output image with the same size and type as src .templateWindowSize
- Size in pixels of the template patch that is used to compute weights.
Should be odd. Recommended value 7 pixelssearchWindowSize
- Size in pixels of the window that is used to compute weighted average for
given pixel. Should be odd. Affect performance linearly: greater searchWindowsSize - greater
denoising time. Recommended value 21 pixelsh
- Array of parameters regulating filter strength, either one
parameter applied to all channels or one per channel in dst. Big h value
perfectly removes noise but also removes image details, smaller h
value preserves details but also preserves some noisenormType
- Type of norm used for weight calculation. Can be either NORM_L2 or NORM_L1
This function expected to be applied to grayscale images. For colored images look at
fastNlMeansDenoisingColored. Advanced usage of this functions can be manual denoising of colored
image in different colorspaces. Such approach is used in fastNlMeansDenoisingColored by converting
image to CIELAB colorspace and then separately denoise L and AB components with different h
parameter.public static void fastNlMeansDenoising(Mat src, Mat dst, MatOfFloat h, int templateWindowSize, int searchWindowSize)
src
- Input 8-bit or 16-bit (only with NORM_L1) 1-channel,
2-channel, 3-channel or 4-channel image.dst
- Output image with the same size and type as src .templateWindowSize
- Size in pixels of the template patch that is used to compute weights.
Should be odd. Recommended value 7 pixelssearchWindowSize
- Size in pixels of the window that is used to compute weighted average for
given pixel. Should be odd. Affect performance linearly: greater searchWindowsSize - greater
denoising time. Recommended value 21 pixelsh
- Array of parameters regulating filter strength, either one
parameter applied to all channels or one per channel in dst. Big h value
perfectly removes noise but also removes image details, smaller h
value preserves details but also preserves some noise
This function expected to be applied to grayscale images. For colored images look at
fastNlMeansDenoisingColored. Advanced usage of this functions can be manual denoising of colored
image in different colorspaces. Such approach is used in fastNlMeansDenoisingColored by converting
image to CIELAB colorspace and then separately denoise L and AB components with different h
parameter.public static void fastNlMeansDenoising(Mat src, Mat dst, MatOfFloat h, int templateWindowSize)
src
- Input 8-bit or 16-bit (only with NORM_L1) 1-channel,
2-channel, 3-channel or 4-channel image.dst
- Output image with the same size and type as src .templateWindowSize
- Size in pixels of the template patch that is used to compute weights.
Should be odd. Recommended value 7 pixels
given pixel. Should be odd. Affect performance linearly: greater searchWindowsSize - greater
denoising time. Recommended value 21 pixelsh
- Array of parameters regulating filter strength, either one
parameter applied to all channels or one per channel in dst. Big h value
perfectly removes noise but also removes image details, smaller h
value preserves details but also preserves some noise
This function expected to be applied to grayscale images. For colored images look at
fastNlMeansDenoisingColored. Advanced usage of this functions can be manual denoising of colored
image in different colorspaces. Such approach is used in fastNlMeansDenoisingColored by converting
image to CIELAB colorspace and then separately denoise L and AB components with different h
parameter.public static void fastNlMeansDenoising(Mat src, Mat dst, MatOfFloat h)
src
- Input 8-bit or 16-bit (only with NORM_L1) 1-channel,
2-channel, 3-channel or 4-channel image.dst
- Output image with the same size and type as src .
Should be odd. Recommended value 7 pixels
given pixel. Should be odd. Affect performance linearly: greater searchWindowsSize - greater
denoising time. Recommended value 21 pixelsh
- Array of parameters regulating filter strength, either one
parameter applied to all channels or one per channel in dst. Big h value
perfectly removes noise but also removes image details, smaller h
value preserves details but also preserves some noise
This function expected to be applied to grayscale images. For colored images look at
fastNlMeansDenoisingColored. Advanced usage of this functions can be manual denoising of colored
image in different colorspaces. Such approach is used in fastNlMeansDenoisingColored by converting
image to CIELAB colorspace and then separately denoise L and AB components with different h
parameter.public static void fastNlMeansDenoisingColored(Mat src, Mat dst, float h, float hColor, int templateWindowSize, int searchWindowSize)
src
- Input 8-bit 3-channel image.dst
- Output image with the same size and type as src .templateWindowSize
- Size in pixels of the template patch that is used to compute weights.
Should be odd. Recommended value 7 pixelssearchWindowSize
- Size in pixels of the window that is used to compute weighted average for
given pixel. Should be odd. Affect performance linearly: greater searchWindowsSize - greater
denoising time. Recommended value 21 pixelsh
- Parameter regulating filter strength for luminance component. Bigger h value perfectly
removes noise but also removes image details, smaller h value preserves details but also preserves
some noisehColor
- The same as h but for color components. For most images value equals 10
will be enough to remove colored noise and do not distort colors
The function converts image to CIELAB colorspace and then separately denoise L and AB components
with given h parameters using fastNlMeansDenoising function.public static void fastNlMeansDenoisingColored(Mat src, Mat dst, float h, float hColor, int templateWindowSize)
src
- Input 8-bit 3-channel image.dst
- Output image with the same size and type as src .templateWindowSize
- Size in pixels of the template patch that is used to compute weights.
Should be odd. Recommended value 7 pixels
given pixel. Should be odd. Affect performance linearly: greater searchWindowsSize - greater
denoising time. Recommended value 21 pixelsh
- Parameter regulating filter strength for luminance component. Bigger h value perfectly
removes noise but also removes image details, smaller h value preserves details but also preserves
some noisehColor
- The same as h but for color components. For most images value equals 10
will be enough to remove colored noise and do not distort colors
The function converts image to CIELAB colorspace and then separately denoise L and AB components
with given h parameters using fastNlMeansDenoising function.public static void fastNlMeansDenoisingColored(Mat src, Mat dst, float h, float hColor)
src
- Input 8-bit 3-channel image.dst
- Output image with the same size and type as src .
Should be odd. Recommended value 7 pixels
given pixel. Should be odd. Affect performance linearly: greater searchWindowsSize - greater
denoising time. Recommended value 21 pixelsh
- Parameter regulating filter strength for luminance component. Bigger h value perfectly
removes noise but also removes image details, smaller h value preserves details but also preserves
some noisehColor
- The same as h but for color components. For most images value equals 10
will be enough to remove colored noise and do not distort colors
The function converts image to CIELAB colorspace and then separately denoise L and AB components
with given h parameters using fastNlMeansDenoising function.public static void fastNlMeansDenoisingColored(Mat src, Mat dst, float h)
src
- Input 8-bit 3-channel image.dst
- Output image with the same size and type as src .
Should be odd. Recommended value 7 pixels
given pixel. Should be odd. Affect performance linearly: greater searchWindowsSize - greater
denoising time. Recommended value 21 pixelsh
- Parameter regulating filter strength for luminance component. Bigger h value perfectly
removes noise but also removes image details, smaller h value preserves details but also preserves
some noise
will be enough to remove colored noise and do not distort colors
The function converts image to CIELAB colorspace and then separately denoise L and AB components
with given h parameters using fastNlMeansDenoising function.public static void fastNlMeansDenoisingColored(Mat src, Mat dst)
src
- Input 8-bit 3-channel image.dst
- Output image with the same size and type as src .
Should be odd. Recommended value 7 pixels
given pixel. Should be odd. Affect performance linearly: greater searchWindowsSize - greater
denoising time. Recommended value 21 pixels
removes noise but also removes image details, smaller h value preserves details but also preserves
some noise
will be enough to remove colored noise and do not distort colors
The function converts image to CIELAB colorspace and then separately denoise L and AB components
with given h parameters using fastNlMeansDenoising function.public static void fastNlMeansDenoisingColoredMulti(List<Mat> srcImgs, Mat dst, int imgToDenoiseIndex, int temporalWindowSize, float h, float hColor, int templateWindowSize, int searchWindowSize)
srcImgs
- Input 8-bit 3-channel images sequence. All images should have the same type and
size.imgToDenoiseIndex
- Target image to denoise index in srcImgs sequencetemporalWindowSize
- Number of surrounding images to use for target image denoising. Should
be odd. Images from imgToDenoiseIndex - temporalWindowSize / 2 to
imgToDenoiseIndex - temporalWindowSize / 2 from srcImgs will be used to denoise
srcImgs[imgToDenoiseIndex] image.dst
- Output image with the same size and type as srcImgs images.templateWindowSize
- Size in pixels of the template patch that is used to compute weights.
Should be odd. Recommended value 7 pixelssearchWindowSize
- Size in pixels of the window that is used to compute weighted average for
given pixel. Should be odd. Affect performance linearly: greater searchWindowsSize - greater
denoising time. Recommended value 21 pixelsh
- Parameter regulating filter strength for luminance component. Bigger h value perfectly
removes noise but also removes image details, smaller h value preserves details but also preserves
some noise.hColor
- The same as h but for color components.
The function converts images to CIELAB colorspace and then separately denoise L and AB components
with given h parameters using fastNlMeansDenoisingMulti function.public static void fastNlMeansDenoisingColoredMulti(List<Mat> srcImgs, Mat dst, int imgToDenoiseIndex, int temporalWindowSize, float h, float hColor, int templateWindowSize)
srcImgs
- Input 8-bit 3-channel images sequence. All images should have the same type and
size.imgToDenoiseIndex
- Target image to denoise index in srcImgs sequencetemporalWindowSize
- Number of surrounding images to use for target image denoising. Should
be odd. Images from imgToDenoiseIndex - temporalWindowSize / 2 to
imgToDenoiseIndex - temporalWindowSize / 2 from srcImgs will be used to denoise
srcImgs[imgToDenoiseIndex] image.dst
- Output image with the same size and type as srcImgs images.templateWindowSize
- Size in pixels of the template patch that is used to compute weights.
Should be odd. Recommended value 7 pixels
given pixel. Should be odd. Affect performance linearly: greater searchWindowsSize - greater
denoising time. Recommended value 21 pixelsh
- Parameter regulating filter strength for luminance component. Bigger h value perfectly
removes noise but also removes image details, smaller h value preserves details but also preserves
some noise.hColor
- The same as h but for color components.
The function converts images to CIELAB colorspace and then separately denoise L and AB components
with given h parameters using fastNlMeansDenoisingMulti function.public static void fastNlMeansDenoisingColoredMulti(List<Mat> srcImgs, Mat dst, int imgToDenoiseIndex, int temporalWindowSize, float h, float hColor)
srcImgs
- Input 8-bit 3-channel images sequence. All images should have the same type and
size.imgToDenoiseIndex
- Target image to denoise index in srcImgs sequencetemporalWindowSize
- Number of surrounding images to use for target image denoising. Should
be odd. Images from imgToDenoiseIndex - temporalWindowSize / 2 to
imgToDenoiseIndex - temporalWindowSize / 2 from srcImgs will be used to denoise
srcImgs[imgToDenoiseIndex] image.dst
- Output image with the same size and type as srcImgs images.
Should be odd. Recommended value 7 pixels
given pixel. Should be odd. Affect performance linearly: greater searchWindowsSize - greater
denoising time. Recommended value 21 pixelsh
- Parameter regulating filter strength for luminance component. Bigger h value perfectly
removes noise but also removes image details, smaller h value preserves details but also preserves
some noise.hColor
- The same as h but for color components.
The function converts images to CIELAB colorspace and then separately denoise L and AB components
with given h parameters using fastNlMeansDenoisingMulti function.public static void fastNlMeansDenoisingColoredMulti(List<Mat> srcImgs, Mat dst, int imgToDenoiseIndex, int temporalWindowSize, float h)
srcImgs
- Input 8-bit 3-channel images sequence. All images should have the same type and
size.imgToDenoiseIndex
- Target image to denoise index in srcImgs sequencetemporalWindowSize
- Number of surrounding images to use for target image denoising. Should
be odd. Images from imgToDenoiseIndex - temporalWindowSize / 2 to
imgToDenoiseIndex - temporalWindowSize / 2 from srcImgs will be used to denoise
srcImgs[imgToDenoiseIndex] image.dst
- Output image with the same size and type as srcImgs images.
Should be odd. Recommended value 7 pixels
given pixel. Should be odd. Affect performance linearly: greater searchWindowsSize - greater
denoising time. Recommended value 21 pixelsh
- Parameter regulating filter strength for luminance component. Bigger h value perfectly
removes noise but also removes image details, smaller h value preserves details but also preserves
some noise.
The function converts images to CIELAB colorspace and then separately denoise L and AB components
with given h parameters using fastNlMeansDenoisingMulti function.public static void fastNlMeansDenoisingColoredMulti(List<Mat> srcImgs, Mat dst, int imgToDenoiseIndex, int temporalWindowSize)
srcImgs
- Input 8-bit 3-channel images sequence. All images should have the same type and
size.imgToDenoiseIndex
- Target image to denoise index in srcImgs sequencetemporalWindowSize
- Number of surrounding images to use for target image denoising. Should
be odd. Images from imgToDenoiseIndex - temporalWindowSize / 2 to
imgToDenoiseIndex - temporalWindowSize / 2 from srcImgs will be used to denoise
srcImgs[imgToDenoiseIndex] image.dst
- Output image with the same size and type as srcImgs images.
Should be odd. Recommended value 7 pixels
given pixel. Should be odd. Affect performance linearly: greater searchWindowsSize - greater
denoising time. Recommended value 21 pixels
removes noise but also removes image details, smaller h value preserves details but also preserves
some noise.
The function converts images to CIELAB colorspace and then separately denoise L and AB components
with given h parameters using fastNlMeansDenoisingMulti function.public static void fastNlMeansDenoisingMulti(List<Mat> srcImgs, Mat dst, int imgToDenoiseIndex, int temporalWindowSize, float h, int templateWindowSize, int searchWindowSize)
srcImgs
- Input 8-bit 1-channel, 2-channel, 3-channel or
4-channel images sequence. All images should have the same type and
size.imgToDenoiseIndex
- Target image to denoise index in srcImgs sequencetemporalWindowSize
- Number of surrounding images to use for target image denoising. Should
be odd. Images from imgToDenoiseIndex - temporalWindowSize / 2 to
imgToDenoiseIndex - temporalWindowSize / 2 from srcImgs will be used to denoise
srcImgs[imgToDenoiseIndex] image.dst
- Output image with the same size and type as srcImgs images.templateWindowSize
- Size in pixels of the template patch that is used to compute weights.
Should be odd. Recommended value 7 pixelssearchWindowSize
- Size in pixels of the window that is used to compute weighted average for
given pixel. Should be odd. Affect performance linearly: greater searchWindowsSize - greater
denoising time. Recommended value 21 pixelsh
- Parameter regulating filter strength. Bigger h value
perfectly removes noise but also removes image details, smaller h
value preserves details but also preserves some noisepublic static void fastNlMeansDenoisingMulti(List<Mat> srcImgs, Mat dst, int imgToDenoiseIndex, int temporalWindowSize, float h, int templateWindowSize)
srcImgs
- Input 8-bit 1-channel, 2-channel, 3-channel or
4-channel images sequence. All images should have the same type and
size.imgToDenoiseIndex
- Target image to denoise index in srcImgs sequencetemporalWindowSize
- Number of surrounding images to use for target image denoising. Should
be odd. Images from imgToDenoiseIndex - temporalWindowSize / 2 to
imgToDenoiseIndex - temporalWindowSize / 2 from srcImgs will be used to denoise
srcImgs[imgToDenoiseIndex] image.dst
- Output image with the same size and type as srcImgs images.templateWindowSize
- Size in pixels of the template patch that is used to compute weights.
Should be odd. Recommended value 7 pixels
given pixel. Should be odd. Affect performance linearly: greater searchWindowsSize - greater
denoising time. Recommended value 21 pixelsh
- Parameter regulating filter strength. Bigger h value
perfectly removes noise but also removes image details, smaller h
value preserves details but also preserves some noisepublic static void fastNlMeansDenoisingMulti(List<Mat> srcImgs, Mat dst, int imgToDenoiseIndex, int temporalWindowSize, float h)
srcImgs
- Input 8-bit 1-channel, 2-channel, 3-channel or
4-channel images sequence. All images should have the same type and
size.imgToDenoiseIndex
- Target image to denoise index in srcImgs sequencetemporalWindowSize
- Number of surrounding images to use for target image denoising. Should
be odd. Images from imgToDenoiseIndex - temporalWindowSize / 2 to
imgToDenoiseIndex - temporalWindowSize / 2 from srcImgs will be used to denoise
srcImgs[imgToDenoiseIndex] image.dst
- Output image with the same size and type as srcImgs images.
Should be odd. Recommended value 7 pixels
given pixel. Should be odd. Affect performance linearly: greater searchWindowsSize - greater
denoising time. Recommended value 21 pixelsh
- Parameter regulating filter strength. Bigger h value
perfectly removes noise but also removes image details, smaller h
value preserves details but also preserves some noisepublic static void fastNlMeansDenoisingMulti(List<Mat> srcImgs, Mat dst, int imgToDenoiseIndex, int temporalWindowSize)
srcImgs
- Input 8-bit 1-channel, 2-channel, 3-channel or
4-channel images sequence. All images should have the same type and
size.imgToDenoiseIndex
- Target image to denoise index in srcImgs sequencetemporalWindowSize
- Number of surrounding images to use for target image denoising. Should
be odd. Images from imgToDenoiseIndex - temporalWindowSize / 2 to
imgToDenoiseIndex - temporalWindowSize / 2 from srcImgs will be used to denoise
srcImgs[imgToDenoiseIndex] image.dst
- Output image with the same size and type as srcImgs images.
Should be odd. Recommended value 7 pixels
given pixel. Should be odd. Affect performance linearly: greater searchWindowsSize - greater
denoising time. Recommended value 21 pixels
perfectly removes noise but also removes image details, smaller h
value preserves details but also preserves some noisepublic static void fastNlMeansDenoisingMulti(List<Mat> srcImgs, Mat dst, int imgToDenoiseIndex, int temporalWindowSize, MatOfFloat h, int templateWindowSize, int searchWindowSize, int normType)
srcImgs
- Input 8-bit or 16-bit (only with NORM_L1) 1-channel,
2-channel, 3-channel or 4-channel images sequence. All images should
have the same type and size.imgToDenoiseIndex
- Target image to denoise index in srcImgs sequencetemporalWindowSize
- Number of surrounding images to use for target image denoising. Should
be odd. Images from imgToDenoiseIndex - temporalWindowSize / 2 to
imgToDenoiseIndex - temporalWindowSize / 2 from srcImgs will be used to denoise
srcImgs[imgToDenoiseIndex] image.dst
- Output image with the same size and type as srcImgs images.templateWindowSize
- Size in pixels of the template patch that is used to compute weights.
Should be odd. Recommended value 7 pixelssearchWindowSize
- Size in pixels of the window that is used to compute weighted average for
given pixel. Should be odd. Affect performance linearly: greater searchWindowsSize - greater
denoising time. Recommended value 21 pixelsh
- Array of parameters regulating filter strength, either one
parameter applied to all channels or one per channel in dst. Big h value
perfectly removes noise but also removes image details, smaller h
value preserves details but also preserves some noisenormType
- Type of norm used for weight calculation. Can be either NORM_L2 or NORM_L1public static void fastNlMeansDenoisingMulti(List<Mat> srcImgs, Mat dst, int imgToDenoiseIndex, int temporalWindowSize, MatOfFloat h, int templateWindowSize, int searchWindowSize)
srcImgs
- Input 8-bit or 16-bit (only with NORM_L1) 1-channel,
2-channel, 3-channel or 4-channel images sequence. All images should
have the same type and size.imgToDenoiseIndex
- Target image to denoise index in srcImgs sequencetemporalWindowSize
- Number of surrounding images to use for target image denoising. Should
be odd. Images from imgToDenoiseIndex - temporalWindowSize / 2 to
imgToDenoiseIndex - temporalWindowSize / 2 from srcImgs will be used to denoise
srcImgs[imgToDenoiseIndex] image.dst
- Output image with the same size and type as srcImgs images.templateWindowSize
- Size in pixels of the template patch that is used to compute weights.
Should be odd. Recommended value 7 pixelssearchWindowSize
- Size in pixels of the window that is used to compute weighted average for
given pixel. Should be odd. Affect performance linearly: greater searchWindowsSize - greater
denoising time. Recommended value 21 pixelsh
- Array of parameters regulating filter strength, either one
parameter applied to all channels or one per channel in dst. Big h value
perfectly removes noise but also removes image details, smaller h
value preserves details but also preserves some noisepublic static void fastNlMeansDenoisingMulti(List<Mat> srcImgs, Mat dst, int imgToDenoiseIndex, int temporalWindowSize, MatOfFloat h, int templateWindowSize)
srcImgs
- Input 8-bit or 16-bit (only with NORM_L1) 1-channel,
2-channel, 3-channel or 4-channel images sequence. All images should
have the same type and size.imgToDenoiseIndex
- Target image to denoise index in srcImgs sequencetemporalWindowSize
- Number of surrounding images to use for target image denoising. Should
be odd. Images from imgToDenoiseIndex - temporalWindowSize / 2 to
imgToDenoiseIndex - temporalWindowSize / 2 from srcImgs will be used to denoise
srcImgs[imgToDenoiseIndex] image.dst
- Output image with the same size and type as srcImgs images.templateWindowSize
- Size in pixels of the template patch that is used to compute weights.
Should be odd. Recommended value 7 pixels
given pixel. Should be odd. Affect performance linearly: greater searchWindowsSize - greater
denoising time. Recommended value 21 pixelsh
- Array of parameters regulating filter strength, either one
parameter applied to all channels or one per channel in dst. Big h value
perfectly removes noise but also removes image details, smaller h
value preserves details but also preserves some noisepublic static void fastNlMeansDenoisingMulti(List<Mat> srcImgs, Mat dst, int imgToDenoiseIndex, int temporalWindowSize, MatOfFloat h)
srcImgs
- Input 8-bit or 16-bit (only with NORM_L1) 1-channel,
2-channel, 3-channel or 4-channel images sequence. All images should
have the same type and size.imgToDenoiseIndex
- Target image to denoise index in srcImgs sequencetemporalWindowSize
- Number of surrounding images to use for target image denoising. Should
be odd. Images from imgToDenoiseIndex - temporalWindowSize / 2 to
imgToDenoiseIndex - temporalWindowSize / 2 from srcImgs will be used to denoise
srcImgs[imgToDenoiseIndex] image.dst
- Output image with the same size and type as srcImgs images.
Should be odd. Recommended value 7 pixels
given pixel. Should be odd. Affect performance linearly: greater searchWindowsSize - greater
denoising time. Recommended value 21 pixelsh
- Array of parameters regulating filter strength, either one
parameter applied to all channels or one per channel in dst. Big h value
perfectly removes noise but also removes image details, smaller h
value preserves details but also preserves some noisepublic static void illuminationChange(Mat src, Mat mask, Mat dst, float alpha, float beta)
src
- Input 8-bit 3-channel image.mask
- Input 8-bit 1 or 3-channel image.dst
- Output image with the same size and type as src.alpha
- Value ranges between 0-2.beta
- Value ranges between 0-2.
This is useful to highlight under-exposed foreground objects or to reduce specular reflections.public static void illuminationChange(Mat src, Mat mask, Mat dst, float alpha)
src
- Input 8-bit 3-channel image.mask
- Input 8-bit 1 or 3-channel image.dst
- Output image with the same size and type as src.alpha
- Value ranges between 0-2.
This is useful to highlight under-exposed foreground objects or to reduce specular reflections.public static void illuminationChange(Mat src, Mat mask, Mat dst)
src
- Input 8-bit 3-channel image.mask
- Input 8-bit 1 or 3-channel image.dst
- Output image with the same size and type as src.
This is useful to highlight under-exposed foreground objects or to reduce specular reflections.public static void inpaint(Mat src, Mat inpaintMask, Mat dst, double inpaintRadius, int flags)
src
- Input 8-bit, 16-bit unsigned or 32-bit float 1-channel or 8-bit 3-channel image.inpaintMask
- Inpainting mask, 8-bit 1-channel image. Non-zero pixels indicate the area that
needs to be inpainted.dst
- Output image with the same size and type as src .inpaintRadius
- Radius of a circular neighborhood of each point inpainted that is considered
by the algorithm.flags
- Inpainting method that could be cv::INPAINT_NS or cv::INPAINT_TELEA
The function reconstructs the selected image area from the pixel near the area boundary. The
function may be used to remove dust and scratches from a scanned photo, or to remove undesirable
objects from still images or video. See <http://en.wikipedia.org/wiki/Inpainting> for more details.
Note:
public static void pencilSketch(Mat src, Mat dst1, Mat dst2, float sigma_s, float sigma_r, float shade_factor)
src
- Input 8-bit 3-channel image.dst1
- Output 8-bit 1-channel image.dst2
- Output image with the same size and type as src.sigma_s
- %Range between 0 to 200.sigma_r
- %Range between 0 to 1.shade_factor
- %Range between 0 to 0.1.public static void pencilSketch(Mat src, Mat dst1, Mat dst2, float sigma_s, float sigma_r)
src
- Input 8-bit 3-channel image.dst1
- Output 8-bit 1-channel image.dst2
- Output image with the same size and type as src.sigma_s
- %Range between 0 to 200.sigma_r
- %Range between 0 to 1.public static void pencilSketch(Mat src, Mat dst1, Mat dst2, float sigma_s)
src
- Input 8-bit 3-channel image.dst1
- Output 8-bit 1-channel image.dst2
- Output image with the same size and type as src.sigma_s
- %Range between 0 to 200.public static void pencilSketch(Mat src, Mat dst1, Mat dst2)
src
- Input 8-bit 3-channel image.dst1
- Output 8-bit 1-channel image.dst2
- Output image with the same size and type as src.public static void seamlessClone(Mat src, Mat dst, Mat mask, Point p, Mat blend, int flags)
src
- Input 8-bit 3-channel image.dst
- Input 8-bit 3-channel image.mask
- Input 8-bit 1 or 3-channel image.p
- Point in dst image where object is placed.blend
- Output image with the same size and type as dst.flags
- Cloning method that could be cv::NORMAL_CLONE, cv::MIXED_CLONE or cv::MONOCHROME_TRANSFERpublic static void stylization(Mat src, Mat dst, float sigma_s, float sigma_r)
src
- Input 8-bit 3-channel image.dst
- Output image with the same size and type as src.sigma_s
- %Range between 0 to 200.sigma_r
- %Range between 0 to 1.public static void stylization(Mat src, Mat dst, float sigma_s)
src
- Input 8-bit 3-channel image.dst
- Output image with the same size and type as src.sigma_s
- %Range between 0 to 200.public static void stylization(Mat src, Mat dst)
src
- Input 8-bit 3-channel image.dst
- Output image with the same size and type as src.public static void textureFlattening(Mat src, Mat mask, Mat dst, float low_threshold, float high_threshold, int kernel_size)
src
- Input 8-bit 3-channel image.mask
- Input 8-bit 1 or 3-channel image.dst
- Output image with the same size and type as src.low_threshold
- %Range from 0 to 100.high_threshold
- Value > 100.kernel_size
- The size of the Sobel kernel to be used.
Note:
The algorithm assumes that the color of the source image is close to that of the destination. This
assumption means that when the colors don't match, the source image color gets tinted toward the
color of the destination image.public static void textureFlattening(Mat src, Mat mask, Mat dst, float low_threshold, float high_threshold)
src
- Input 8-bit 3-channel image.mask
- Input 8-bit 1 or 3-channel image.dst
- Output image with the same size and type as src.low_threshold
- %Range from 0 to 100.high_threshold
- Value > 100.
Note:
The algorithm assumes that the color of the source image is close to that of the destination. This
assumption means that when the colors don't match, the source image color gets tinted toward the
color of the destination image.public static void textureFlattening(Mat src, Mat mask, Mat dst, float low_threshold)
src
- Input 8-bit 3-channel image.mask
- Input 8-bit 1 or 3-channel image.dst
- Output image with the same size and type as src.low_threshold
- %Range from 0 to 100.
Note:
The algorithm assumes that the color of the source image is close to that of the destination. This
assumption means that when the colors don't match, the source image color gets tinted toward the
color of the destination image.public static void textureFlattening(Mat src, Mat mask, Mat dst)
src
- Input 8-bit 3-channel image.mask
- Input 8-bit 1 or 3-channel image.dst
- Output image with the same size and type as src.
Note:
The algorithm assumes that the color of the source image is close to that of the destination. This
assumption means that when the colors don't match, the source image color gets tinted toward the
color of the destination image.Copyright © 2020. All rights reserved.