Package qupath.opencv.ops
Class ImageOps.Core
java.lang.Object
qupath.opencv.ops.ImageOps.Core
- Enclosing class:
ImageOps
Core operations.
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionstatic ImageOp
add
(double... values) Add a constant to all pixels.static ImageOp
ceil()
Create an op that ceils floating point values.static ImageOp
clip
(double min, double max) Create an op that clips Mat values to the specified minimum and maximum.static ImageOp
divide
(double... values) Divide all pixels by a constant.static ImageOp
ensureType
(PixelType type) Convert theMat
to match a specified pixel type.static ImageOp
exp()
Create an op that returns Euler's number e raise to the power of the Mat values.static ImageOp
floor()
Create an op that floors floating point values.static ImageOp
identity()
Create an op that returns its input unchanged.static ImageOp
log()
Create an op that returns the natural logarithm of values.static ImageOp
multiply
(double... values) Multiply all pixels by a constant.static ImageOp
power
(double value) Raise every pixel element to a power.static ImageOp
replace
(double originalValue, double newValue) Create an op that replaces one pixel value in an image with another.static ImageOp
replaceNaNs
(double replaceValue) Create an op that replaces NaNs with a specified value.static ImageOp
round()
Create an op that rounds floating point values.static ImageOp
sequential
(Collection<? extends ImageOp> ops) Apply a collection of ops sequentially, chaining the output of one op as the input for the next.static ImageOp
sequential
(ImageOp... ops) Apply an array of ops sequentially, chaining the output of one op as the input for the next.static ImageOp
Create an op that duplicates a Mat, applies different operations to each duplicate, and combines the result by adding corresponding values.static ImageOp
splitDivide
(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 ImageOp
splitMerge
(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 ImageOp
splitMerge
(ImageOp... ops) Create an op that applies all the specified ops to the inputMat
, concatenating the results as channels of the output.static ImageOp
splitMultiply
(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 ImageOp
splitSubtract
(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 ImageOp
sqrt()
Calculate the square root of all pixel values.static ImageOp
subtract
(double... values) Subtract a constant from all pixels.
-
Constructor Details
-
Core
public Core()
-
-
Method Details
-
ensureType
Convert theMat
to match a specified pixel type.- Parameters:
type
- the pixel type that theMat
should 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
-