What is purpose of the target varriable?
1 view (last 30 days)
Show older comments
function [Instances T_target]=create_learning_set()
%% create data set for each texture class
%for cloud class
srcFiles = dir('colored_textures\LearningSet\cloud\*.jpg'); % the folder in which images exists
Iin=[]; %this hold the data as input to the neural network
Target=[]; %this holds the target or the required result for each class, we put it manully.
%read the folder containing the cloud images
for i = 1 : length(srcFiles) % determins how many images are there in the folder, this loop will be executed 3 times because cloud folder has 3 images
filename = strcat('colored_textures\LearningSet\cloud\',srcFiles(i).name); %this will include the filename after the directory name
I = imread(filename); %read the image
F=get_image_features(I); %create feature vector for the image
Iin=[Iin F']; %concatenate the feature vector to the store of features
Target=[Target, 100];%concatenate the target value for each feature vector
end
%for gravel class
srcFiles = dir('colored_textures\LearningSet\gravel\*.jpg'); % the folder in which ur images exists
for i = 1 : length(srcFiles)
filename = strcat('colored_textures\LearningSet\gravel\',srcFiles(i).name);
I = imread(filename);
F=get_image_features(I); %create feature vector for the image
Iin=[Iin F']; %concatenate the feature vector to the store of features
Target=[Target, 200];%concatenate the target value for each feature vector
end
%for wood class
srcFiles = dir('colored_textures\LearningSet\wood\*.jpg'); % the folder in which ur images exists
for i = 1 : length(srcFiles)
filename = strcat('colored_textures\LearningSet\wood\',srcFiles(i).name);
I = imread(filename);
F=get_image_features(I); %create feature vector for the image
Iin=[Iin F']; %concatenate the feature vector to the store of features
Target=[Target, 300];%concatenate the target value for each feature vector
end
%for jute class
srcFiles = dir('colored_textures\LearningSet\jute\*.jpg'); % the folder in which ur images exists
for i = 1 : length(srcFiles)
filename = strcat('colored_textures\LearningSet\jute\',srcFiles(i).name);
I = imread(filename);
F=get_image_features(I); %create feature vector for the image
Iin=[Iin F']; %concatenate the feature vector to the store of features
Target=[Target, 500];%concatenate the target value for each feature vector
end
%for water class
srcFiles = dir('colored_textures\LearningSet\water\*.jpg'); % the folder in which ur images exists
for i = 1 : length(srcFiles)
filename = strcat('colored_textures\LearningSet\water\',srcFiles(i).name);
I = imread(filename);
F=get_image_features(I); %create feature vector for the image
Iin=[Iin F']; %concatenate the feature vector to the store of features
Target=[Target, 600];%concatenate the target value for each feature vector
end
%for sanke class
srcFiles = dir('colored_textures\LearningSet\sanke\*.jpg'); % the folder in which ur images exists
for i = 1 : length(srcFiles) filename = strcat('colored_textures\LearningSet\sanke\',srcFiles(i).name); I = imread(filename); F=get_image_features(I); %create feature vector for the image Iin=[Iin F']; %concatenate the feature vector to the store of features Target=[Target, 700];%concatenate the target value for each feature vector end
T_target=Target;
Instances=Iin;
end
Accepted Answer
Walter Roberson
on 8 Sep 2013
Edited: Walter Roberson
on 8 Sep 2013
It is an arbitrary class (group) number to distinguish between the classes. All members of the same class of textures are given the same class number (target)
0 Comments
More Answers (0)
See Also
Categories
Find more on Software Development Tools 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!