Answers.Body: <p>I don't think that more advanced AI would necessarily produce more consistent results. Check something as simple as the <a href="https://en.wikipedia.org/wiki/Prewitt_operator" rel="nofollow noreferrer">Prewitt operator</a>, which is pretty damn good at edge detection. I would suggest starting with something simple, looking at what are the failure edge cases (pun unintended), and only use a more complicated network if the failure cases are plenty and addressable by some more advanced technique.</p>
  
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2022-06-06T13:03:35.817Z
Answers.Text: The problem is that when I detect edges is hard to identify and diferentiate the actual edge lines. For example, in this image first and second from the left are really close, how can I actualy obtain the points that define the lines? Also consider some images have more shadows or lights...
Answers.UserDisplayName: Lluis C
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2022-06-06T13:14:28.227Z
Answers.Text: I suppose this boils down to how you define edges. My previous suggestion would basically identify the boundaries of the object that's on the picture, not just the top "edges" as you call them. Your definition of edges is thus different, more nuanced than the usual ML edge-detection tasks which try to identify outlines of the objects in the picture.
Answers.UserDisplayName: ImotVoksim
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2022-06-06T13:18:53.170Z
Answers.Text: I think your second proposed approach is worth trying. Get the whole outline of the object using whatever edge-detection CNN you have at your disposal and create a function that identifies straight lines that lie on the pixels that correspond to the outline.
Answers.UserDisplayName: ImotVoksim
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2022-06-06T14:18:10.677Z
Answers.Text: thanks, I edited the post to clarify my definition of edges
Answers.UserDisplayName: Lluis C
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2022-06-06T12:46:36.160Z
Answers.LastActivityDate: 2022-06-06T12:46:36.160Z
Answers.UserDisplayName: ImotVoksim
Body: <p>I want to create an AI to detect and identify certain edge lines on my image. The input image is a locker key, and I want to know the exact position of certain edges.</p>
  <p>Sample input image:</p>
  <p><a href="https://i.sstatic.net/hX08l.png" rel="nofollow noreferrer"><img src="https://i.sstatic.net/hX08l.png" alt="enter image description here" /></a></p>
  <p>Sample output image. As output i have each red line position.</p>
  <p><a href="https://i.sstatic.net/CZ7XG.png" rel="nofollow noreferrer"><img src="https://i.sstatic.net/CZ7XG.png" alt="enter image description here" /></a></p>
  <p>I was thinking in finetuning some kind of instace segmentation or even yolo network but maybe there is a better approach. Ideally, I would like the software to be light enoguh to run in a mobilephone.</p>
  <p>I also considered two &quot;simpler&quot; approaches:</p>
  <ul>
  <li>Using corner detection</li>
  <li>Using Unet to get the contour + opencv approxpoly to get straight lines coordinates</li>
  </ul>
  <p>Nevertheless, I believe I would obtain a more consistent result with more advanced AI. (I do have a lot of training images to use)</p>
  
Comments.ContentLicense: CC BY-SA 4.0
Comments.CreationDate: 2022-06-06T13:51:59.343Z
Comments.Text: Please clarify your specific problem or provide additional details to highlight exactly what you need. As it's currently written, it's hard to tell exactly what you're asking.
Comments.UserDisplayName: Community
Comments.ContentLicense: CC BY-SA 4.0
Comments.CreationDate: 2022-06-07T20:25:54.133Z
Comments.Text: Please, put your **specific question** in the title. "Precision edge identification" is not a question and it's also not specific. A question is something like "What is 2+2?".
Comments.UserDisplayName: nbro
Tags: <neural-networks><image-segmentation><yolo><semantic-segmentation><edge-detection>
Title: How to identify and diferentiate several edge lines of an object?
UserDisplayName: Lluis C
ThreadText: # How to identify and diferentiate several edge lines of an object?
  
  (Asked by: username_0 on 2022-06-06)
  
  I want to create an AI to detect and identify certain edge lines on my image. The input image is a locker key, and I want to know the exact position of certain edges.
  
  Sample input image:
  
  [![enter image description here](https://i.sstatic.net/hX08l.png)](https://i.sstatic.net/hX08l.png)
  
  Sample output image. As output i have each red line position.
  
  [![enter image description here](https://i.sstatic.net/CZ7XG.png)](https://i.sstatic.net/CZ7XG.png)
  
  I was thinking in finetuning some kind of instace segmentation or even yolo network but maybe there is a better approach. Ideally, I would like the software to be light enoguh to run in a mobilephone.
  
  I also considered two "simpler" approaches:
  
  * Using corner detection
  * Using Unet to get the contour + opencv approxpoly to get straight lines coordinates
  
  Nevertheless, I believe I would obtain a more consistent result with more advanced AI. (I do have a lot of training images to use)
  
  **Tags:** neural-networks, image-segmentation, yolo, semantic-segmentation, edge-detection
  > **Comments:**
  > **username_1**: Please clarify your specific problem or provide additional details to highlight exactly what you need. As it's currently written, it's hard to tell exactly what you're asking.  
  > **username_2**: Please, put your **specific question** in the title. "Precision edge identification" is not a question and it's also not specific. A question is something like "What is 2+2?".  
  
  ---
  
  ## 1 answers
  
  ### Answer by username_3 on 2022-06-06. Score: 2
  
  I don't think that more advanced AI would necessarily produce more consistent results. Check something as simple as the [Prewitt operator](https://en.wikipedia.org/wiki/Prewitt_operator), which is pretty damn good at edge detection. I would suggest starting with something simple, looking at what are the failure edge cases (pun unintended), and only use a more complicated network if the failure cases are plenty and addressable by some more advanced technique.
  
  > **Comments:**
  > **username_0**: The problem is that when I detect edges is hard to identify and diferentiate the actual edge lines. For example, in this image first and second from the left are really close, how can I actualy obtain the points that define the lines? Also consider some images have more shadows or lights...  
  > **username_3**: I suppose this boils down to how you define edges. My previous suggestion would basically identify the boundaries of the object that's on the picture, not just the top "edges" as you call them. Your definition of edges is thus different, more nuanced than the usual ML edge-detection tasks which try to identify outlines of the objects in the picture.  
  > **username_3**: I think your second proposed approach is worth trying. Get the whole outline of the object using whatever edge-detection CNN you have at your disposal and create a function that identifies straight lines that lie on the pixels that correspond to the outline.  
  > **username_0**: thanks, I edited the post to clarify my definition of edges  
  
  ---
  
  