MinhTNguyen
MinhTNguyen

Reputation: 13

python OpenCV mask ROI of a PCB trace

I have a gray-scaled image of a printed circuit board. I would like to highlight the trace connection from point A to point B if I double click on either point. I see the gray intensity different here (pad, trace, and area around trace with higher, medium, and lower gray value respectively), but I do not know how to accomplish this with python-OpenCV.

Is there an existing algorithm to mask a ROI of the trace connection with the gray-value intensity difference like how I describe above i.e., not a rectangular or circular ROI? Something similar to loop from mouse-clicked pixel to all direction, check the intensity change, then mask the ROI that covers only the trace area?

Annotated Image

Original Image

Upvotes: 0

Views: 379

Answers (1)

MinhTNguyen
MinhTNguyen

Reputation: 13

I find ImageJ Wand Tool is a very nice algorithm for this. I re-write the autoOutline function (in FourConnected mode without inner-hole detection). I then create a filled Polygon with the results sets of points. The TraceEdge function is mainly what I am looking for.

Upvotes: 0

Related Questions