This source file includes following definitions.
- adjustROI
- assignTo
- assignTo
- channels
- checkVector
- checkVector
- checkVector
- clone
- col
- colRange
- colRange
- dims
- cols
- convertTo
- convertTo
- convertTo
- copyTo
- copyTo
- create
- create
- cross
- dataAddr
- depth
- diag
- diag
- diag
- dot
- elemSize
- elemSize1
- empty
- eye
- eye
- inv
- inv
- isContinuous
- isSubmatrix
- locateROI
- mul
- mul
- ones
- ones
- push_back
- release
- reshape
- reshape
- row
- rowRange
- rowRange
- rows
- setTo
- setTo
- setTo
- setTo
- size
- step1
- step1
- submat
- submat
- submat
- total
- type
- zeros
- zeros
- finalize
- toString
- dump
- put
- put
- put
- put
- put
- get
- get
- get
- get
- get
- get
- height
- width
- getNativeObjAddr
- n_Mat
- n_Mat
- n_Mat
- n_Mat
- n_Mat
- n_Mat
- n_Mat
- n_adjustROI
- n_assignTo
- n_assignTo
- n_channels
- n_checkVector
- n_checkVector
- n_checkVector
- n_clone
- n_col
- n_colRange
- n_dims
- n_cols
- n_convertTo
- n_convertTo
- n_convertTo
- n_copyTo
- n_copyTo
- n_create
- n_create
- n_cross
- n_dataAddr
- n_depth
- n_diag
- n_diag
- n_dot
- n_elemSize
- n_elemSize1
- n_empty
- n_eye
- n_eye
- n_inv
- n_inv
- n_isContinuous
- n_isSubmatrix
- locateROI_0
- n_mul
- n_mul
- n_ones
- n_ones
- n_push_back
- n_release
- n_reshape
- n_reshape
- n_row
- n_rowRange
- n_rows
- n_setTo
- n_setTo
- n_setTo
- n_setTo
- n_size
- n_step1
- n_step1
- n_submat_rr
- n_submat
- n_t
- n_total
- n_type
- n_zeros
- n_zeros
- n_delete
- nPutD
- nPutF
- nPutI
- nPutS
- nPutB
- nGetB
- nGetS
- nGetI
- nGetF
- nGetD
- nGet
- nDump
package org.opencv.core;
public class Mat {
public final long nativeObj;
public Mat(long addr)
{
if (addr == 0)
throw new java.lang.UnsupportedOperationException("Native object address is NULL");
nativeObj = addr;
}
public Mat()
{
nativeObj = n_Mat();
return;
}
public Mat(int rows, int cols, int type)
{
nativeObj = n_Mat(rows, cols, type);
return;
}
public Mat(Size size, int type)
{
nativeObj = n_Mat(size.width, size.height, type);
return;
}
public Mat(int rows, int cols, int type, Scalar s)
{
nativeObj = n_Mat(rows, cols, type, s.val[0], s.val[1], s.val[2], s.val[3]);
return;
}
public Mat(Size size, int type, Scalar s)
{
nativeObj = n_Mat(size.width, size.height, type, s.val[0], s.val[1], s.val[2], s.val[3]);
return;
}
public Mat(Mat m, Range rowRange, Range colRange)
{
nativeObj = n_Mat(m.nativeObj, rowRange.start, rowRange.end, colRange.start, colRange.end);
return;
}
public Mat(Mat m, Range rowRange)
{
nativeObj = n_Mat(m.nativeObj, rowRange.start, rowRange.end);
return;
}
public Mat(Mat m, Rect roi)
{
nativeObj = n_Mat(m.nativeObj, roi.y, roi.y + roi.height, roi.x, roi.x + roi.width);
return;
}
public Mat adjustROI(int dtop, int dbottom, int dleft, int dright)
{
Mat retVal = new Mat(n_adjustROI(nativeObj, dtop, dbottom, dleft, dright));
return retVal;
}
public void assignTo(Mat m, int type)
{
n_assignTo(nativeObj, m.nativeObj, type);
return;
}
public void assignTo(Mat m)
{
n_assignTo(nativeObj, m.nativeObj);
return;
}
public int channels()
{
int retVal = n_channels(nativeObj);
return retVal;
}
public int checkVector(int elemChannels, int depth, boolean requireContinuous)
{
int retVal = n_checkVector(nativeObj, elemChannels, depth, requireContinuous);
return retVal;
}
public int checkVector(int elemChannels, int depth)
{
int retVal = n_checkVector(nativeObj, elemChannels, depth);
return retVal;
}
public int checkVector(int elemChannels)
{
int retVal = n_checkVector(nativeObj, elemChannels);
return retVal;
}
public Mat clone()
{
Mat retVal = new Mat(n_clone(nativeObj));
return retVal;
}
public Mat col(int x)
{
Mat retVal = new Mat(n_col(nativeObj, x));
return retVal;
}
public Mat colRange(int startcol, int endcol)
{
Mat retVal = new Mat(n_colRange(nativeObj, startcol, endcol));
return retVal;
}
public Mat colRange(Range r)
{
Mat retVal = new Mat(n_colRange(nativeObj, r.start, r.end));
return retVal;
}
public int dims()
{
int retVal = n_dims(nativeObj);
return retVal;
}
public int cols()
{
int retVal = n_cols(nativeObj);
return retVal;
}
public void convertTo(Mat m, int rtype, double alpha, double beta)
{
n_convertTo(nativeObj, m.nativeObj, rtype, alpha, beta);
return;
}
public void convertTo(Mat m, int rtype, double alpha)
{
n_convertTo(nativeObj, m.nativeObj, rtype, alpha);
return;
}
public void convertTo(Mat m, int rtype)
{
n_convertTo(nativeObj, m.nativeObj, rtype);
return;
}
public void copyTo(Mat m)
{
n_copyTo(nativeObj, m.nativeObj);
return;
}
public void copyTo(Mat m, Mat mask)
{
n_copyTo(nativeObj, m.nativeObj, mask.nativeObj);
return;
}
public void create(int rows, int cols, int type)
{
n_create(nativeObj, rows, cols, type);
return;
}
public void create(Size size, int type)
{
n_create(nativeObj, size.width, size.height, type);
return;
}
public Mat cross(Mat m)
{
Mat retVal = new Mat(n_cross(nativeObj, m.nativeObj));
return retVal;
}
public long dataAddr()
{
long retVal = n_dataAddr(nativeObj);
return retVal;
}
public int depth()
{
int retVal = n_depth(nativeObj);
return retVal;
}
public Mat diag(int d)
{
Mat retVal = new Mat(n_diag(nativeObj, d));
return retVal;
}
public Mat diag()
{
Mat retVal = new Mat(n_diag(nativeObj, 0));
return retVal;
}
public static Mat diag(Mat d)
{
Mat retVal = new Mat(n_diag(d.nativeObj));
return retVal;
}
public double dot(Mat m)
{
double retVal = n_dot(nativeObj, m.nativeObj);
return retVal;
}
public long elemSize()
{
long retVal = n_elemSize(nativeObj);
return retVal;
}
public long elemSize1()
{
long retVal = n_elemSize1(nativeObj);
return retVal;
}
public boolean empty()
{
boolean retVal = n_empty(nativeObj);
return retVal;
}
public static Mat eye(int rows, int cols, int type)
{
Mat retVal = new Mat(n_eye(rows, cols, type));
return retVal;
}
public static Mat eye(Size size, int type)
{
Mat retVal = new Mat(n_eye(size.width, size.height, type));
return retVal;
}
public Mat inv(int method)
{
Mat retVal = new Mat(n_inv(nativeObj, method));
return retVal;
}
public Mat inv()
{
Mat retVal = new Mat(n_inv(nativeObj));
return retVal;
}
public boolean isContinuous()
{
boolean retVal = n_isContinuous(nativeObj);
return retVal;
}
public boolean isSubmatrix()
{
boolean retVal = n_isSubmatrix(nativeObj);
return retVal;
}
public void locateROI(Size wholeSize, Point ofs)
{
double[] wholeSize_out = new double[2];
double[] ofs_out = new double[2];
locateROI_0(nativeObj, wholeSize_out, ofs_out);
if(wholeSize!=null){ wholeSize.width = wholeSize_out[0]; wholeSize.height = wholeSize_out[1]; }
if(ofs!=null){ ofs.x = ofs_out[0]; ofs.y = ofs_out[1]; }
return;
}
public Mat mul(Mat m, double scale)
{
Mat retVal = new Mat(n_mul(nativeObj, m.nativeObj, scale));
return retVal;
}
public Mat mul(Mat m)
{
Mat retVal = new Mat(n_mul(nativeObj, m.nativeObj));
return retVal;
}
public static Mat ones(int rows, int cols, int type)
{
Mat retVal = new Mat(n_ones(rows, cols, type));
return retVal;
}
public static Mat ones(Size size, int type)
{
Mat retVal = new Mat(n_ones(size.width, size.height, type));
return retVal;
}
public void push_back(Mat m)
{
n_push_back(nativeObj, m.nativeObj);
return;
}
public void release()
{
n_release(nativeObj);
return;
}
public Mat reshape(int cn, int rows)
{
Mat retVal = new Mat(n_reshape(nativeObj, cn, rows));
return retVal;
}
public Mat reshape(int cn)
{
Mat retVal = new Mat(n_reshape(nativeObj, cn));
return retVal;
}
public Mat row(int y)
{
Mat retVal = new Mat(n_row(nativeObj, y));
return retVal;
}
public Mat rowRange(int startrow, int endrow)
{
Mat retVal = new Mat(n_rowRange(nativeObj, startrow, endrow));
return retVal;
}
public Mat rowRange(Range r)
{
Mat retVal = new Mat(n_rowRange(nativeObj, r.start, r.end));
return retVal;
}
public int rows()
{
int retVal = n_rows(nativeObj);
return retVal;
}
public Mat setTo(Scalar s)
{
Mat retVal = new Mat(n_setTo(nativeObj, s.val[0], s.val[1], s.val[2], s.val[3]));
return retVal;
}
public Mat setTo(Scalar value, Mat mask)
{
Mat retVal = new Mat(n_setTo(nativeObj, value.val[0], value.val[1], value.val[2], value.val[3], mask.nativeObj));
return retVal;
}
public Mat setTo(Mat value, Mat mask)
{
Mat retVal = new Mat(n_setTo(nativeObj, value.nativeObj, mask.nativeObj));
return retVal;
}
public Mat setTo(Mat value)
{
Mat retVal = new Mat(n_setTo(nativeObj, value.nativeObj));
return retVal;
}
public Size size()
{
Size retVal = new Size(n_size(nativeObj));
return retVal;
}
public long step1(int i)
{
long retVal = n_step1(nativeObj, i);
return retVal;
}
public long step1()
{
long retVal = n_step1(nativeObj);
return retVal;
}
public Mat submat(int rowStart, int rowEnd, int colStart, int colEnd)
{
Mat retVal = new Mat(n_submat_rr(nativeObj, rowStart, rowEnd, colStart, colEnd));
return retVal;
}
public Mat submat(Range rowRange, Range colRange)
{
Mat retVal = new Mat(n_submat_rr(nativeObj, rowRange.start, rowRange.end, colRange.start, colRange.end));
return retVal;
}
public Mat submat(Rect roi)
{
Mat retVal = new Mat(n_submat(nativeObj, roi.x, roi.y, roi.width, roi.height));
return retVal;
}
public Mat t()
{
Mat retVal = new Mat(n_t(nativeObj));
return retVal;
}
public long total()
{
long retVal = n_total(nativeObj);
return retVal;
}
public int type()
{
int retVal = n_type(nativeObj);
return retVal;
}
public static Mat zeros(int rows, int cols, int type)
{
Mat retVal = new Mat(n_zeros(rows, cols, type));
return retVal;
}
public static Mat zeros(Size size, int type)
{
Mat retVal = new Mat(n_zeros(size.width, size.height, type));
return retVal;
}
@Override
protected void finalize() throws Throwable {
n_delete(nativeObj);
super.finalize();
}
@Override
public String toString() {
return "Mat [ " +
rows() + "*" + cols() + "*" + CvType.typeToString(type()) +
", isCont=" + isContinuous() + ", isSubmat=" + isSubmatrix() +
", nativeObj=0x" + Long.toHexString(nativeObj) +
", dataAddr=0x" + Long.toHexString(dataAddr()) +
" ]";
}
public String dump() {
return nDump(nativeObj);
}
public int put(int row, int col, double... data) {
int t = type();
if (data == null || data.length % CvType.channels(t) != 0)
throw new java.lang.UnsupportedOperationException(
"Provided data element number (" +
(data == null ? 0 : data.length) +
") should be multiple of the Mat channels count (" +
CvType.channels(t) + ")");
return nPutD(nativeObj, row, col, data.length, data);
}
public int put(int row, int col, float[] data) {
int t = type();
if (data == null || data.length % CvType.channels(t) != 0)
throw new java.lang.UnsupportedOperationException(
"Provided data element number (" +
(data == null ? 0 : data.length) +
") should be multiple of the Mat channels count (" +
CvType.channels(t) + ")");
if (CvType.depth(t) == CvType.CV_32F) {
return nPutF(nativeObj, row, col, data.length, data);
}
throw new java.lang.UnsupportedOperationException("Mat data type is not compatible: " + t);
}
public int put(int row, int col, int[] data) {
int t = type();
if (data == null || data.length % CvType.channels(t) != 0)
throw new java.lang.UnsupportedOperationException(
"Provided data element number (" +
(data == null ? 0 : data.length) +
") should be multiple of the Mat channels count (" +
CvType.channels(t) + ")");
if (CvType.depth(t) == CvType.CV_32S) {
return nPutI(nativeObj, row, col, data.length, data);
}
throw new java.lang.UnsupportedOperationException("Mat data type is not compatible: " + t);
}
public int put(int row, int col, short[] data) {
int t = type();
if (data == null || data.length % CvType.channels(t) != 0)
throw new java.lang.UnsupportedOperationException(
"Provided data element number (" +
(data == null ? 0 : data.length) +
") should be multiple of the Mat channels count (" +
CvType.channels(t) + ")");
if (CvType.depth(t) == CvType.CV_16U || CvType.depth(t) == CvType.CV_16S) {
return nPutS(nativeObj, row, col, data.length, data);
}
throw new java.lang.UnsupportedOperationException("Mat data type is not compatible: " + t);
}
public int put(int row, int col, byte[] data) {
int t = type();
if (data == null || data.length % CvType.channels(t) != 0)
throw new java.lang.UnsupportedOperationException(
"Provided data element number (" +
(data == null ? 0 : data.length) +
") should be multiple of the Mat channels count (" +
CvType.channels(t) + ")");
if (CvType.depth(t) == CvType.CV_8U || CvType.depth(t) == CvType.CV_8S) {
return nPutB(nativeObj, row, col, data.length, data);
}
throw new java.lang.UnsupportedOperationException("Mat data type is not compatible: " + t);
}
public int get(int row, int col, byte[] data) {
int t = type();
if (data == null || data.length % CvType.channels(t) != 0)
throw new java.lang.UnsupportedOperationException(
"Provided data element number (" +
(data == null ? 0 : data.length) +
") should be multiple of the Mat channels count (" +
CvType.channels(t) + ")");
if (CvType.depth(t) == CvType.CV_8U || CvType.depth(t) == CvType.CV_8S) {
return nGetB(nativeObj, row, col, data.length, data);
}
throw new java.lang.UnsupportedOperationException("Mat data type is not compatible: " + t);
}
public int get(int row, int col, short[] data) {
int t = type();
if (data == null || data.length % CvType.channels(t) != 0)
throw new java.lang.UnsupportedOperationException(
"Provided data element number (" +
(data == null ? 0 : data.length) +
") should be multiple of the Mat channels count (" +
CvType.channels(t) + ")");
if (CvType.depth(t) == CvType.CV_16U || CvType.depth(t) == CvType.CV_16S) {
return nGetS(nativeObj, row, col, data.length, data);
}
throw new java.lang.UnsupportedOperationException("Mat data type is not compatible: " + t);
}
public int get(int row, int col, int[] data) {
int t = type();
if (data == null || data.length % CvType.channels(t) != 0)
throw new java.lang.UnsupportedOperationException(
"Provided data element number (" +
(data == null ? 0 : data.length) +
") should be multiple of the Mat channels count (" +
CvType.channels(t) + ")");
if (CvType.depth(t) == CvType.CV_32S) {
return nGetI(nativeObj, row, col, data.length, data);
}
throw new java.lang.UnsupportedOperationException("Mat data type is not compatible: " + t);
}
public int get(int row, int col, float[] data) {
int t = type();
if (data == null || data.length % CvType.channels(t) != 0)
throw new java.lang.UnsupportedOperationException(
"Provided data element number (" +
(data == null ? 0 : data.length) +
") should be multiple of the Mat channels count (" +
CvType.channels(t) + ")");
if (CvType.depth(t) == CvType.CV_32F) {
return nGetF(nativeObj, row, col, data.length, data);
}
throw new java.lang.UnsupportedOperationException("Mat data type is not compatible: " + t);
}
public int get(int row, int col, double[] data) {
int t = type();
if (data == null || data.length % CvType.channels(t) != 0)
throw new java.lang.UnsupportedOperationException(
"Provided data element number (" +
(data == null ? 0 : data.length) +
") should be multiple of the Mat channels count (" +
CvType.channels(t) + ")");
if (CvType.depth(t) == CvType.CV_64F) {
return nGetD(nativeObj, row, col, data.length, data);
}
throw new java.lang.UnsupportedOperationException("Mat data type is not compatible: " + t);
}
public double[] get(int row, int col) {
return nGet(nativeObj, row, col);
}
public int height() {
return rows();
}
public int width() {
return cols();
}
public long getNativeObjAddr() {
return nativeObj;
}
private static native long n_Mat();
private static native long n_Mat(int rows, int cols, int type);
private static native long n_Mat(double size_width, double size_height, int type);
private static native long n_Mat(int rows, int cols, int type, double s_val0, double s_val1, double s_val2, double s_val3);
private static native long n_Mat(double size_width, double size_height, int type, double s_val0, double s_val1, double s_val2, double s_val3);
private static native long n_Mat(long m_nativeObj, int rowRange_start, int rowRange_end, int colRange_start, int colRange_end);
private static native long n_Mat(long m_nativeObj, int rowRange_start, int rowRange_end);
private static native long n_adjustROI(long nativeObj, int dtop, int dbottom, int dleft, int dright);
private static native void n_assignTo(long nativeObj, long m_nativeObj, int type);
private static native void n_assignTo(long nativeObj, long m_nativeObj);
private static native int n_channels(long nativeObj);
private static native int n_checkVector(long nativeObj, int elemChannels, int depth, boolean requireContinuous);
private static native int n_checkVector(long nativeObj, int elemChannels, int depth);
private static native int n_checkVector(long nativeObj, int elemChannels);
private static native long n_clone(long nativeObj);
private static native long n_col(long nativeObj, int x);
private static native long n_colRange(long nativeObj, int startcol, int endcol);
private static native int n_dims(long nativeObj);
private static native int n_cols(long nativeObj);
private static native void n_convertTo(long nativeObj, long m_nativeObj, int rtype, double alpha, double beta);
private static native void n_convertTo(long nativeObj, long m_nativeObj, int rtype, double alpha);
private static native void n_convertTo(long nativeObj, long m_nativeObj, int rtype);
private static native void n_copyTo(long nativeObj, long m_nativeObj);
private static native void n_copyTo(long nativeObj, long m_nativeObj, long mask_nativeObj);
private static native void n_create(long nativeObj, int rows, int cols, int type);
private static native void n_create(long nativeObj, double size_width, double size_height, int type);
private static native long n_cross(long nativeObj, long m_nativeObj);
private static native long n_dataAddr(long nativeObj);
private static native int n_depth(long nativeObj);
private static native long n_diag(long nativeObj, int d);
private static native long n_diag(long d_nativeObj);
private static native double n_dot(long nativeObj, long m_nativeObj);
private static native long n_elemSize(long nativeObj);
private static native long n_elemSize1(long nativeObj);
private static native boolean n_empty(long nativeObj);
private static native long n_eye(int rows, int cols, int type);
private static native long n_eye(double size_width, double size_height, int type);
private static native long n_inv(long nativeObj, int method);
private static native long n_inv(long nativeObj);
private static native boolean n_isContinuous(long nativeObj);
private static native boolean n_isSubmatrix(long nativeObj);
private static native void locateROI_0(long nativeObj, double[] wholeSize_out, double[] ofs_out);
private static native long n_mul(long nativeObj, long m_nativeObj, double scale);
private static native long n_mul(long nativeObj, long m_nativeObj);
private static native long n_ones(int rows, int cols, int type);
private static native long n_ones(double size_width, double size_height, int type);
private static native void n_push_back(long nativeObj, long m_nativeObj);
private static native void n_release(long nativeObj);
private static native long n_reshape(long nativeObj, int cn, int rows);
private static native long n_reshape(long nativeObj, int cn);
private static native long n_row(long nativeObj, int y);
private static native long n_rowRange(long nativeObj, int startrow, int endrow);
private static native int n_rows(long nativeObj);
private static native long n_setTo(long nativeObj, double s_val0, double s_val1, double s_val2, double s_val3);
private static native long n_setTo(long nativeObj, double s_val0, double s_val1, double s_val2, double s_val3, long mask_nativeObj);
private static native long n_setTo(long nativeObj, long value_nativeObj, long mask_nativeObj);
private static native long n_setTo(long nativeObj, long value_nativeObj);
private static native double[] n_size(long nativeObj);
private static native long n_step1(long nativeObj, int i);
private static native long n_step1(long nativeObj);
private static native long n_submat_rr(long nativeObj, int rowRange_start, int rowRange_end, int colRange_start, int colRange_end);
private static native long n_submat(long nativeObj, int roi_x, int roi_y, int roi_width, int roi_height);
private static native long n_t(long nativeObj);
private static native long n_total(long nativeObj);
private static native int n_type(long nativeObj);
private static native long n_zeros(int rows, int cols, int type);
private static native long n_zeros(double size_width, double size_height, int type);
private static native void n_delete(long nativeObj);
private static native int nPutD(long self, int row, int col, int count, double[] data);
private static native int nPutF(long self, int row, int col, int count, float[] data);
private static native int nPutI(long self, int row, int col, int count, int[] data);
private static native int nPutS(long self, int row, int col, int count, short[] data);
private static native int nPutB(long self, int row, int col, int count, byte[] data);
private static native int nGetB(long self, int row, int col, int count, byte[] vals);
private static native int nGetS(long self, int row, int col, int count, short[] vals);
private static native int nGetI(long self, int row, int col, int count, int[] vals);
private static native int nGetF(long self, int row, int col, int count, float[] vals);
private static native int nGetD(long self, int row, int col, int count, double[] vals);
private static native double[] nGet(long self, int row, int col);
private static native String nDump(long self);
}