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

Things aren't working and I'm stuck! #9

Closed
2 tasks done
PhilippScheulen opened this issue Nov 19, 2024 · 1 comment
Closed
2 tasks done

Things aren't working and I'm stuck! #9

PhilippScheulen opened this issue Nov 19, 2024 · 1 comment
Assignees
Labels
help wanted Things aren't working and I'm stuck! WS 24/25

Comments

@PhilippScheulen
Copy link

PhilippScheulen commented Nov 19, 2024

Repository

philipp-does-fun-hacker-stuff

Access rights

  • I hereby confirm that the supervisors can access my GitHub repository.

Git commit and push

  • I hereby confirm that I have committed and pushed to my GitHub repository.

Task

Lab Session 2

Describe the problem (if possible)

Wrong thresholds:

Image: 28, Dice: 0.75, T=35
Image: 29, Dice: 0.65, T=41
Image: 33, Dice: 0.60, T=60
Image: 44, Dice: 0.59, T=64
Image: 46, Dice: 0.37, T=58
Image: 49, Dice: 0.80, T=46

Should be:

Image: 28, Dice: 0.75, T=35
Image: 29, Dice: 0.65, T=41
Image: 33, Dice: 0.43, T=71
Image: 44, Dice: 0.58, T=67
Image: 46, Dice: 0.08, T=75
Image: 49, Dice: 0.80, T=46

@PhilippScheulen PhilippScheulen added the help wanted Things aren't working and I'm stuck! label Nov 19, 2024
@kostrykin kostrykin self-assigned this Nov 19, 2024
@kostrykin
Copy link
Member

The error was in the computation of your histogram:

    h = np.zeros(255)
    for x in range(255):
        h[x]= np.sum(img8 == x)

This should be:

    h = np.zeros(256)
    for x in range(256):
        h[x]= np.sum(img8 == x)

In your implementation, the frequencies of intensity 255 were not computed, and thus not considered by your Otsu implementation.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
help wanted Things aren't working and I'm stuck! WS 24/25
Projects
None yet
Development

No branches or pull requests

2 participants