1
$\begingroup$

Ex. I have an image, let's say 100x100 pixels with some shape on it. And a set of straight lines that are passing through origin located at some point of image, for example origin located at point (50, 50). Number of lines determined by step - angle. If step = 15 degrees, then we have 180 / 15 lines. I want to determine points of interesection in efficient way, but all that I came up for now is printing a line on matrix and check for non-zero elements if they overlap non-zero elements of a shape(and check for diagonal connectivity).

$\endgroup$
  • $\begingroup$ Can you provide an example image? $\endgroup$ – kelin Oct 15 '15 at 14:24
0
$\begingroup$

Calculate the straight lines angles with respect to the x-axis

Calculate the angles of each and every point on the contour

Search for points on the contour with same angles as the lines with respect to the origin.

These are the points of line-contour crossing.

| improve this answer | |
$\endgroup$

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.