VittorioAccomazzi / LeafSize

🍃 Leaf and Pathogen quantification
0 stars 0 forks source link

Add Pathogen area quantification #9

Closed VittorioAccomazzi closed 2 years ago

VittorioAccomazzi commented 2 years ago

The user should be able to quantify the area with the pathogen on the leaves if present. Since it is not easy, and sometime possible to identify the colour threshold to identify the area, the user shall be able to paint on a few images the are with the pathogen, and the system shall generalize and identify the area on all the leaves.

The algorithm can rely on the following assumption :

VittorioAccomazzi commented 2 years ago

Using RGB Thresholds

The current solution allows the user to select the rgb values which are part of the pathogen area and then segments the all the leaves. The generalization is ok, but not great . In several situation the method fails to identify the pathogen simply because of the illumination, example: Screen Shot 2022-05-20 at 9 17 26 PM the areas indicated have a direct illumination and are not segmented. However with a simple stroke: Screen Shot 2022-05-20 at 9 19 01 PM it is possible to improve, but not completely to isolate the area: Screen Shot 2022-05-20 at 9 19 36 PM

VittorioAccomazzi commented 2 years ago

Comparison RGB, HSV and LAB for pathogen quantification.

HSV

The application uses the HSV colour model for the leaf threshold. Here are the three component for an image, which clearly shows that it is a good approach for the leaf: Hue : ColourModels shall decompose the image in HSV-hue Saturation: ColourModels shall decompose the image in HSV-sat Value: ColourModels shall decompose the image in HSV-val Based on the images above, we are going to attempt to use Hue and Saturation for the isolation of the pathogen

LAB

Lab is a colour model which seems to isolate the pathogen quite well, at least on the tomato leaves. a : ColourModels shall decompose the image in LAB-a b : ColourModels shall decompose the image in LAB-b L : ColourModels shall decompose the image in LAB-l from the images above it appears that the a component, and perhaps the b component should be able to isolate the pathogen region.

Results

I ran 4 images, with exactly the same input using:

🖐 This analysis clearly depends on:

However from the data here, it appears quite clearly that for tomato leaves the Lab colour model seems the most efficient.

VittorioAccomazzi commented 2 years ago

the branch has been merged. See #10