Class CVFind

java.lang.Object
dev.botcity.framework.web.CVFind

public class CVFind extends Object
  • Constructor Summary

    Constructors
    Constructor
    Description
     
  • Method Summary

    Modifier and Type
    Method
    Description
    findAllElements(org.marvinproject.framework.image.MarvinImage visualElement, org.marvinproject.framework.image.MarvinImage screenElement, Region region, double matching, boolean returnFirst)
    Find all elements in the image.
    Returns the element with the best score.
    org.marvinproject.framework.image.MarvinImage
    grayscale(org.marvinproject.framework.image.MarvinImage image)
    Grayscale image.
    org.marvinproject.framework.image.MarvinImage
    threshold(org.marvinproject.framework.image.MarvinImage image, int value)
    Threshold image.

    Methods inherited from class java.lang.Object

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

    • CVFind

      public CVFind()
  • Method Details

    • threshold

      public org.marvinproject.framework.image.MarvinImage threshold(org.marvinproject.framework.image.MarvinImage image, int value)
      Threshold image.

      Parameters:
      image - source image.
      value - threshold value.
      Returns:
      thresholded image.
    • grayscale

      public org.marvinproject.framework.image.MarvinImage grayscale(org.marvinproject.framework.image.MarvinImage image)
      Grayscale image.

      Parameters:
      image - source image.
      Returns:
      grayscaled image.
    • findAllElements

      public List<State> findAllElements(org.marvinproject.framework.image.MarvinImage visualElement, org.marvinproject.framework.image.MarvinImage screenElement, Region region, double matching, boolean returnFirst)
      Find all elements in the image.

      Parameters:
      visualElement - visual element to find.
      screenElement - screen element to find.
      region - The region to search.
      matching - The matching index ranging from 0 to 1.
      returnFirst - If true, returns the first element found.
      Returns:
      List of found elements, empty otherwise.
    • findBestElement

      public State findBestElement(List<State> elements)
      Returns the element with the best score.

      Parameters:
      elements - List of elements to search.
      Returns:
      Best element.