Need help with my program for number plate recognition.
古いコメントを表示
Hi! I need your help. I tried creating a program for number plate recognition.
So to read the letters on number plate i created an array (NewTemplates) which contains images of all alphabets and numbers (all images are of size [42 24]). I tried checking correlation between the letter on number plate with each element of array NewTemplate.
So for checking correlation I've tried following code
for n=1:length(NewTemplates)
cor=corr2(NewTemplates(1,n),snap);
rec=[rec cor];
end
When I run my program it sends an error that both the inputs in corr2 function are of different sizes but I've already resized the input image (snap) to size [42 24] which is the size of my images of alphabets and numbers.
Can you help me to solve its error? Plzzz... It will be of great help. Thanks in advance.
回答 (1 件)
Image Analyst
2020 年 6 月 12 日
What is NewTemplates? Is it a 3-D array, or a cell array? Try this:
whos NewTemplates
rec = [];
for n = 1 : length(NewTemplates)
thisImage = NewTemplates{n}; % Assume NewTemplates is a cell array.
%thisImage = NewTemplates(:, :, n); % This line assumes NewTemplates is a 3-D array of images stacked up.
thisImage = imresize(thisImage, [size(snap, 1), size(snap, 2)])
size(thisImage) % Show what size it is in the command window.
cor=corr2(thisImage,snap);
rec=[rec, cor];
end
9 件のコメント
Image Analyst
2020 年 6 月 12 日
Are you going to answer my questions??? Did you just forget? And did you also forget to show us the result of the whos command in the command window? And did you forget to try the other option for thisImage I gave below (uncomment it). krishna, you have to help us if we're to help you.
madhan ravi
2020 年 6 月 12 日
編集済み: madhan ravi
2020 年 6 月 12 日
Didn’t you read sir Image Analysts first line?
Change
n = 1:size(NewTemplates,3);
thisImage = NewTemplates(:,:,n); %rest remain unchanged
krishna singh
2020 年 6 月 13 日
Image Analyst
2020 年 6 月 13 日
So NewTemplates is a single 2-D image, not a collection of a bunch of images in a 3-D stacked image or a cell array. And you're doing
for n=1:length(NewTemplates)
cor=corr2(NewTemplates(1,n),snap);
rec=[rec cor];
end
Now length() is the longest of the two dimensions, so with 42 x 864, it will take 864. So NewTemplates(1,n) is taking the n'th column of that array, which is a 42 row by 1 column vector. So now you're trying to correlate that vector with snap. So is snap a 42 row by 1 column vector also? Or is it a 3-D RGB image you've snapped from a camera? Their sizes probably don't match. What does this show
whos snap
Have you made all your template images into row vectors and stored them as rows in the NewTemplates array?
krishna singh
2020 年 6 月 15 日
Image Analyst
2020 年 6 月 15 日
Can you zip all your code and images together and attach the zip file?
krishna singh
2020 年 6 月 15 日
Aliasgar Merchant
2020 年 7 月 31 日
Hi Krishna Singh, i am having the exact same issue. Did it get solved?
krishna singh
2020 年 7 月 31 日
カテゴリ
ヘルプ センター および File Exchange で Language Support についてさらに検索
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!



