Package algorithm

Class MatHelper

java.lang.Object
algorithm.MatHelper

public class MatHelper extends Object
  • Constructor Summary

    Constructors
    Constructor
    Description
     
  • Method Summary

    Modifier and Type
    Method
    Description
    static int[]
    calculateRoi(org.opencv.core.Mat mat, boolean noExecute)
    Calculates the region of interest.
    static boolean
    isEmpty(org.opencv.core.Mat mat)
    Returns whether the provided Row/Column is empty.
    static double[][]
    matToArray(org.opencv.core.Mat mat)
    Converts an OpenCV-Mat to a double array

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Constructor Details

    • MatHelper

      public MatHelper()
  • Method Details

    • matToArray

      public static double[][] matToArray(org.opencv.core.Mat mat)
      Converts an OpenCV-Mat to a double array
      Parameters:
      mat - Matrix to convert
      Returns:
      The matrix as array
    • isEmpty

      public static boolean isEmpty(org.opencv.core.Mat mat)
      Returns whether the provided Row/Column is empty.
      Parameters:
      mat - The row-/column-vector
      Returns:
      true if the vector contains only zeros, false if not
    • calculateRoi

      public static int[] calculateRoi(org.opencv.core.Mat mat, boolean noExecute)
      Calculates the region of interest. This is the region of the image that is not empty.
      Parameters:
      mat - Input image
      noExecute - Whether the true region shall be calculated. If set to false, the image won't be changed (for testing purpose)
      Returns:
      Indices of the submat with content