# Contour tracing or line following methods

**URL:** <https://forum.opencv.org/t/contour-tracing-or-line-following-methods/6761>\
**Category:** Uncategorized\
**Created:** [December 16, 2021, 12:42am UTC](https://forum.opencv.org/t/contour-tracing-or-line-following-methods/6761 "2021-12-16T00:42:54Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![VE1MSG](https://avatars.discourse-cdn.com/v4/letter/v/73ab20/32.png) [@VE1MSG](https://forum.opencv.org/u/VE1MSG)\
**Post date:** [December 16, 2021, 12:42am UTC](https://forum.opencv.org/t/contour-tracing-or-line-following-methods/6761/1 "2021-12-16T00:42:54Z")

</div>

Hi, Does anybody know if openCV has any contour tracing or line following methods? I’m new to openCV. Thanks

---

<div class="post-metadata">

**Author:** ![crackwitz](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.opencv.org/crackwitz/32/14_2.png) [@crackwitz](https://forum.opencv.org/u/crackwitz)\
**Post date:** [December 16, 2021, 1:15pm UTC](https://forum.opencv.org/t/contour-tracing-or-line-following-methods/6761/2 "2021-12-16T13:15:00Z")

</div>

please clarify and give context. use pictures to explain.

---

<div class="post-metadata">

**Author:** ![VE1MSG](https://avatars.discourse-cdn.com/v4/letter/v/73ab20/32.png) [@VE1MSG](https://forum.opencv.org/u/VE1MSG)\
**Post date:** [December 16, 2021, 2:04pm UTC](https://forum.opencv.org/t/contour-tracing-or-line-following-methods/6761/3 "2021-12-16T14:04:10Z")

</div>

Hi, What I mean is for example the binary output of a Canny operator, which is just a narrow line. It would be nice to be able to list each successive “white” pixel in a table or list of each (x,y) coordinate pair for each “white” pixel point. Its kind of a funny question and most of CV software would have no interest in doing that type of operation. But Thank you anyway for your time. Have a good day, Sincerely, Mark

---

<div class="post-metadata">

**Author:** ![crackwitz](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.opencv.org/crackwitz/32/14_2.png) [@crackwitz](https://forum.opencv.org/u/crackwitz)\
**Post date:** [December 16, 2021, 6:29pm UTC](https://forum.opencv.org/t/contour-tracing-or-line-following-methods/6761/4 "2021-12-16T18:29:27Z")

</div>

**`cv::findNonZero`**

but that gives a “set”, without specified order

and there’s a high probability that you’re going down the wrong path because (1) you’re focused on it, as evidenced by your narrow response to “give context” (2) _many_ people who asked for these things usually, after much pulling of teeth, reveal the true problem, for which the picked solution is absolute rubbish, because the toolbox only contained a hammer and that makes everything a nail.

I hope you know what you’re doing. I can’t help without _context_.

---

<div class="post-metadata">

**Author:** ![VE1MSG](https://avatars.discourse-cdn.com/v4/letter/v/73ab20/32.png) [@VE1MSG](https://forum.opencv.org/u/VE1MSG)\
**Post date:** [December 16, 2021, 8:24pm UTC](https://forum.opencv.org/t/contour-tracing-or-line-following-methods/6761/5 "2021-12-16T20:24:57Z")

</div>

Hi Thank you for your reply. I’m probably not explaining it very well. But you are right, it could mean that what I am looking for, doesn’t really exist. I’m sorry for sending you on a wild goose chase. But Thank you just as well. I appreciate it. Sincerely, Mark

---

<div class="post-metadata">

**Author:** ![pauljurczak](https://avatars.discourse-cdn.com/v4/letter/p/87869e/32.png) [@pauljurczak](https://forum.opencv.org/u/pauljurczak)\
**Post date:** [December 17, 2021, 1:21am UTC](https://forum.opencv.org/t/contour-tracing-or-line-following-methods/6761/6 "2021-12-17T01:21:53Z")

</div>

Yes, `findContours` function: [OpenCV: Structural Analysis and Shape Descriptors](https://docs.opencv.org/4.x/d3/dc0/group __imgproc__ shape.html#gadf1ad6a0b82947fa1fe3c3d497f260e0)
