Package qupath.opencv.ops
Class ImageOps.Core
java.lang.Object
qupath.opencv.ops.ImageOps.Core
- Enclosing class:
ImageOps
Core operations.
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic ImageOpadd(double... values) Add a constant to all pixels.static ImageOpceil()Create an op that ceils floating point values.static ImageOpclip(double min, double max) Create an op that clips Mat values to the specified minimum and maximum.static ImageOpdivide(double... values) Divide all pixels by a constant.static ImageOpensureType(PixelType type) Convert theMatto match a specified pixel type.static ImageOpexp()Create an op that returns Euler's number e raise to the power of the Mat values.static ImageOpfloor()Create an op that floors floating point values.static ImageOpidentity()Create an op that returns its input unchanged.static ImageOplog()Create an op that returns the natural logarithm of values.static ImageOpmultiply(double... values) Multiply all pixels by a constant.static ImageOppower(double value) Raise every pixel element to a power.static ImageOpreplace(double originalValue, double newValue) Create an op that replaces one pixel value in an image with another.static ImageOpreplaceNaNs(double replaceValue) Create an op that replaces NaNs with a specified value.static ImageOpround()Create an op that rounds floating point values.static ImageOpsequential(Collection<? extends ImageOp> ops) Apply a collection of ops sequentially, chaining the output of one op as the input for the next.static ImageOpsequential(ImageOp... ops) Apply an array of ops sequentially, chaining the output of one op as the input for the next.static ImageOpCreate an op that duplicates a Mat, applies different operations to each duplicate, and combines the result by adding corresponding values.static ImageOpsplitDivide(ImageOp opTop, ImageOp opBottom) Create an op that duplicates a Mat, applies different operations to each duplicate, and combines the result by dividing corresponding values.static ImageOpsplitMerge(Collection<? extends ImageOp> ops) Create an op that applies all the specified ops to the inputMat, concatenating the results as channels of the output.static ImageOpsplitMerge(ImageOp... ops) Create an op that applies all the specified ops to the inputMat, concatenating the results as channels of the output.static ImageOpsplitMultiply(ImageOp opLeft, ImageOp opRight) Create an op that duplicates a Mat, applies different operations to each duplicate, and combines the result by multiplying corresponding values.static ImageOpsplitSubtract(ImageOp opLeft, ImageOp opRight) Create an op that duplicates a Mat, applies different operations to each duplicate, and combines the result by subtracting corresponding values.static ImageOpsqrt()Calculate the square root of all pixel values.static ImageOpsubtract(double... values) Subtract a constant from all pixels.
-
Constructor Details
-
Core
public Core()
-
-
Method Details
-
ensureType
Convert theMatto match a specified pixel type.- Parameters:
type- the pixel type that theMatshould be converted to- Returns:
-
multiply
Multiply all pixels by a constant.- Parameters:
values- either a single value to apply to all channels, or an array ofMat.channels()values.- Returns:
-
divide
Divide all pixels by a constant.- Parameters:
values- either a single value to apply to all channels, or an array ofMat.channels()values.- Returns:
-
add
Add a constant to all pixels.- Parameters:
values- either a single value to apply to all channels, or an array ofMat.channels()values.- Returns:
-
subtract
Subtract a constant from all pixels.- Parameters:
values- either a single value to apply to all channels, or an array ofMat.channels()values.- Returns:
-
power
Raise every pixel element to a power.- Parameters:
value-- Returns:
-
sqrt
Calculate the square root of all pixel values.- Returns:
-
sequential
Apply a collection of ops sequentially, chaining the output of one op as the input for the next.- Parameters:
ops-- Returns:
- an op that represents the result of chaining the other ops together
-
sequential
Apply an array of ops sequentially, chaining the output of one op as the input for the next.- Parameters:
ops-- Returns:
- an op that represents the result of chaining the other ops together
-
splitMerge
Create an op that applies all the specified ops to the inputMat, concatenating the results as channels of the output.- Parameters:
ops-- Returns:
- a single op that combines all other ops by split and merge
-
splitMerge
Create an op that applies all the specified ops to the inputMat, concatenating the results as channels of the output.- Parameters:
ops-- Returns:
- a single op that combines all other ops by split and merge
-
identity
Create an op that returns its input unchanged. This is useful where an op is required, but no processing should be performed (e.g. withsplitSubtract(ImageOp, ImageOp)).- Returns:
-
exp
Create an op that returns Euler's number e raise to the power of the Mat values.- Returns:
-
log
Create an op that returns the natural logarithm of values.- Returns:
-
round
Create an op that rounds floating point values. Non-finite input values are left unchanged.- Returns:
-
floor
Create an op that floors floating point values. Non-finite input values are left unchanged.- Returns:
-
ceil
Create an op that ceils floating point values. Non-finite input values are left unchanged.- Returns:
-
replaceNaNs
Create an op that replaces NaNs with a specified value.- Parameters:
replaceValue- the value to replace NaNs- Returns:
-
replace
Create an op that replaces one pixel value in an image with another.- Parameters:
originalValue- the value in the input image to replacenewValue- the value to use in the output image- Returns:
-
splitAdd
Create an op that duplicates a Mat, applies different operations to each duplicate, and combines the result by adding corresponding values.- Parameters:
opLeft- op to apply to first duplicateopRight- op to apply to second duplicate- Returns:
- new split-combine op
-
splitSubtract
Create an op that duplicates a Mat, applies different operations to each duplicate, and combines the result by subtracting corresponding values.- Parameters:
opLeft- op to apply to first duplicateopRight- op to apply to second duplicate- Returns:
- new split-combine op
-
splitMultiply
Create an op that duplicates a Mat, applies different operations to each duplicate, and combines the result by multiplying corresponding values.- Parameters:
opLeft- op to apply to first duplicateopRight- op to apply to second duplicate- Returns:
- new split-combine op
-
splitDivide
Create an op that duplicates a Mat, applies different operations to each duplicate, and combines the result by dividing corresponding values.- Parameters:
opTop- op to apply to first duplicateopBottom- op to apply to second duplicate- Returns:
- new split-combine op
-
clip
Create an op that clips Mat values to the specified minimum and maximum.- Parameters:
min-max-- Returns:
- Since:
- v0.3.1
-