How to solve the error?

조회 수: 2 (최근 30일)
Shaila parvin
Shaila parvin 2013년 6월 18일
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.
  댓글 수: 1
Shaila parvin
Shaila parvin 2013년 6월 18일
Thanks a lot. I'll try.

댓글을 달려면 로그인하십시오.

추가 답변 (0개)

태그

Community Treasure Hunt

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

Start Hunting!

Translated by