Search in sources :

Example 91 with Mat

use of org.opencv.core.Mat in project Relic_Main by TeamOverdrive.

the class Photo method denoise_TVL1.

// javadoc: denoise_TVL1(observations, result)
public static void denoise_TVL1(List<Mat> observations, Mat result) {
    Mat observations_mat = Converters.vector_Mat_to_Mat(observations);
    denoise_TVL1_1(observations_mat.nativeObj, result.nativeObj);
    return;
}
Also used : Mat(org.opencv.core.Mat)

Example 92 with Mat

use of org.opencv.core.Mat in project Relic_Main by TeamOverdrive.

the class Photo method fastNlMeansDenoisingMulti.

// javadoc: fastNlMeansDenoisingMulti(srcImgs, dst, imgToDenoiseIndex, temporalWindowSize)
public static void fastNlMeansDenoisingMulti(List<Mat> srcImgs, Mat dst, int imgToDenoiseIndex, int temporalWindowSize) {
    Mat srcImgs_mat = Converters.vector_Mat_to_Mat(srcImgs);
    fastNlMeansDenoisingMulti_1(srcImgs_mat.nativeObj, dst.nativeObj, imgToDenoiseIndex, temporalWindowSize);
    return;
}
Also used : Mat(org.opencv.core.Mat)

Example 93 with Mat

use of org.opencv.core.Mat in project Relic_Main by TeamOverdrive.

the class Converters method vector_int_to_Mat.

public static Mat vector_int_to_Mat(List<Integer> is) {
    Mat res;
    int count = (is != null) ? is.size() : 0;
    if (count > 0) {
        res = new Mat(count, 1, CvType.CV_32SC1);
        int[] buff = new int[count];
        for (int i = 0; i < count; i++) {
            int v = is.get(i);
            buff[i] = v;
        }
        res.put(0, 0, buff);
    } else {
        res = new Mat();
    }
    return res;
}
Also used : Mat(org.opencv.core.Mat) Point(org.opencv.core.Point) MatOfKeyPoint(org.opencv.core.MatOfKeyPoint) KeyPoint(org.opencv.core.KeyPoint) MatOfPoint(org.opencv.core.MatOfPoint)

Example 94 with Mat

use of org.opencv.core.Mat in project Relic_Main by TeamOverdrive.

the class Converters method vector_uchar_to_Mat.

public static Mat vector_uchar_to_Mat(List<Byte> bs) {
    Mat res;
    int count = (bs != null) ? bs.size() : 0;
    if (count > 0) {
        res = new Mat(count, 1, CvType.CV_8UC1);
        byte[] buff = new byte[count];
        for (int i = 0; i < count; i++) {
            byte b = bs.get(i);
            buff[i] = b;
        }
        res.put(0, 0, buff);
    } else {
        res = new Mat();
    }
    return res;
}
Also used : Mat(org.opencv.core.Mat) Point(org.opencv.core.Point) MatOfKeyPoint(org.opencv.core.MatOfKeyPoint) KeyPoint(org.opencv.core.KeyPoint) MatOfPoint(org.opencv.core.MatOfPoint)

Example 95 with Mat

use of org.opencv.core.Mat in project Relic_Main by TeamOverdrive.

the class Converters method Mat_to_vector_vector_DMatch.

public static void Mat_to_vector_vector_DMatch(Mat m, List<MatOfDMatch> lvdm) {
    if (lvdm == null)
        throw new java.lang.IllegalArgumentException("Output List can't be null");
    if (m == null)
        throw new java.lang.IllegalArgumentException("Input Mat can't be null");
    List<Mat> mats = new ArrayList<Mat>(m.rows());
    Mat_to_vector_Mat(m, mats);
    lvdm.clear();
    for (Mat mi : mats) {
        MatOfDMatch vdm = new MatOfDMatch(mi);
        lvdm.add(vdm);
        mi.release();
    }
    mats.clear();
}
Also used : Mat(org.opencv.core.Mat) MatOfDMatch(org.opencv.core.MatOfDMatch) ArrayList(java.util.ArrayList)

Aggregations

Mat (org.opencv.core.Mat)239 ArrayList (java.util.ArrayList)34 Point (org.opencv.core.Point)33 MatOfPoint (org.opencv.core.MatOfPoint)27 MatOfKeyPoint (org.opencv.core.MatOfKeyPoint)19 KeyPoint (org.opencv.core.KeyPoint)18 Size (org.opencv.core.Size)17 Rect (org.opencv.core.Rect)15 Scalar (org.opencv.core.Scalar)9 File (java.io.File)7 BufferedImage (java.awt.image.BufferedImage)5 FilterContext (de.serviceflow.frankenstein.plugin.api.FilterContext)4 SegmentVideoFilter (de.serviceflow.frankenstein.plugin.api.SegmentVideoFilter)4 DefaultFilterContext (de.serviceflow.frankenstein.vf.DefaultFilterContext)4 VideoFilter (de.serviceflow.frankenstein.vf.VideoFilter)4 DataBufferByte (java.awt.image.DataBufferByte)4 FilterElement (de.serviceflow.frankenstein.vf.FilterElement)3 IOException (java.io.IOException)3 InvocationTargetException (java.lang.reflect.InvocationTargetException)3 ImageNotFoundException (org.getopentest.exceptions.ImageNotFoundException)3