Finder object does not reload image when reinstantiated after the image is modified
I have a code to perform analysis on a local image using Finder object.
The local image (temporary file) is generated from multiple screen capture, overwriting previous one once analysis is done.
I did not have problem in overwriting temporary image, however the analysis function gives always the same value, unchanging from initial image generated.
It seems the file is stored in memory and does not update when new image file is copied and overwritten by new file, even Finder.destroy() runs each time.
Simple code to replicate(tested on openJDK 12.0.2, sikulix: 2019-09-17_07:10 Build 381):
# -*- coding: utf-8 -*-
import shutil
import os
from sikuli import *
def countPatternFro
addImagePat
dest = shutil.
checkImgFile = Finder(
print(imgFile)
checkImgFil
matches=[]
if checkImgFile.
while checkImgFile.
print checkImgFile.
checkImgFil
os.
removeImage
return len(matches)
if __name__ == "__main__":
addImagePat
stars = ["C:/src/
for starimg in stars:
This code worked in past build (around build 200~), but not in recent build.
Was there a change in behaviour?
Can there be some method to explicitly reload a file for Finder object?
Thank you.
Question information
- Language:
- English Edit question
- Status:
- Solved
- For:
- SikuliX Edit question
- Assignee:
- No assignee Edit question
- Solved by:
- masuo
- Solved:
- Last query:
- Last reply: