error in template creation
Show older comments
I wish to create template of number and sign to extract the vehicle number plate. I got loading error
"Dimensions of matrices being concatenated are not consistent".
% Create Templates
one=imread('1.png'); two=imread('2.png');
three=imread('3.png');four=imread('4.png');
five=imread('5.png');
zero=imread('0.png');
sign=imread('sign.png');
number=[one two three four five zero ];
character=[number sign];
NewTemplates1=mat2cell(character,7,[24 24 24 24 24 24 24]);
save ('NewTemplates1','NewTemplates1')
clear all
can anyone help me to resolve this?
Accepted Answer
More Answers (1)
Guillaume
on 11 Jan 2018
1 vote
Your code tries to concatenates the images side by side but at least one of the images is not the same height as the others or is grayscale or indexed while the others are RGB. Hence the concatenation is not possible.
You can resolve this in many way:
- concatenate images that are the same height and colour format
- resize your images after loading them so they're all the same height
- pad the smaller images (with black? white?)
It's all up to you.
1 Comment
SHOBA MOHAN
on 14 Jan 2018
Categories
Find more on Logical in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!