Photonic Chip Image Recognition

I have photos of these photonic chips (top left) for which I need to create and overlay highlighting its shape. I dont get the full chip in the image, only a corner. I have tried using Canny and HoughlinesP to recognize the outside edges but these images arent of the highest quality and the recognized lines are several and very short so i have tried to write my own clustering algorithm that combines them but these lines are hard to work with: Image of houghlines image is bottom left

So I thought ill try to use findcontours to outline the whole square and heres that image: (bottom right)

And i tried filtering by the longest contour to get just the outline of the two sides of the square but that doesnt really work i just get some gibberish dots inside the chip

Im just not sure where to go from here because these sides of the chip arent imaged very well so its hard to get a good one line outline, instead its a bunch of small discontinuous lines. what canny sees is top right by the way

If theres another approach you know I would appreciate any advice.

Yeah, Canny and Hough are newbie traps. Let’s put those aside and back up.

That is a means to some end. What’s the end?

1 Like

The probe, or pick you see facing the chip will align with one of the waveguides and the goal is to use computer vision to recognize both shapes and with precise stage motors be able to align them. The goal is to develop automated photonic integrated circuit characterization setups. And a neural network will be used to do this automatically I think. Im just an intern so this is as far as my knowledge goes about the project.