title: What is the best method of detecting a collision between these two objects in opencv (python)?
body: <p>I am required to prevent an extruder from touching the base of a stage. I chose to use opencv on python to detect collision between the two objects. After researching past posts and reading up on opencv's processing tools I decided to try a few methods. The first method was edge detection which proved to be lacking in position detection. Next I tried using color as an advantage to isolate the needle and the stage, place rectangles surrounding the objects, and then prevent the rectangles from touching. This is proving to be a challenge because the background and needle are pretty much the same color. The last method requires using box-box collision but my guess is that if I am having issues with the second method then this method will also prove difficult. I am thinking about trying out deep learning on opencv, taking a bunch of photos, and the training the program but I am not sure how that would play out since ill be getting feed from video. Can anyone give me any tips? Any algorithms that would be helpful here? I see that the needle is clearly defined due to its edges so how can I use that to my advantage here? Any help is appreciated.</p>
  <p>Photo of needle and stage:</p>
  <p><a href="https://i.stack.imgur.com/OYSPX.jpg" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/OYSPX.jpg" alt="" /></a></p>