That code has nothing to do with image processing - it's to do with finding the intersection point of two lines given their start and end points as three dimensional coordinates.

That's just simple geometry!

I can only assume that what you are trying to do is different: it's finding an intersection point of two lines in an image without having the coordinates, which means you have to find the lines on an image and then identify a coordinate at which they intersect.

I don't thank the code you found is going to help you in the least ... I'd start by thinking about exactly what you are trying to do that you think this is necessary, and start again from that instead of trying to proceed from a "random lump of internet code" that you don't understand.

15,877,915 members

If you have the start and end Points for two lines, I can share C# code that will tell you whether they intersect, and, if they do intersect, the point where they intersect.