← Back to team overview

sikuli-driver team mailing list archive

Re: [Question #688961]: about onChange() function

 

Question #688961 on Sikuli changed:
https://answers.launchpad.net/sikuli/+question/688961

larryli posted a new comment:
let me add one information.

maybe it is related with threshold value. in my side, I try it in the local using capture image to test it. it can detect the changed.
whether this threshold can be changed or not? or you will support it in the furture.

for i in range(0,110):
    file = folder + str(i)+".png"
    print("start to compare file: ",file)
    duplicate = cv2.imread(file)
    difference = cv2.subtract(original, duplicate)
    #print(difference)
    dest = cv2.threshold(difference, thresh, maxValue, cv2.THRESH_BINARY)
    #print(dest[1])
    b, g, r = cv2.split(dest[1])
    if cv2.countNonZero(b) == 0 and cv2.countNonZero(g) == 0 and cv2.countNonZero(r) == 0:
        pass#print("The images are completely Equal",i)
    else:
        print("The images are not same on",i)

-- 
You received this question notification because your team Sikuli Drivers
is an answer contact for Sikuli.