How to store the perimeter pixels of a semi circle in an array that is drawn over an binary image?

3 views (last 30 days)
I have a binary image and I want to draw a circle over this image so that it crosses all the active fingers. After that I only want to consider half of the circle(only going over the upper part of the image this will remove lower circle part i.e.the wrist part). Next want to store all the perimeter pixels to an array. How to do that ?

Answers (1)

KSSV
KSSV on 19 Apr 2018
I = imread('P1_G5_4.png') ;
imshow(I)
hold on
[y,x] = find(I==0) ;
% Centre of circle 
C = [mean(x) mean(y)] ;
% GEt radius of circle 
R = max(sqrt((C(1)-x).^2+(C(2)-y).^2)) ;
th = linspace(0,2*pi) ;
xc = C(1)+R*cos(th) ;
yc = C(2)+R*sin(th) ;
plot(xc,yc,'r') ;
  1 Comment
Zara Khan
Zara Khan on 21 Apr 2018
This is not applicable when complementing the image. Moreover I asked about the semi circle which will cross all the fingers. And want to store those semi circle perimeter pixels values to an array .

Sign in to comment.

Categories

Find more on Images in Help Center and File Exchange

Community Treasure Hunt

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

Start Hunting!