finding white pixel regions

1 回表示 (過去 30 日間)
FIR
FIR 2012 年 1 月 24 日
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 日
% 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 日
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 日
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

サインインしてコメントする。

Community Treasure Hunt

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

Start Hunting!

Translated by