How to follow only the black line of an image

조회 수: 2 (최근 30일)
Mech Stud
Mech Stud 2018년 3월 21일
댓글: Mech Stud 2018년 3월 22일
I want to follow the black line on this image and get the x,y coordinates of it. However if the black line is not completing an edge of an image (as an extra line extruded as shown) I want to neglect those pixels. I want it to work similar to the concept of line following robot where it checks the next two pixel around it in each direction and maybe decide which pixel's [x,y] values it needs to consider

채택된 답변

KSSV
KSSV 2018년 3월 22일
I = imread('1.png') ;
I1 = rgb2gray(I) ;
[y,x] = find(I1==0) ;
(x,y) are the locations of the black line. Now you have the points in hand. You can do what you want.
  댓글 수: 1
Mech Stud
Mech Stud 2018년 3월 22일
Thanks much. It was really really helpful.

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

추가 답변 (0개)

카테고리

Help CenterFile Exchange에서 Geometric Transformation and Image Registration에 대해 자세히 알아보기

Community Treasure Hunt

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

Start Hunting!

Translated by