% Alphabets
A=imread('alpha/A.bmp');
B=imread('alpha/B.bmp');
C=imread('alpha/C.bmp');
D=imread('alpha/D.bmp');
E=imread('alpha/E.bmp');
F=imread('alpha/F.bmp');
G=imread('alpha/G.bmp');
H=imread('alpha/H.bmp');
I=imread('alpha/I.bmp');
J=imread('alpha/J.bmp');
K=imread('alpha/K.bmp');
L=imread('alpha/L.bmp');
M=imread('alpha/M.bmp');
N=imread('alpha/N.bmp');
O=imread('alpha/O.bmp');
P=imread('alpha/P.bmp');
Q=imread('alpha/Q.bmp');
R=imread('alpha/R.bmp');
S=imread('alpha/S.bmp');
T=imread('alpha/T.bmp');
U=imread('alpha/U.bmp');
V=imread('alpha/V.bmp');
W=imread('alpha/W.bmp');
X=imread('alpha/X.bmp');
Y=imread('alpha/Y.bmp');
Z=imread('alpha/Z.bmp');
% Numbers
one=imread('alpha/1.bmp');
two=imread('alpha/2.bmp');
three=imread('alpha/3.bmp');
four=imread('alpha/4.bmp');
five=imread('alpha/5.bmp');
six=imread('alpha/6.bmp');
seven=imread('alpha/7.bmp');
eight=imread('alpha/8.bmp');
nine=imread('alpha/9.bmp');
zero=imread('alpha/0.bmp');
% Array of Alphabets
alphabets = [A B C D E F G H I J K L M N O P Q R S T U V W X Y Z];
% Array of Numbers
numbers = [one two three four five six seven eight nine zero];
% Creating new template
NewTemplates = [alphabets numbers];
save('NewTemplates','NewTemplates')
Screenshot (37).png

4 件のコメント

madhan ravi
madhan ravi 2019 年 10 月 11 日
Probably you were meant to provide the full path of the files?
Kartikey Rai
Kartikey Rai 2019 年 10 月 11 日
Sorry I didn't get what you were trying to say?
Mainly I was creating a database of Alphabets. I searched it on internet anf got this.
Can you provide with another technique?
Thank you!
Geoff Hayes
Geoff Hayes 2019 年 10 月 11 日
Kartikey - do you have the image files? The code is trying to read these files and assumes that they are in a folder named alpha..
Kartikey Rai
Kartikey Rai 2019 年 10 月 15 日
No, I don't have them.
I am making them now.
Thamk you so much!

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

 採用された回答

Shivam Prasad
Shivam Prasad 2019 年 10 月 14 日
編集済み: Shivam Prasad 2019 年 10 月 14 日

0 投票

Hi Kartikey,
The function imread assumes the argument to be be a valid path (relative/absolute) pointing to a valid image file. In your code, you have provided a relative path to alpha folder. Hence, make sure that a folder named alpha (containing the bmp files) exists on the path containing the code (the above .m file).
To get a list of valid image formats. Refer:- https://www.mathworks.com/help/matlab/ref/imformats.html
Also make sure that in the line:-
% Creating new template
NewTemplates = [alphabets numbers];
The arrays alphabets and numbers should be compatible for horizontal concatenation.

1 件のコメント

Kartikey Rai
Kartikey Rai 2019 年 10 月 15 日
Thank you so much!

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

その他の回答 (0 件)

カテゴリ

ヘルプ センター および File ExchangeConvert Image Type についてさらに検索

Community Treasure Hunt

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

Start Hunting!

Translated by