count each row white pixels from the bottom to the top
Show older comments
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 Comments
Oleg Komarov
on 28 Jul 2011
To format the code, select it and click the {} button, thanks.
ong
on 28 Jul 2011
Accepted Answer
More Answers (1)
Image Analyst
on 30 Jul 2011
0 votes
BW1 is already binary. You don't need to do BW1==1. Just use BW1 directly.
Categories
Find more on Image Filtering 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!