finding white pixel regions

I have an image,i want to split that image vertically and find which side has more white pixels,my image is binary type

 채택된 답변

Image Analyst
Image Analyst 2012년 1월 25일

0 개 추천

% Get the dimensions of the image.
[rows columns] = size(binaryImage);
% Find the middle column
middleColumn = columns/2;
% Count the number of 1's in each half.
leftHalfOnes = nnz(binaryImage(:,1:middleColumn))
rightHalfOnes = nnz(binaryImage(:,middleColumn+1:end))

댓글 수: 4

FIR
FIR 2012년 1월 25일
Thanks image analyst
i want another help from you .. can u tell where i get codes for PSO ,i have to apply PSO ,i have query image feature extracted,and 80 image feature extracted ,not i want to move the images closer to query image,according to their euclidean distance,i have concatanated all distance in one variable ,distanceplease tell hoew to apply PSO for thi s
Image Analyst
Image Analyst 2012년 1월 25일
I don't have any - check the File Exchange.
FIR
FIR 2012년 1월 25일
ok can u send links for that
Image Analyst
Image Analyst 2012년 1월 25일
Did you look for it? Did you look up near the top of this page? There are blue letters that say "File Exchange" If you can't see it, then here it is: http://www.mathworks.com/matlabcentral/fileexchange/

댓글을 달려면 로그인하십시오.

추가 답변 (1개)

Andrew
Andrew 2012년 1월 24일

0 개 추천

If your image is logical, then you could easily do this using the function "nnz", which gives you the number of non-zeros a matrix. Alternatively, you could just sum each side of the image if the "white pixels" are 1's.
Andrew

댓글 수: 1

FIR
FIR 2012년 1월 25일
but andrew how to split the image vertically

댓글을 달려면 로그인하십시오.

카테고리

도움말 센터File Exchange에서 Image Processing Toolbox에 대해 자세히 알아보기

질문:

FIR
2012년 1월 24일

Community Treasure Hunt

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

Start Hunting!

Translated by