count each row white pixels from the bottom to the top
Afficher commentaires plus anciens
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 commentaires
Oleg Komarov
le 28 Juil 2011
To format the code, select it and click the {} button, thanks.
ong
le 28 Juil 2011
Réponse acceptée
Plus de réponses (1)
Image Analyst
le 30 Juil 2011
0 votes
BW1 is already binary. You don't need to do BW1==1. Just use BW1 directly.
Catégories
En savoir plus sur Image Filtering and Enhancement dans Centre d'aide et File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!