count each row white pixels from the bottom to the top
이전 댓글 표시
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
Oleg Komarov
2011년 7월 28일
To format the code, select it and click the {} button, thanks.
ong
2011년 7월 28일
채택된 답변
추가 답변 (1개)
Image Analyst
2011년 7월 30일
0 개 추천
BW1 is already binary. You don't need to do BW1==1. Just use BW1 directly.
카테고리
도움말 센터 및 File Exchange에서 Image Filtering and Enhancement에 대해 자세히 알아보기
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!