Ask Your Question

Revision history [back]

click to hide/show revision 1
initial version

Should the OpenCV C++ Core provide a Line class, similar to Point, Rect and Size?

I noticed that despite providing various Point, Rect and Size struct templates, the OpenCV Core C++ headers do not provide struct templates for line equations or line segments.

Are there proposals for adding these to the OpenCV Core C++ headers?

My understanding is that there are two kinds of line classes useful for OpenCV C++ users:

  • A line segment class, denoted by two endpoints. These endpoints are not necessarily confined by some arbitrary bounds (such as the size of the image, or the size of the screen).

  • A line equation class, written in the general form of a*x + b*y + c == 0. See: Linear equation (Wikipedia)

A third kind of line class, known as a "ray" (a line with one starting point and going into infinity in its direction), might be useful to some OpenCV users.

Is there any known impediments or objections that prevent a line class from being added into OpenCV C++ Core?