How can I do flowers identification?

5 views (last 30 days)
Hi, please forgive my bad English.
I want to identificate some species of flowers using the built-in camera on my laptop (640x480 RGB).
I have a lot of pictures taken by my teacher of each specie with his 16 Megapixel camera, with those pictures I did a matlab script that calculates the mean and standard deviation with normfit , then the script decides what specie is the flower in a loaded picture based in the ranges found by the mentioned script.
Is correct what I am doing? knowing that the pictures taken by my laptop wont be as good as the 16MP pics. Also my pics will have different conditions of illumination that affect the mean and standard deviation.
Can you suggest me a better or the best method to do this?
Thanks in advance

Accepted Answer

Image Analyst
Image Analyst on 27 Aug 2014
Edited: Image Analyst on 27 Aug 2014
No, that's not right for the reasons you've already realized "different conditions of illumination that affect the mean and standard deviation". Sorry but it's going to be a lot more complicated depending on how robust you want your algorithm to be. Like field of view - should it handle closeups of the flower as well as shots of whole beds or fields of this flower? Will the angle of view be directly down the flower axis, or does it need to identify pictures from the side or other weird angles? Is only the flower there, or is there substantial green leaves in there too. I suggest you look up CBIR to see how it's done in general. If you have a limited number of flower then perhaps you can use color segmentation like the demos in my File Exchange Or see this link or this one
  4 Comments
Jorge Ortiz
Jorge Ortiz on 28 Aug 2014
Is there a way to make the illumination conditions equal in the pics using MATLAB?
Can you tell me what is the better color space to work with the flowers? maybe HSV, CMYK ....
The yellow flowers are the "hard case", for now I will dedicate to identificate the others. Thank you so much
Image Analyst
Image Analyst on 28 Aug 2014
Probably hsv. But look at the color gamut in 3D. Run this code to produce the gamut like shown below. Be sure to download the software that it tells you in the comments in the beginning.
% Code to run the Color Inspector 3D (an ImageJ plug in) inside MATLAB.
%
% Windows installation instructions:
% First, download and install ImageJ from here:
% http://rsb.info.nih.gov/ij/download.html
% Put the ij.jar file here in this folder: "C:\Program Files\ImageJ"
% Then download the 3D Color Inspector plug-in for ImageJ here:
% http://rsb.info.nih.gov/ij/plugins/color-inspector.html
% and save it here in this folder:
% C:/Program Files/ImageJ/plugins/Color
% Define the jar filenames
ci3DjarFileName = 'C:\Program Files\ImageJ\plugins\Color\Color_Inspector_3D.jar';
imageJjarFileName = 'C:\Program Files\ImageJ\ij.jar';
clc; % Clear the MATLAB command window.
% Make sure the Color Inspector 3D jar file is there.
if ~exist(ci3DjarFileName, 'file')
warningMessage = sprintf('Error: Color Inspector 3D jar file does not exist:\n%s', ci3DjarFileName);
warndlg(warningMessage);
return;
end
% Make sure the ImageJ file is there.
if ~exist(imageJjarFileName, 'file')
warningMessage = sprintf('Error: ImageJ jar file does not exist:\n%s', imageJjarFileName);
warndlg(warningMessage);
return;
end
% If we get to here, the files exist.
% Now we need to enable the plug-in to work with MATLAB.
% Need to add the jar files for ImageJ and the Color Inspector 3D to the javaclasspath.
javaaddpath(ci3DjarFileName)
javaaddpath(imageJjarFileName)
% User must browse for the file they want to open.
% Set up a starting/initial folder that they will start browsing from.
startingFolder = pwd; % Change to something specific if you want.
if ~exist(startingFolder, 'dir')
startingFolder = pwd;
end
% Bring up the "Open File" dialog box.
[baseFileName, folder] = uigetfile({'*.jpg;*.tif;*.png;*.gif;*.bmp','Image Files (jpg,tif,png,bmp,gif)';...
'*.*','All Files (*.*)' },'Specify image file', startingFolder);
if baseFileName ~= 0
% If they didn't click Cancel, build the full filename:
fullFileName = fullfile(folder, baseFileName)
% Now pass that into the 3D Color Inspector plugin, and you're done.
color_inspector(fullFileName)
end

Sign in to comment.

More Answers (0)

Categories

Find more on MATLAB Compiler 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!