i am making a leaf recognition system using img processing.i need to take 100 images from my database for 10 types of leaves,i.e,10 images for each type.how do i proceed with my code? the following code is for one leaf image.

2 visualizzazioni (ultimi 30 giorni)
clc; clear all; close all; I=imread('C:\Users\Ankit\Desktop\leaf database\ashoka-polyalthia longifolia\1.jpg'); imshow(I); H = fspecial('average', [10 10]);%fspecial creates 2D filters. I = imfilter(I, H);%filter for noise imshow(I); J=rgb2gray(I);%converting rgb to grayscale
level = graythresh(I);%threshold level is set BW = im2bw(I,level);%otsu's method %L = bwlabel(BW, n);
E = edge(BW,'Sobel','nothinning');%edge detection using sobel's method %BW2 = imfill(E); %imshow(E); K = imcomplement(E);%invert the image to obtain contour of leaf
figure;imageal(J);title('Gray-Level Image'); figure;imageal(BW);title('Binary image'); figure;imageal(E);title('Sobel edge'); figure;imageal(K);title('inverted image');
I2 = imcrop([142 1480],[2282 359],K);%cropping the leaf of image to obtain the leaf
%extracting various features stats = regionprops(K,'BoundingBox','MajorAxisLength','MinorAxisLength','Area','Perimeter','Eccentricity','FilledImage','PixelList'); %stats = regionprops(E,'BoundingBox');
%computing the aspect ratio %AR=MA/MI; B=bwboundaries(BW,'noholes'); m=size(I2,1); n=size(I2,2); Aspectratio=n/m; eccentricity = sqrt(1-(m^2/n^2));
  1 Commento
Image Analyst
Image Analyst il 24 Gen 2016
I don't know what "proceed with my code" means. Have you tried typing F5 or clicking on the green "Run" triangle? Have you tried running it with all the different images in your database and making changes to have it improve the identification? Usually people know what the next steps in their projects are. Maybe you proceed by arranging a demo with the sponsor of your project to show them how well your program solves their problem for them. Maybe you proceed by writing it up and submitting it to a journal. Who knows? Certainly not me.

Accedi per commentare.

Risposte (1)

Vijayan G
Vijayan G il 15 Ago 2018
Modificato: Image Analyst il 16 Ago 2018

Hi.

Watch my video. You will get an idea.

https://www.youtube.com/watch?v=j0b02CzHRok

Categorie

Scopri di più su Agriculture in Help Center e File Exchange

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by