You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
There are several generalizations to improve noise.
First, the "multicolor" and the "color" are just numpy.random distributions applied to gray and rgb images. They could be consolidated into a single call if you build a general function for mapping a numpy distribution to a rgb and gray image. This is partially done in "normal".
In this new framework, normal and "color (maybe rename random)" would just be promotions of 2 most common noises. Normal has some keywords that make calling the numpy API more intuitive, but in general, any distribution should be accessible with "size" being the only keyword auto-set. Just need a general parser for 1-channel and 3-channel. The _parse_intensity is ok for single intensities, but it would be better if the distribution returned the desired array, then we just masked based on xmin, xmax (see the normal() function for this step) so that nosie doesn't exceed the datatypes allowed.
The text was updated successfully, but these errors were encountered:
Thinking about this a big more, should also optionally be able to return just noise. Maybe I scrap passing the image directly and just return noise based on dimensions of an image.
How bout this, if I pass in img, noise added to img. If I pass in shape, noise returned.
Maybe noise should always be rgb, but I can specify type conversion
normal_noisy(img.shape, 'gray')
I dunno...
Then maybe a nice interface would be for canvas to have an add_noise() feature that wraps function calls and stores noise separatly.
canvas.add_noise('gaussian', **kwargs)
Ya, probably this is the best way, then just refactor notebooks. In the notebooks that use noise, I need to extract the noise anyway, and that just turns out to be a pain in the ass.
There are several generalizations to improve noise.
First, the "multicolor" and the "color" are just numpy.random distributions applied to gray and rgb images. They could be consolidated into a single call if you build a general function for mapping a numpy distribution to a rgb and gray image. This is partially done in "normal".
In this new framework, normal and "color (maybe rename random)" would just be promotions of 2 most common noises. Normal has some keywords that make calling the numpy API more intuitive, but in general, any distribution should be accessible with "size" being the only keyword auto-set. Just need a general parser for 1-channel and 3-channel. The _parse_intensity is ok for single intensities, but it would be better if the distribution returned the desired array, then we just masked based on xmin, xmax (see the normal() function for this step) so that nosie doesn't exceed the datatypes allowed.
The text was updated successfully, but these errors were encountered: