From Friday, April 19th (11:00 PM CDT) through Saturday, April 20th (2:00 PM CDT), 2024, ni.com will undergo system upgrades that may result in temporary service interruption.

We appreciate your patience as we improve our online experience.

LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

How to put gaussian noise to my picture

I am doing mage blurring in Labview,and I am supposed to put gaussian noise to the image, I tried the "IMAQ Add" and try to put noise on the picture. BUt it looks different with what I got using Matlab "imnoise".
Anybody knows this?
Thanks
Message 1 of 10
(5,916 Views)
Hello,

What versions of LabVIEW, IMAQ, and Vision are you using? How are you generating the noise that you are trying to add to the image? Are you using the Gaussian White Noise function that ships with the LabVIEW Full and Professional Development Systems? The IMAQ Add function will simply add the noise intensity at each pixel to the existing pixel intensities of your image. So, if you add noise data and pixel intensity data and you exceed the maximum intensity available for a pixel (2^(pixel depth)-1), then the value will be scaled down to the maximum intensity allowed. So, you may end up with an image that is overly bright instead of the noisy image that you expected.

What bit-depth are you using for the image (8, 10, 12, etc) and what intensity of noise are you adding to the pixels values? Depending on the values that you are using, the IMAQ Add function may output a 16-bit image. The image display, however, uses an 8-bit representation. To compensate for this, you can rt-click on the image display from your front panel and select "16-Bit Display Mapping." You can then specify how the image will be converted for display in 8-bits. Full Range should work for you, but if you know the minimum and maximum pixel intensities, you can use Given Range and map those values to 0 and 255, respectively.

Try this and let me know if you have any additional questions.

Regards,
Scott R.
Applications Engineer
National Instruments
Scott Romine
Course Development Engineer
National Instruments
Message 2 of 10
(5,886 Views)
 I also want to pay attention this problem. I used Vision tools, but I can't resolve.
Công ty TNHH KHKT Draco
0 Kudos
Message 3 of 10
(5,050 Views)

@dracovn wrote:
 I also want to pay attention this problem. I used Vision tools, but I can't resolve.

This is a 9 year old thread.

 

What is "this problem". What can't you "resolve". What have you tried?

0 Kudos
Message 4 of 10
(5,040 Views)

Hello, 

I am also new in Labview and I am required to add Uniform White noise to my R of an RGB. Can anyone help me figure out how to display this the noise image? Below is the VI I have thus far.

 

0 Kudos
Message 5 of 10
(4,832 Views)

Right now you are adding "noise" to the color table,. What's the reasoning? Does not make much sense to me.

Don't you want to add noise to each of the RGB the intensities? You seem to have 24bit colors, so the color table is not even used.

In any case, simply use "bundle by name" and replace whatever data you have modified.

0 Kudos
Message 6 of 10
(4,817 Views)

I tried doing the adding noise to the intensities before but I ran into the problem of having a 1D and 2D array. Is there a function to add a 1D to a 2D array? Or maybe do I use index array to make it 1D and add them? But if I do that how do I display the piture if it is a 1D array?

0 Kudos
Message 7 of 10
(4,774 Views)

You can create 1D noise with as many elements as pixels, then reshape to a 2D array of the image dimensions before adding.

(Even easier, add noise to the RGB components while they are still 1D arrays. :D)

 

Note that you need to be careful to remain in the valid U8 range, etc.

0 Kudos
Message 8 of 10
(4,760 Views)
0 Kudos
Message 9 of 10
(4,758 Views)

ok I think I understand but with the for loops and trying to display the image I get all the rows to be the same value each time. I took out the for loops but this is what I have thus far.

0 Kudos
Message 10 of 10
(4,716 Views)