Package dev.botcity.framework.web
Class CVFind
java.lang.Object
dev.botcity.framework.web.CVFind
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionfindAllElements
(org.marvinproject.framework.image.MarvinImage visualElement, org.marvinproject.framework.image.MarvinImage screenElement, Region region, double matching, boolean returnFirst) Find all elements in the image.findBestElement
(List<State> elements) 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.
-
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
Returns the element with the best score.- Parameters:
elements
- List of elements to search.- Returns:
- Best element.
-