1

Suppose you have two points A(12,34) and B(56,78) and you draw a straight line between them. I would like to get all pixels (their coordinates) for my given line. Is there a simple algorithm on that ?

I cant seem to use opencv's LineIterator. Its just not there. I think they did not implement the function in opencv2.

Laimonas Sutkus
  • 3,247
  • 2
  • 26
  • 47

1 Answers1

2

You are looking for Bresenham's Line Algorithm.

gonutz
  • 5,087
  • 3
  • 22
  • 40