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

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

To format properly your code: http://www.mathworks.com/matlabcentral/answers/7885-tutorial-how-to-format-your-question
Ans as I said in the previous your post, you don't need the loop.

Sign in to comment.

Answers (1)

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.

Asked:

ong
on 28 Jul 2011

Community Treasure Hunt

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

Start Hunting!