from
Machine Vision System - Color Recognition
by Vihang Patil
This gui is a demonstration on the concept of machine vision system for color recognition
|
| intialcheck
|
function [data,flag] = intialcheck
%This function is used to the initial validation to check whether any color
%solution is made in data directory. If not then tell the user to make the
%color solution first
try
val = dir([pwd '\data\*.mat']); %all color data files name in directory data stored in val
val1 = {val.name}; % stored all color name in cell format
str = [pwd '\data\']; % pathname
if size(val1,2) ~= 0 %if mat files are present then proceed
for i = 1:size(val1,2) % load and store all color data under single data file
data(i) = load([str val1{i}]);
end
flag = 'good';
else
data = [];
flag = 'bad';
end
catch
data = [];
flag = 'bad';
end
|
|
Contact us at files@mathworks.com