fix some pickit issues, lower item thresholds

This commit is contained in:
aeon0
2021-11-10 17:43:29 +01:00
parent efaf48608c
commit 8ef3362cff
3 changed files with 4 additions and 4 deletions

Binary file not shown.

Before

Width:  |  Height:  |  Size: 5.4 KiB

After

Width:  |  Height:  |  Size: 3.2 KiB

View File

@@ -28,7 +28,7 @@ For changelog run: `git log <PREVIOUS_TAG>..HEAD --oneline --decorate`
## Folder Structure
**/**</br>
In the root is docu, param files and development specific stuff such as .gitignore</br>
The root contains docu, param files and development specific stuff such as .gitignore</br>
**assets**</br>
Contains all data for the project that is not source code</br>

View File

@@ -100,11 +100,11 @@ class ItemFinder:
_, mask = cv2.threshold(grayscale, 0, 255, cv2.THRESH_BINARY)
hist = cv2.calcHist([cropped_input], [0, 1, 2], mask, [8, 8, 8], [0, 256, 0, 256, 0, 256])
hist_result = cv2.compareHist(template.hist, hist, cv2.HISTCMP_CORREL)
same_type = hist_result > 0.9 and hist_result is not np.inf
same_type = hist_result > 0.65 and hist_result is not np.inf
if same_type:
result = cv2.matchTemplate(cropped_input, template.data, cv2.TM_CCOEFF_NORMED)
_, max_val, _, max_loc = cv2.minMaxLoc(result)
if max_val > 0.93:
if max_val > 0.8:
if template.blacklist:
item = None
break
@@ -132,7 +132,7 @@ if __name__ == "__main__":
screen = Screen(config.general["monitor"])
item_finder = ItemFinder()
while 1:
# img = cv2.imread("assets/items/flawless_ruby.png")
# img = cv2.imread("C:\\test4.png")
img = screen.grab()
item_list = item_finder.search(img)
for item in item_list: