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$
1
  • $\begingroup$ Can you provide an example image? $\endgroup$
    – kelin
    Commented Oct 15, 2015 at 14:24

1 Answer 1

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.

$\endgroup$
0

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

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