@Namespace(value="cv") @NoOffset @Properties(inherit=opencv_core.class) public class MatExpr extends Pointer
A+B
, A-B
, A+s
, A-s
, s+A
, s-A
, -A
- Scaling: A*alpha
- Per-element multiplication and division: A.mul(B)
, A/B
, alpha/A
- Matrix multiplication: A*B
- Transposition: A.t()
(means AT)
- Matrix inversion and pseudo-inversion, solving linear systems and least-squares problems:
A.inv([method]) (~ A<sup>-1</sup>)
, A.inv([method])*B (~ X: AX=B)
- Comparison: A cmpop B
, A cmpop alpha
, alpha cmpop A
, where *cmpop* is one of
>
, >=
, ==
, !=
, <=
, <
. The result of comparison is an 8-bit single channel mask whose
elements are set to 255 (if the particular element or pair of elements satisfy the condition) or
0.
- Bitwise logical operations: A logicop B
, A logicop s
, s logicop A
, ~A
, where *logicop* is one of
&
, |
, ^
.
- Element-wise minimum and maximum: min(A, B)
, min(A, alpha)
, max(A, B)
, max(A, alpha)
- Element-wise absolute value: abs(A)
- Cross-product, dot-product: A.cross(B)
, A.dot(B)
- Any function of matrix or matrices and scalars that returns a matrix or a scalar, such as norm,
mean, sum, countNonZero, trace, determinant, repeat, and others.
- Matrix initializers ( Mat::eye(), Mat::zeros(), Mat::ones() ), matrix comma-separated
initializers, matrix constructors and operators that extract sub-matrices (see Mat description).
- Mat_Here are examples of matrix expressions:
// compute pseudo-inverse of A, equivalent to A.inv(DECOMP_SVD)
SVD svd(A);
Mat pinvA = svd.vt.t()*Mat::diag(1./svd.w)*svd.u.t();
// compute the new vector of parameters in the Levenberg-Marquardt algorithm
x -= (A.t()*A + lambda*Mat::eye(A.cols,A.cols,A.type())).inv(DECOMP_CHOLESKY)*(A.t()*err);
// sharpen image using "unsharp mask" algorithm
Mat blurred; double sigma = 1, threshold = 5, amount = 1;
GaussianBlur(img, blurred, Size(), sigma, sigma);
Mat lowContrastMask = abs(img - blurred) < threshold;
Mat sharpened = img*(1+amount) + blurred*(-amount);
img.copyTo(sharpened, lowContrastMask);
Pointer.CustomDeallocator, Pointer.Deallocator, Pointer.NativeDeallocator, Pointer.ReferenceCounter
Constructor and Description |
---|
MatExpr() |
MatExpr(long size)
Native array allocator.
|
MatExpr(Mat m) |
MatExpr(MatOp _op,
int _flags) |
MatExpr(MatOp _op,
int _flags,
Mat _a,
Mat _b,
Mat _c,
double _alpha,
double _beta,
Scalar _s) |
MatExpr(Pointer p)
Pointer cast constructor.
|
Modifier and Type | Method and Description |
---|---|
Mat |
a() |
MatExpr |
a(Mat setter) |
double |
alpha() |
MatExpr |
alpha(double setter) |
MatExpr |
apply(Range rowRange,
Range colRange) |
MatExpr |
apply(Rect roi) |
Mat |
asMat() |
Mat |
b() |
MatExpr |
b(Mat setter) |
double |
beta() |
MatExpr |
beta(double setter) |
Mat |
c() |
MatExpr |
c(Mat setter) |
MatExpr |
col(int x) |
Mat |
cross(Mat m) |
MatExpr |
diag() |
MatExpr |
diag(int d) |
double |
dot(Mat m) |
int |
flags() |
MatExpr |
flags(int setter) |
MatExpr |
inv() |
MatExpr |
inv(int method) |
MatExpr |
mul(Mat m) |
MatExpr |
mul(Mat m,
double scale) |
MatExpr |
mul(MatExpr e) |
MatExpr |
mul(MatExpr e,
double scale) |
MatOp |
op() |
MatExpr |
op(MatOp setter) |
MatExpr |
position(long position) |
MatExpr |
row(int y) |
Scalar |
s() |
MatExpr |
s(Scalar setter) |
Size |
size() |
MatExpr |
t() |
int |
type() |
address, asBuffer, asByteBuffer, availablePhysicalBytes, calloc, capacity, capacity, close, deallocate, deallocate, deallocateReferences, deallocator, deallocator, equals, fill, formatBytes, free, hashCode, isNull, isNull, limit, limit, malloc, maxBytes, maxPhysicalBytes, memchr, memcmp, memcpy, memmove, memset, offsetof, parseBytes, physicalBytes, position, put, realloc, referenceCount, releaseReference, retainReference, setNull, sizeof, toString, totalBytes, totalPhysicalBytes, withDeallocator, zero
public MatExpr(Pointer p)
Pointer.Pointer(Pointer)
.public MatExpr(long size)
Pointer.position(long)
.public MatExpr()
public MatExpr(@Const MatOp _op, int _flags, @Const @ByRef(nullValue="cv::Mat()") Mat _a, @Const @ByRef(nullValue="cv::Mat()") Mat _b, @Const @ByRef(nullValue="cv::Mat()") Mat _c, double _alpha, double _beta, @Const @ByRef(nullValue="cv::Scalar()") Scalar _s)
public int type()
@ByVal @Name(value="operator ()") public MatExpr apply(@Const @ByRef Range rowRange, @Const @ByRef Range colRange)
public int flags()
public MatExpr flags(int setter)
public double alpha()
public MatExpr alpha(double setter)
public double beta()
public MatExpr beta(double setter)
Copyright © 2020. All rights reserved.