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

subtract_image / subtract_threshold implementation iso conform? #12

Closed
HTuennermann opened this issue Oct 13, 2022 · 5 comments
Closed

Comments

@HTuennermann
Copy link

A colleague of mine brought up that the clipping to zero done in these functions is not mentioned in the iso standard. Therefore this wouldn't be completely iso conform. Instead, negative numbers should be used for the next steps. Would you be interested in changing this?

@scottprahl
Copy link
Owner

I would be happy to consider a pull request. Please include the relevant text from the standard (I'm in academia and don't have access to the standard.)

@miromarszal
Copy link

I don't have access to the standard either, but I'm pretty sure that clipping the noise to zero is incorrect. The background is not zero mean after such operation, hence there is an average offset — precisely what you are trying to avoid by subtracting the background in the first place. The change of noise statistics is less of a concern but something to keep in mind too.

@HTuennermann
Copy link
Author

"As a result of a proper background subtraction there must exist
negative noise values in the corrected power density distribution. These
negative values have to be included in the further evaluation in order
to allow compensation of positive noise amplitudes." (ISO 11146-3 clause
3.1)

however unfortunately this is more tricky to change than i first thought as the current examples become unstable then (hence why I did not send any pull request yet)

@scottprahl
Copy link
Owner

I think that the way to go is to add an option to functions for clipping ['strict', 'non-negative'] or something similar. We should support the standard even though some of the test cases fail (often these are extreme cases that no serious metrologist would ever make)

@scottprahl
Copy link
Owner

Thanks for the suggestion. The newly released version allow negative pixel values after subtraction. If the background is reasonable, then this method works fine. However, for many of the student images, the background was very large and to find the beam it is necessary to pass the option iso_noise=False to the function.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants