フィルターのクリア

Problem in Neural Network

1 回表示 (過去 30 日間)
Mohammad
Mohammad 2013 年 8 月 25 日
コメント済み: Image Analyst 2022 年 3 月 26 日
When I try to run the code
img = edu_imgpreprocess(I);
for cnt = 1:50
bw2 = edu_imgcrop(img{cnt});
charvec = edu_imgresize(bw2);
out(:,cnt) = charvec;
end
P = out(:,1:40);
T = [eye(10) eye(10) eye(10) eye(10) ];
Ptest = out(:,41:50);
For 26 alphabets making a change in the code as follows:
img = edu_imgpreprocess(I);
for cnt = 1:26
bw2 = edu_imgcrop(img{cnt});
charvec = edu_imgresize(bw2);
out(:,cnt) = charvec;
end
P = out(:,1:20);
T = [eye(10) eye(10) eye(10) eye(10) ];
Ptest = out(:,21:26);
It gives me an error of
Error using rgb2gray>parse_inputs (line 81)
MAP must be a m x 3 array.
Error in rgb2gray (line 35)
X = parse_inputs(varargin{:});
Error in edu_imgpreprocess (line 3)
Igray = rgb2gray(I);
Error in char3 (line 8)
img = edu_imgpreprocess(I);
Kindly help please. Thanks.
  3 件のコメント
Mo'ath Al-Hayek
Mo'ath Al-Hayek 2022 年 3 月 26 日
can you share with us your code after modification?
Image Analyst
Image Analyst 2022 年 3 月 26 日
@Mo'ath Al-Hayek probably not since @Mohammad has not been here in 9 years so he'll probably never see your message. Or if he does, he doesn't have the code anymore. You're best off just posting your own question in your own new discussion thread (not here).

サインインしてコメントする。

回答 (2 件)

Image Analyst
Image Analyst 2013 年 9 月 29 日
編集済み: Image Analyst 2022 年 3 月 26 日
If this is still a problem for you, what did you pass in for (the badly-named) I? Do a "whos I" before that line and say what is in the command window. Changes are it's not a regular, normal RGB image.
Replace this:
Igray = rgb2gray(I);
with this:
if ndims(I) == 3
Igray = rgb2gray(I);
else
Igray = I;
end

Dabira
Dabira 2014 年 6 月 26 日
Please tell me where did yu find out.m I cant find it
  2 件のコメント
Vijan Kaush
Vijan Kaush 2016 年 11 月 22 日
編集済み: Walter Roberson 2016 年 11 月 22 日
Walter Roberson
Walter Roberson 2016 年 11 月 22 日
In the code in the Question here, out is an array not a function.

サインインしてコメントする。

カテゴリ

Help Center および File ExchangeImage Data Workflows についてさらに検索

Community Treasure Hunt

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

Start Hunting!

Translated by