08-19-2025 04:43 AM
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?
08-19-2025 09:42 AM
I guess I don't see what you are seeing.... sizes look pretty similar.
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.
08-19-2025 10:12 AM
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)
08-19-2025 11:55 AM
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:
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.
08-19-2025 12:13 PM
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:
Could you please explain a little bit more? Thank you in advance!
08-19-2025 12:28 PM
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.
08-19-2025 12:31 PM - edited 08-19-2025 12:36 PM
@tiho wrote:I don't know exactly the part of the code, marked in red rectangles:
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.
08-19-2025 12:49 PM
@altenbach wrote:
BOTTOM: Creating a symmetric 2D kernel is most easily done by creating a 1D kernel followed by the outer product.
09-03-2025 04:34 PM
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.
09-04-2025 05:00 AM
@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).