LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Intensity Graph Manipulation

Hello,

I am currently working with intensity graphs and greyscale images,

I use an array of numbers that are actually an image, obtained from software such as imagej, and then display them on an intensity graph.

I want to manipulate the image shown on the graph by being able to smudge the image (changing the current pixel value by the average of the pixel values around it) and adding random noise to each pixel, how would I go about doing this?

Thanks,

Sam

 

(if needed I can provide my VI)

0 Kudos
Message 1 of 6
(3,187 Views)

The same way you would in any other programming language, probably.

 

You need to start by finding the in indices of adjacent pixels, then perform necessary arithmetic opererations to "average" them.

 

LabVIEW has a random number generator, you can multiply this by an appropriate scalar to get something to add to a given pixel.

 

Which part are you struggling with? If you have a more specific question, or provide your attempts so far, it will be easier to give more specific advice/help.


GCentral
0 Kudos
Message 2 of 6
(3,164 Views)

Hi, the problem i'm having is implementing it into my program. I'm not sure how to edit the pixel in the image, i've figured out how to pull out the indicie I want but not sure how to implement it back into the array to make changes to the displayed picture to show the smudges or random noise added.

0 Kudos
Message 3 of 6
(3,161 Views)

If you want to make changes in a new array, you can use one or a pair of nested For loops and then autoindex outputs, whilst using Index Array and a non-indexing input to find neighboring values.

 

If you want to make changes in place, you can use Replace Array Subset, but be careful to not use the new values by accident when considering the same pixel from the point of view of a neighbour to a later pixel in your list.


GCentral
0 Kudos
Message 4 of 6
(3,156 Views)

What is the datatype (U8, SGL, etc.)? The data of an intensity graph is just a 2D array, and to smooth the values all you need is to convolute it with an approriate normalized 2D kernel. LabVIEW has all the tools for that. (Use this, and set the output size to X).

 

Can you attach a simple VI containing the data and intensity graph?

0 Kudos
Message 5 of 6
(3,153 Views)

OK, maybe I misunderstood. You want to selectively smudge certain areas, not homogenously blur the entire image.

 

Yes, please show us your VI and some typical data. To operate on a 2D array in place, you need to keep it in a shift register and replace certain values with the new values.

 

On a side note, here's how you would apply a 5x5 Gaussian filter to the entire image using convolution. Of course you could do something very similar for the localized blurring by only convoluting the subset near the selected point before writing the subset back to the same place.

 

smoothing.png

0 Kudos
Message 6 of 6
(3,151 Views)