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.

5 views (last 30 days)
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 Comment
Image Analyst
Image Analyst on 24 Jan 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.

Sign in to comment.

Answers (1)

Vijayan G
Vijayan G on 15 Aug 2018
Edited: Image Analyst on 16 Aug 2018

Hi.

Watch my video. You will get an idea.

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

Categories

Find more on Image Processing and Computer Vision in Help Center and File Exchange

Community Treasure Hunt

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

Start Hunting!