# Check defects are align or not using opencv python

**URL:** <https://forum.opencv.org/t/check-defects-are-align-or-not-using-opencv-python/11150>\
**Category:** Python\
**Created:** [November 29, 2022, 11:07am UTC](https://forum.opencv.org/t/check-defects-are-align-or-not-using-opencv-python/11150 "2022-11-29T11:07:41Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![Ridham](https://avatars.discourse-cdn.com/v4/letter/r/59ef9b/32.png) [@Ridham](https://forum.opencv.org/u/Ridham)\
**Post date:** [November 29, 2022, 11:07am UTC](https://forum.opencv.org/t/check-defects-are-align-or-not-using-opencv-python/11150/1 "2022-11-29T11:07:41Z")

</div>

Hello everyone,

Currently, I’m working on one project that is based on ndt X-ray defect detection.

For that, there are many acceptance criteria. One of the criteria is whether defects are aligned or not.

I predict all defects using a deep-learning model and return starting and ending points of the defects.

So based on these points how can I find whether defects are aligned or not if yes then I draw one reference line in the image.

I attached one image for reference.

![116](https://us1.discourse-cdn.com/flex020/uploads/opencv/original/2X/4/44a33f26f0da1faf2190af6a513eee57f1546c6d.jpeg)

The yellow line is the reference line, it is passing throw defects (This line is drawn with the help of paint).

Thank you.

---

<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:** [November 29, 2022, 6:21pm UTC](https://forum.opencv.org/t/check-defects-are-align-or-not-using-opencv-python/11150/2 "2022-11-29T18:21:06Z")

</div>

RANSAC on the point set, with the model being a line.
