Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Change criteria for checking neighbor blocks (#39) and possibly bugfix #43

Merged
merged 1 commit into from Jan 4, 2021

Conversation

davidhcefx
Copy link
Contributor

Description

Modification

  • dataSeen: Changed from list to set for better performance.
  • Instead of a single integer counter, I used a dictionary matchCount to keep track of the counter for each pixel.
  • I changed the variable name xDistanceRectangles -> xDistance, but change it back if you think that'll be better.
  • I guess line 193-195 are the main source of time decrease.

Before

After

- Change criteria for checking neighbor blocks, as described in #39.
- Possibly bugfix:
    - Under the loop in [line 192](https://github.com/beurtschipper/Depix/blob/f2353b6f5e2334ae61182aceda32d486eb92b9ae/depixlib/functions.py#L192)
    - assume it found a match in line 211 when `pixelatedSubRectange` == THE_ABOVE_PIXEL,
    - and it also found a match when `pixelatedSubRectangle` == THE_BELOW_PIXEL,
    - then `totalMatches` == 2, so the two results would be abandoned.
    - However, they are valid results, and should be taken into account.
@spipm spipm merged commit 52c74ac into spipm:main Jan 4, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
2 participants