count white pixel from the bottom to the top and from the left to the right

1 view (last 30 days)
i'm fresh learner for matlab, now i doing car plate localization project. My supervisor have give this hits to me "A(i,j)=abs(I(i,j)-I(i,j+1))" for count white pixel from the bottom to the top and from the left to the right, however i have no idea about this statement. below is my code i done.
[code]
clc;clear all;
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);
for i=1:x
counts = flipud(sum(BW1 == 1,2));
end
[/code]
thanks for your advice.
  2 Comments
Oleg Komarov
Oleg Komarov on 28 Jul 2011
To format properly your code: http://www.mathworks.com/matlabcentral/answers/7885-tutorial-how-to-format-your-question

Sign in to comment.

Answers (1)

Image Analyst
Image Analyst on 28 Jul 2011
A(i,j)=abs(I(i,j)-I(i,j+1)) has nothing at all to do with the code you posted. To do that, you'd use conv2(), not medfilt2, edge, etc.

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!