Filter löschen
Filter löschen

Drawing rectangles around objects and find intersection points

3 Ansichten (letzte 30 Tage)
Jack Smith
Jack Smith am 26 Mär. 2015
Beantwortet: Image Analyst am 26 Mär. 2015
Hi, I have two images as attached below, one contains only logic gates and the other contains only the lines connecting to them. I would like to draw a red rectangle around the each logic gate of the first image (as like shown for AND gate in the image) , then combine (overlap) the first image to the second image using a function like imadd() . Then I would like to find the intersection point coordinates formed between rectangles drawn in first image & the lines of second image.
Someone please provide code for that.
First Image
Second Image

Antworten (1)

Image Analyst
Image Analyst am 26 Mär. 2015
Assuming that the lines do not overlap any of the gates, then call imdilate() to stretch the lines horizontally a pixel, the xor the images with xor(). That will tell you where the lines touch the gates. Pass that image into find() if you want actual row and column locations.

Kategorien

Mehr zu Images finden Sie in Help Center und File Exchange

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by