A Novel AI-Based Approach for Better Segmentation of the Fungal and Bacterial Leaf Diseases of Rice Plant
Algorithm 1
RPK-means algorithm.
Step 1. Initialize K=n // n = no f clusters, taking n=3 initially
Step 2. Select Ci for each Ki, // Ci is a center for each cluster Ki, say (,)
Step 3. Calculate distance using the below equation, for each pixel (,) form Ci, such that Ci Ɛ Ki
Step 4. Merge all the (,) to cluster where (Where, is the minimum distance)
Step 5. Store (,) of each Ci for further operation.
Step 6. Ai=Area (Ci), // {i=1, 2,…n} A1, A2…..An represents the area of cluster C1, C2,..Cn
Step 7. Sort (Ascending (Ai)) // {A1, A2,.An}
Step 8. Select C1 and C2 such that, C1, C2 Ɛ An, An-1, Respectively,
For random walk we assumed that user provided coordinate positions of cluster C1 and of cluster C2 (Stored in step 5) as seed pixels to connect the path of foreground and background object
Step 9. If intensity of pixel is represented by , Intensity of is represented by , and distance between theses intensities denoted by then we can calculate the weight of edge connecting theses two vertices as:
Step 10. Finally, pixels with similar weights can be connect to generate random path for foreground and background objects