count each row white pixels from the bottom to the top
Mostrar comentarios más antiguos
i'm doing car plate localization project. now i wanna count each row white pixels from the bottom to the top. below is my code. thanks for advice.
[code] clc;clear all; % resize input = imread('1.jpg') I = imresize (input, [288 768]); J = rgb2gray(I); L = medfilt2 (J, [5 5]); BW1 = edge(L,'sobel'); [x y]=size(BW1); imtool(BW1);
for i=1:x sumAlongRow = sum (sum (BW1==1));% Gives horizontal "profile." end [/code]
2 comentarios
Oleg Komarov
el 28 de Jul. de 2011
To format the code, select it and click the {} button, thanks.
ong
el 28 de Jul. de 2011
Respuesta aceptada
Más respuestas (1)
Image Analyst
el 30 de Jul. de 2011
0 votos
BW1 is already binary. You don't need to do BW1==1. Just use BW1 directly.
Categorías
Más información sobre Image Filtering and Enhancement en Centro de ayuda y File Exchange.
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!