Question: When i run this Matlab code from the internet, I have errors in the code which says: Brace indexing is not supported for variables of

When i run this Matlab code from the internet, I have errors in the code which says:

Brace indexing is not supported for variables of this type.

Error in Letter_detection (line 8) cor=corr2(NewTemplates{1,n},snap);

Error in Plate_detection (line 37) letter=Letter_detection(Iprops(i).Image); % Reading the letter corresponding the binary image 'N'.

note: I do have the appropriate files from alpha

When i run this Matlab code from the internet, I have errorsin the code which says: Brace indexing is not supported for variablesof this type. Error in Letter_detection (line 8) cor=corr2(NewTemplates{1,n},snap); Error in Plate_detection

1 2 4 - Editor - F:\circuit digest\Number Plate Detection template_creation.m Plate_detection.m X Letter_detection.m template_creation.mx + *CREATE TEMPLATES Alphabets 3 - 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'); 5 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/0.bmp'); Primread('alpha/P.bmp');Q=imread ('alpha/Q.bmp');R=imread ('alpha/R.bmp'); 9 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/2.bmp'); 0 6 - 7 - 8 - 10 - 11 - 12 13 14 - 15 - Natural 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'); 16 - 17 - 18 - 19 20 21 - 22 23 - 24 25 Creating Array for Alphabets letter=[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]; Creating Array for Numbers number=[one two three four five six seven eight nine zero]; 26 NewTemplates=[letter number]; save ('NewTemplates', 'NewTemplates') clear all 27 Editor - F:\circuit digest\Number Plate Detection Letter_detection.m Plate_detection.mx Letter_detection.m Letter_detection.m x template_creation.m 1 function letter-readLetter (snap) + 2 load NewTemplates snap-imresize (snap, [42 24]); rec=[ ]; for n=1:length (NewTemplates) cor-corr2 (NewTemplates{1,n), snap); rec-[rec cor]; end ind=find (rec==max(rec)); ; display (ind); inds 10 11 12 13 - 14 15 16 - 17 - 18 - 19 - 20 - 21 - 22 - 23 - 24 - 25 - 26 27 - 28 - 29 - 30 - 31 - 32 - 33 - 34 - 35 - 36 37 38 39 40 41 42 Alphabets listings. if ind=1 || ind==2 letter-'A'; elseif ind-=3 || ind-=4 letter-'B'; elseif indsss letter='C'; elseif ind==6 || ind==7 letter='0'; lettere elseif 3 letter='E'; ' elseif ind letter='F'; elseif ind==10 letter='G'; tercie elseif ind=-11 letter='H'; elseif ind==12 letter-'I'; elseif ind--13 . letter-'J'; elseif ind=-14 letter='K'; elseif ind==15 letter='L': elseif ind==16 letter-'M; elseif ind--17 letteren elseif ind--18 || ind=19 letter='0'; elseif ind==20 || ind==21 sadece letter='p'; elseif ind==22 || ind==23 letter='0'; elseif ind-24 1| ind--25 letters'R'; elseif ind=-26 letter='s'; elseif ind=-27 letter='t'; elseif ind=-28 seifind letter='0'; berterim 43 44 45 clocit ind--29 elseif ind--30 elseif inde 31 lecterey '; = letter-'W'; = letter='X'; elseif ind==32 letter='Y'; elseir ind==33 de letter='2'; 46 47 48 - 49 - 50 - 51 52 53 - 54 - 55 - 56 - 57 - 58 - 59 60 - 61 - 62 - 63 - 64 - 65 - 66 - 67 - 68 69 70 71 72 73 74 75 76 77 78 79 - 80 - 81 82 - 83 84 85 - 86 - 87 88 89 90 - 91 - Numerals listings. elseif ind==34 ee letter='l; lettere ar elseif ind==35 = Letters letter='2'; itindas elseif ind==36 Tartu letter='3'; elseif ind==37 || ind==38 letter-4; elseif ind=-39 letter='5'; elseif ind==40 || ind==41 || ind==42 '6'; elseif ind=43 and letter='7'; elseif ind-=44 1| ind==45 letter='3'; elseif ind-46 || ind-=47 11 ind--48 letter-'9'; else letter='0'; end end letters + Editor - F:\circuit digest\Number Plate Detection Plate_detection.m Plate_detection.mx Letter_detection.mx template_creation.mx close all; clear all; im = imread("Number Plate Images/image1.png'); imgray = rgb2gray (im); imbin - imbinarize (imgray); im = edge (imgray, 'prewitt'); 0 0 Below steps are to find location of number plate Iprops-regionprops (im, 'BoundingBox', 'Area', Image') area - Iprops. Area: count - numel (Iprops): maxa= area: boundingBox = Iprops. BoundingBox; for 1-1:count if maxa Iprops (i). Area maxa-Iprops (1) .Area; boundingBox-Iprops (i). BoundingBox; end end 9 10 11 - 12 - 13 - 14 15 16 17 18 19 20 - 21 22 - 23 - 24 25 - 26 27 - 28 29 - 30 - 31 - 32 33 - 34 35 1m = 1mcrop (imbin, boundingBox); tcrop the number plate area im = bwareaopen(-im, 500); $remove some object if it width is too long or too small than 500 [h, w] = size (im); get width imshow (im) Iprops-regionprops (im, 'BoundingBox', 'Area', 'Image'); Sread letter count = numel (Iprops): noPlate=[]; * Initializing the variable of number plate string. 36 - for 1-:count ow = length (Iprops (1). Image (1,:)); oh = length (Iprops (1). Image (:,-)); if ow (h/3) letter-Letter_detection (Iprops (i). Image): Reading the letter corresponding the binary image 'N'. noPlate-[noPlate letter] Appending every subsequent character in noPlate variable. end end 37 38 39 40

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!