finding intersections between circle and gear teeth

조회 수: 2 (최근 30일)
behzad
behzad 2019년 10월 26일
답변: Guillaume 2019년 10월 26일
Hi everyone,
I need to find the intersection points between a circle of specific diameter with gear teeth bundaries as specified by red points for a typical tooth. Does anybody have any idea to help?
1.JPG

채택된 답변

Guillaume
Guillaume 2019년 10월 26일
Get the pixels on the boundary with bwboundaries or bwtraceboundary. Calculate their distance to the centre of your circle. Then the absolute difference of that distance with the radius of that circle. Anything that is smaller than an arbitrary small value is your intersection points. Something like:
%input variables:
% yourimage: the binary image
% row_wheelcentre and col_wheelcentre: coordinates of centre of wheel/circle
% radius: the radius of the circle
%output variables
% intersect point: Nx2 matrix containing the N points of the wheel intersecting the circle
boundaries = bwboundaries(yourimage, 'nohole');
%assuming that only one object is detected, or that the gear is the first one:
gearboundary = boundaries{1};
distances = hypot(gearboundary(:, 1) - row_wheelcentre, gearboundary(:, 2) - col_wheelcentre);
intersectpoint = gearboundary(abs(distances - radius) < 1e-5, :); %arbitrary 1e-5 threshold may need adjusting

추가 답변 (0개)

카테고리

Help CenterFile Exchange에서 Gears에 대해 자세히 알아보기

Community Treasure Hunt

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

Start Hunting!

Translated by