LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

How to filter noise images?

Thank you for your clarification!

 

I'm still confused regarding the sine wave kernel size equal to 1 x 100 (1 row and 100 columns)! Could you please send me any tutorial or information on internet about the difference between the square kernels and line kernels, exact name of the used sine wave kernel and the advantages in comparison with the gaussian filters. 

 

After changing the values of the threshold, 2' smooth and HkernelWidth edit labels I noticed that cells are swelling along the Y axis (more spherical). How to correct that?

 

tiho_bg_0-1755596610212.png

 

0 Kudos
Message 31 of 41
(213 Views)

I guess I don't see what you are seeing.... sizes look pretty similar.

 

altenbach_0-1755614082760.png

 

All you need to understand is what convolution does, then play with the parameters. Any smoothing and thresholding will have an effect on the actual outlines of objects. You can think of your cells as little bumps in 3D (brightness is Z) and a low threshold will give a larger outline than a threshold that just clips the very tip. Adding broadening will again change things and the outlines will become smoother.

Message 32 of 41
(194 Views)

As I said, you background is blurry in x and sharp in y. We can blur significantly in x and it does not really change, but the cells get wiped out. If we would also blur in the y direction, the background structure is not retained. 

 

Here is a simple comparison showing the picture after the first convolution. only the Hkernel does what we want.

If you would use a symmetric kernel, you get something in-between... (not shown)

 

altenbach_0-1755616251480.png

 

Message 33 of 41
(187 Views)

Thank you for your assistance!

 

On the image there are small extension along Y axis. I marked with arrows the size along Y axis, thus showing my expectations:

 

Screenshot 2025-08-19 at 19.44.28.jpg

I see that along X axis it seems well filtered but along Y axis there is a small extension of the cell. May be the cell has to be till the end of the white contour on the top of the cell (high intensity). May be I can mask it additionally. 

0 Kudos
Message 34 of 41
(170 Views)

In fact with the sine wave kernel 1 x 100 you create a background blurring in x. If I use the same sine wave kernel but 100 x 1 the background is blurring along Y and the background structure will change.

 

With the sine wave kernel you create a blurry image of the background. Тhe cells blur until they blend into the background, right?

 

From the original image you subtract the background image and you can see only the cells, right?

 

I don't know exactly the part of the code, marked in red rectangles:

 

Screenshot 2025-08-19 at 19.57.36.jpg

Could you please explain a little bit more? Thank you in advance!

0 Kudos
Message 35 of 41
(165 Views)

You cannot simultaneously filter and threshold while retaining all minute details. You can clearly see that all your cells have a slight shadow above that gets picked up. You might be able to eliminate it at the cost of problem elsewhere.

 

You have not said what result you really need. for example for cell counting, the exact shape is not important.

If all cells are supposed to look identical, maybe you can take the average of a few dozen aligned cells to get the prototype (grey ring, darker center, bright halo above, etc.) and use that for complicated feature detection, e.g. using AI.

Message 36 of 41
(160 Views)



@tiho wrote:

I don't know exactly the part of the code, marked in red rectangles:

 

Screenshot 2025-08-19 at 19.57.36.jpg

Could you please explain a little bit more? Thank you in advance!


 

TOP: this part adjust the image indicator to the size of the image (ensuring that we see all data). It is not needed and just cosmetic.

 

MIDDLE: Any convolution gives you edge effects because border pixels are surrounded by fewer other pixels. I pad the image based on the kernel size, then trim it back to the original size later.

 

Why not do some experiment and e.g. just bypass parts of the code that are unclear and see how the result gets worse. 😄

 

BOTTOM: Creating a symmetric 2D kernel is most easily done by creating a 1D kernel followed by the outer product.

Message 37 of 41
(156 Views)

@altenbach wrote:
BOTTOM: Creating a symmetric 2D kernel is most easily done by creating a 1D kernel followed by the outer product.

altenbach_1-1755625752937.png

 

 

Message 38 of 41
(146 Views)

Hello! 

 

Thank you for your help! Could you please assist me please how to find the contour of the cells thus measuring the diameter of the cells along X and Y axes? Now the cells are rounded a little bit more. I can correct the diameter of the cells on top because I realised that the contour of the cells on top has the highest intensity.

0 Kudos
Message 39 of 41
(86 Views)

@tiho_bg wrote:

Hello! 

 

Thank you for your help! Could you please assist me please how to find the contour of the cells thus measuring the diameter of the cells along X and Y axes? Now the cells are rounded a little bit more. I can correct the diameter of the cells on top because I realised that the contour of the cells on top has the highest intensity.


From that point, it will be hundreds of times simpler to use the NI Vision Development Toolkit rather than developing everything from scratch in LabVIEW — or alternatively, using OpenCV or other image processing library (directly or via Python scripts).

0 Kudos
Message 40 of 41
(67 Views)