@Namespace(value="cv::ccm") @NoOffset @Properties(inherit=opencv_mcc.class) public class ColorCorrectionModel extends Pointer
Produce a ColorCorrectionModel instance for inference
Modifier and Type | Class and Description |
---|---|
static class |
ColorCorrectionModel.Impl |
Pointer.CustomDeallocator, Pointer.Deallocator, Pointer.NativeDeallocator, Pointer.ReferenceCounter
Constructor and Description |
---|
ColorCorrectionModel(Mat src,
int constcolor)
\brief Color Correction Model
|
ColorCorrectionModel(Mat src,
Mat colors,
int ref_cs)
\brief Color Correction Model
|
ColorCorrectionModel(Mat src,
Mat colors,
int ref_cs,
Mat colored)
\brief Color Correction Model
|
ColorCorrectionModel(Pointer p)
Pointer cast constructor.
|
Modifier and Type | Method and Description |
---|---|
Mat |
get_dst_rgbl() |
Mat |
get_src_rgbl() |
Mat |
getCCM() |
double |
getLoss() |
Mat |
getMask() |
Mat |
getWeights() |
Mat |
infer(Mat img) |
Mat |
infer(Mat img,
boolean islinear)
\brief Infer using fitting ccm.
|
void |
run()
\brief make color correction
|
void |
setCCM_TYPE(int ccm_type)
\brief set ccm_type
|
void |
setColorSpace(int cs)
\brief set ColorSpace
\note It should be some RGB color space;
Supported list of color cards:
- \ref COLOR_SPACE_sRGB
- \ref COLOR_SPACE_AdobeRGB
- \ref COLOR_SPACE_WideGamutRGB
- \ref COLOR_SPACE_ProPhotoRGB
- \ref COLOR_SPACE_DCI_P3_RGB
- \ref COLOR_SPACE_AppleRGB
- \ref COLOR_SPACE_REC_709_RGB
- \ref COLOR_SPACE_REC_2020_RGB
|
void |
setDistance(int distance)
\brief set Distance
|
void |
setEpsilon(double epsilon)
\brief set Epsilon
|
void |
setInitialMethod(int initial_method_type)
\brief set InitialMethod
|
void |
setLinear(int linear_type)
\brief set Linear
|
void |
setLinearDegree(int deg)
\brief set degree
\note only valid when linear is set to
- \ref LINEARIZATION_COLORPOLYFIT
- \ref LINEARIZATION_GRAYPOLYFIT
- \ref LINEARIZATION_COLORLOGPOLYFIT
- \ref LINEARIZATION_GRAYLOGPOLYFIT
|
void |
setLinearGamma(double gamma)
\brief set Gamma
|
void |
setMaxCount(int max_count)
\brief set MaxCount
|
void |
setSaturatedThreshold(double lower,
double upper)
\brief set SaturatedThreshold.
|
void |
setWeightCoeff(double weights_coeff)
\brief set WeightCoeff
|
void |
setWeightsList(Mat weights_list)
\brief set WeightsList
|
address, asBuffer, asByteBuffer, availablePhysicalBytes, calloc, capacity, capacity, close, deallocate, deallocate, deallocateReferences, deallocator, deallocator, equals, fill, formatBytes, free, getDirectBufferAddress, getPointer, getPointer, getPointer, getPointer, hashCode, interruptDeallocatorThread, isNull, isNull, limit, limit, malloc, maxBytes, maxPhysicalBytes, memchr, memcmp, memcpy, memmove, memset, offsetAddress, offsetof, offsetof, parseBytes, physicalBytes, physicalBytesInaccurate, position, position, put, realloc, referenceCount, releaseReference, retainReference, setNull, sizeof, sizeof, toString, totalBytes, totalCount, totalPhysicalBytes, withDeallocator, zero
public ColorCorrectionModel(Pointer p)
Pointer(Pointer)
.public ColorCorrectionModel(@Const @ByRef Mat src, @Cast(value="cv::ccm::CONST_COLOR") int constcolor)
Supported list of color cards: - \ref COLORCHECKER_Macbeth, the Macbeth ColorChecker - \ref COLORCHECKER_Vinyl, the DKK ColorChecker - \ref COLORCHECKER_DigitalSG, the DigitalSG ColorChecker with 140 squares
src
- detected colors of ColorChecker patches;\n
the color type is RGB not BGR, and the color values are in [0, 1];constcolor
- the Built-in color cardpublic ColorCorrectionModel(@Const @ByRef Mat src, @ByVal Mat colors, @Cast(value="cv::ccm::COLOR_SPACE") int ref_cs)
src
- detected colors of ColorChecker patches;\n
the color type is RGB not BGR, and the color values are in [0, 1];colors
- the reference color values, the color values are in [0, 1].\nref_cs
- the corresponding color space
If the color type is some RGB, the format is RGB not BGR;\npublic ColorCorrectionModel(@Const @ByRef Mat src, @ByVal Mat colors, @Cast(value="cv::ccm::COLOR_SPACE") int ref_cs, @ByVal Mat colored)
src
- detected colors of ColorChecker patches;\n
the color type is RGB not BGR, and the color values are in [0, 1];colors
- the reference color values, the color values are in [0, 1].ref_cs
- the corresponding color space
If the color type is some RGB, the format is RGB not BGR;colored
- mask of colored colorpublic void setColorSpace(@Cast(value="cv::ccm::COLOR_SPACE") int cs)
cs
- the absolute color space that detected colors convert to;\n
default: \ref COLOR_SPACE_sRGBpublic void setCCM_TYPE(@Cast(value="cv::ccm::CCM_TYPE") int ccm_type)
ccm_type
- the shape of color correction matrix(CCM);\n
default: \ref CCM_3x3public void setDistance(@Cast(value="cv::ccm::DISTANCE_TYPE") int distance)
distance
- the type of color distance;\n
default: \ref DISTANCE_CIE2000public void setLinear(@Cast(value="cv::ccm::LINEAR_TYPE") int linear_type)
linear_type
- the method of linearization;\n
default: \ref LINEARIZATION_GAMMApublic void setLinearGamma(double gamma)
\note only valid when linear is set to "gamma";\n
gamma
- the gamma value of gamma correction;\n
default: 2.2;public void setLinearDegree(int deg)
deg
- the degree of linearization polynomial;\n
default: 3
public void setSaturatedThreshold(double lower, double upper)
lower
- the lower threshold to determine saturation;\n
default: 0;upper
- the upper threshold to determine saturation;\n
default: 0public void setWeightsList(@Const @ByRef Mat weights_list)
weights_list
- the list of weight of each color;\n
default: empty arraypublic void setWeightCoeff(double weights_coeff)
weights_coeff
- the exponent number of L* component of the reference color in CIE Lab color space;\n
default: 0public void setInitialMethod(@Cast(value="cv::ccm::INITIAL_METHOD_TYPE") int initial_method_type)
initial_method_type
- the method of calculating CCM initial value;\n
default: INITIAL_METHOD_LEAST_SQUAREpublic void setMaxCount(int max_count)
max_count
- used in MinProblemSolver-DownhillSolver;\n
Terminal criteria to the algorithm;\n
default: 5000;public void setEpsilon(double epsilon)
epsilon
- used in MinProblemSolver-DownhillSolver;\n
Terminal criteria to the algorithm;\n
default: 1e-4;public void run()
public double getLoss()
@ByVal public Mat infer(@Const @ByRef Mat img, @Cast(value="bool") boolean islinear)
img
- the input image.islinear
- default false.Copyright © 2024. All rights reserved.