Einzelnen Beitrag anzeigen

Medium

Registriert seit: 23. Jan 2008
3.679 Beiträge
 
Delphi 2007 Enterprise
 
#6

AW: Noise other than random

  Alt 28. Jul 2010, 05:50
The two methods you named only differ in their probability distribution function. Since the Delphi RNG should yield uniformly distributed results, your code sample already implements uniform noise. For gaussian noise, you'd need normal distributed numbers, which can for example be achieved by scaling the results of the uniform RNG by the normal distribution function. Another approach would be an RNG that naturally yields normal distributed values, for which I don't have a working example at hand right now.

The aforementioned Perlin noise is quite different from those, since it is a fractal (once more than the first octave is used), which is not any less good, but an entirely different class of noise.

All types of noises can be applied in 4 ways:
1) Binary monochromatic, meaning the RNG value is thresholded at some point to black and white, and mixed into the image in some manner (usually scaled to 0..2 and multiplied, or scaled to -1..1 and added (and clamped of course))
2) Binary colored, which is the same, but with new values for each color channel (further dividable into applications to various color models)
3) Continuous monochromatic, where the value of the RNG is taken as is, and interpreted as brightness, mixed with the image
4) Continuous colored, well, should be obvious

A fifth method may be called "ternary", since two thresholds are applied. Values smaller than the low threshold are black, those between low and high are nothing, and those above the high threshold are white (or "color" if a colored noise is wanted). By choosing these thresholds close to the interval borders, you get the so called "salt and pepper"-noise, which is few, but strongly miscolored pixels. That can also be done using a distribution function of ones choice, of course, as with any other means of number generation (also Perlin noise may be used for that), though uniform seems to be commonly used.

As for the application of noise to an image, there seems to be no "right" way, when not talking about a specific type or effect to simulate. Those mentioned under 1) are common, but by no means all there is. Pretty much any mixing may be used, and is well up to your likings.
"When one person suffers from a delusion, it is called insanity. When a million people suffer from a delusion, it is called religion." (Richard Dawkins)

Geändert von Medium (28. Jul 2010 um 06:01 Uhr)
  Mit Zitat antworten Zitat