driver.findImageOccurrence - how set threshold value?

The problem

Can't manipulate expected threshold value for image occurence

Environment

  • Appium version (or git revision) that exhibits the issue: 1.9.1

Details

Unable to manipulate the threshold value for some images using
driver.findImageOccurrence

Link to Appium logs

Cannot find any occurrences of the partial image in the full image above the threshold of 0.5

Code To Reproduce Issue [ Good To Have ]

File screenShot = ((TakesScreenshot) driver).getScreenshotAs(OutputType.FILE);
String expectedImagesPath = System.getProperty("user.dir") + "/src/test/resources/images/";
driver.findImageOccurrence(screenShot, new File(expectedImagesPath + "image.png"));