How to solve the error?

1 次查看(过去 30 天)
When I run the code it shows an error
"??? Undefined function or method 'get_image_features' for input arguments of type 'uint8'.
Error in ==> T_target at 13 F=get_image_features(I); %create feature vector for the image"
How to solve it?
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 ur 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 coloud images for i = 1 : length(srcFiles)
filename = strcat('colored_textures\LearningSet\cloud\',srcFiles(i).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 snake skin 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
T_target=Target; Instances=Iin; end

采纳的回答

David Sanchez
David Sanchez 2013-6-18
Obviously, you have a problem with the function:
F = get_image_features(I);
By the name you gave it, if it does what it says, the code within has to be very large, but you should go along that code and try to identify what is going on. Debugging it would help you both learning what it is doing and identifying possible mistakes/errors. In case of doubt, ask again mentioning those sections of your code you have trouble with.

更多回答(0 个)

标签

Community Treasure Hunt

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

Start Hunting!

Translated by