how to plot a graph which count transitions in a binary image from black to white regions

조회 수: 1 (최근 30일)

채택된 답변

Image Analyst
Image Analyst 2016년 3월 27일
I assume you have the x,y coordinates of the perimeter of the circle. Then you can just use improfile() and call diff() and look for changes of +1.
values = improfile(binaryImage, xCircle, yCircle);
dv = diff(values);
numTransitions = sum(dv==1);
Of course you'll have to take special care at the ends of the array, like if the white part started exactly at element #1 and was zero at the very last element.
  댓글 수: 2
syeda musfia
syeda musfia 2016년 3월 29일
thanku for the response. actually i wanted to count the number of active fingers in the image. can u please show me how to do it.
Image Analyst
Image Analyst 2016년 3월 29일
Well you'll have to examine the profile to see if it's crossing narrow fingers or the much larger palm of the hand.
If you don't want to do that, then you can adapt apps by Dirk - he has lots of hand apps: http://www.mathworks.com/matlabcentral/fileexchange/?term=authorid%3A29180

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

추가 답변 (0개)

카테고리

Help CenterFile Exchange에서 Image Processing Toolbox에 대해 자세히 알아보기

Community Treasure Hunt

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

Start Hunting!

Translated by