Detect the vein pattern in leaves?
Asked Answered
D

3

6

My aim is to detect the vein pattern in leaves which characterize various species of plants

I have already done the following:

Original image:

enter image description here

After Adaptive thresholding:

enter image description here

However the veins aren't that clear and get distorted , Is there any way i could get a better output

EDIT:

I tried color thresholding my results are still unsatisfactory i get the following image

enter image description here

Please help

Disjuncture answered 8/3, 2012 at 12:59 Comment(0)
S
5

The fact that its a JPEG image is going to give the "block" artifacts, which in the example you posted causes most square areas around the veins to have lots of noise, so ideally work on an image that's not been through lossy compression. If that's not possible then try filtering the image to remove some of the noise.

The veins you are wanting to extract have a different colour from the background, leaf and shadow so some sort of colour based threshold might be a good idea. There was a recent S.O. question with some code that might help here. After that some sort of adaptive normalisation would help increase the contrast before you threshold it.

[edit]
Maybe thresholding isn't an intermediate step that you want to do. I made the following by filtering to remove jpeg artifacts, doing some CMYK channel math (more cyan and black) then applying adaptive equalisation. I'm pretty sure you could then go on to produce (subpixel maybe) edge points using image gradients and non-maxima supression, and maybe use the brightness at each point and the properties of the vein structure (mostly joining at a tangent) to join the points into lines.

Example of processed leaf image

Scarlett answered 9/3, 2012 at 11:56 Comment(0)
I
4

In the past I made good experiences with the Edge detecting algorithm difference of Gaussian. Which basically works like this: You blur the image twice with the gaussian blurr algorithm but with differenct blur radii. Then you calculate the difference between both images.

Pixel with same color beneath each other will creating a same blured color. Pixel with different colors beneath each other wil reate a gradient which is depending on the blur radius. For bigger radius the gradient will stretch more far. For smaller ones it wont.

So basically this is bandpass filter. If the selected radii are to small a vain vill create 2 "parallel" lines. But since the veins of leaves are small compared with the extends of the Image you mostly find radii, where a vein results in 1 line.

Here I added th processed picture. Steps I did on this picture:

  1. desaturate (grayscaled)
  2. difference of Gaussian. Here I blured the first Image with a radius of 10px and the second image with a radius of 2px. The result you can see below.

This is only a quickly created result. I would guess that by optimizing the parametes, you can even get better ones. enter image description here

Impel answered 17/3, 2012 at 6:45 Comment(0)
B
1

This sounds like something I did back in college with neural networks. The neural network stuff is a bit hard so I won't go there. Anyways, patterns are perfect candidates for the 2D Fourier transform! Here is a possible scheme:

  1. You have training data and input data
  2. Your data is represented as a the 2D Fourier transform
  3. If your database is large you should run PCA on the transform results to convert a 2D spectrogram to a 1D spectrogram
  4. Compare the hamming distance by testing the spectrum (after PCA) of 1 image with all of the images in your dataset.

You should expect ~70% recognition with such primitive methods as long as the images are of approximately the same rotation. If the images are not of the same rotation.you may have to use SIFT. To get better recognition you will need more intelligent training sets such as a Hidden Markov Model or a neural net. The truth is to getting good results for this kind of problem may be quite a lot of work.

Check out: https://theiszm.wordpress.com/2010/07/20/7-properties-of-the-2d-fourier-transform/

Bodrogi answered 17/3, 2012 at 6:43 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.