Class Map<TColor, TDepth>
A Map is similar to an Image, except that the location of the pixels is defined by its area and resolution
public class Map<TColor, TDepth> : Image<TColor, TDepth>, IXmlSerializable, ISerializable, IEquatable<Image<TColor, TDepth>>, IInputOutputArray, IInputArrayOfArrays, IOutputArrayOfArrays, IOutputArray, IInputArray, IDisposable where TColor : struct, IColor where TDepth : new()
Type Parameters
TColor
The color of this map
TDepth
The depth of this map
- Implements
-
IXmlSerializableIEquatable<Image<TColor, TDepth>>
- Inherited Members
-
Image<TColor, TDepth>.Draw(IInputArrayOfArrays, int, TColor, int, LineType, IInputArray, int, Point)
- Extension Methods
Constructors
Map(RectangleF, PointF)
Create a new Image Map defined by the Rectangle area. The center (0.0, 0.0) of this map is defined by the center of the rectangle. The initial value of the map is 0.0
public Map(RectangleF area, PointF resolution)
Parameters
area
RectangleFThe area this map covers.
resolution
PointFThe resolution of x (y), (e.g. a value of 0.5 means each cell in the map is 0.5 unit in x (y) dimension)
Map(RectangleF, PointF, TColor)
Create a new Image Map defined by the Rectangle area. The center (0.0, 0.0) of this map is defined by the center of the rectangle.
public Map(RectangleF area, PointF resolution, TColor color)
Parameters
area
RectangleFThe area this map covers.
resolution
PointFThe resolution of x (y), (e.g. a value of 0.5 means each cell in the map is 0.5 unit in x (y) dimension)
color
TColorThe initial color of the map
Map(SerializationInfo, StreamingContext)
Constructor used to deserialize runtime serialized object
public Map(SerializationInfo info, StreamingContext context)
Parameters
info
SerializationInfoThe serialization info
context
StreamingContextThe streaming context
Properties
Area
Get the area of this map as a rectangle
public RectangleF Area { get; }
Property Value
ROI
Get or Set the region of interest for this map. To clear the ROI, set it to System.Drawing.RectangleF.Empty
public RectangleF ROI { get; set; }
Property Value
Resolution
Get the resolution of this map as a 2D point
public PointF Resolution { get; }
Property Value
Methods
Copy(RectangleF)
Get a copy of the map in the specific area
public Map<TColor, TDepth> Copy(RectangleF area)
Parameters
area
RectangleFthe area of the map to be retrieve
Returns
- Map<TColor, TDepth>
The area of the map
Draw(IConvexPolygonF, TColor, int)
Draw a convex polygon of the specific color and thickness
public override void Draw(IConvexPolygonF polygon, TColor color, int thickness)
Parameters
polygon
IConvexPolygonFThe convex polygon to be drawn
color
TColorThe color of the convex polygon
thickness
intIf thickness is less than 1, the triangle is filled up
Draw(CircleF, TColor, int, LineType, int)
Draw a Circle of the specific color and thickness
public override void Draw(CircleF circle, TColor color, int thickness = 1, LineType lineType = LineType.EightConnected, int shift = 0)
Parameters
circle
CircleFThe circle to be drawn
color
TColorThe color of the circle
thickness
intIf thickness is less than 1, the circle is filled up
lineType
LineTypeLine type
shift
intNumber of fractional bits in the center coordinates and radius value
Draw(LineSegment2DF, TColor, int, LineType, int)
Draw a line segment in the map
public override void Draw(LineSegment2DF line, TColor color, int thickness, LineType lineType = LineType.EightConnected, int shift = 0)
Parameters
line
LineSegment2DFThe line to be draw
color
TColorThe color for the line
thickness
intThe thickness of the line
lineType
LineTypeLine type
shift
intNumber of fractional bits in the center coordinates and radius value
Draw(RectangleF, TColor, int)
Draw a rectangle in the map
public void Draw(RectangleF rect, TColor color, int thickness)
Parameters
rect
RectangleFThe rectangle to draw
color
TColorThe color for the rectangle
thickness
intThe thickness of the rectangle, any value less than or equal to 0 will result in a filled rectangle
Draw(string, Point, FontFace, double, TColor, int, LineType, bool)
Draw the text using the specific font on the image
public override void Draw(string message, Point bottomLeft, FontFace fontFace, double fontScale, TColor color, int thickness = 1, LineType lineType = LineType.EightConnected, bool bottomLeftOrigin = false)
Parameters
message
stringThe text message to be draw
bottomLeft
PointThe location of the bottom left corner of the font
fontFace
FontFaceFont type.
fontScale
doubleFont scale factor that is multiplied by the font-specific base size.
color
TColorThe color of the text
thickness
intThickness of the lines used to draw a text.
lineType
LineTypeLine type
bottomLeftOrigin
boolWhen true, the image data origin is at the bottom-left corner. Otherwise, it is at the top-left corner.
DrawPolyline(PointF[], bool, TColor, int)
Draw the polyline defined by the array of 2D points
public void DrawPolyline(PointF[] pts, bool isClosed, TColor color, int thickness)
Parameters
pts
PointF[]the points that defines the poly line
isClosed
boolif true, the last line segment is defined by the last point of the array and the first point of the array
color
TColorthe color used for drawing
thickness
intthe thinkness of the line
GetObjectData(SerializationInfo, StreamingContext)
A function used for runtime serialization of the object
public override void GetObjectData(SerializationInfo info, StreamingContext context)
Parameters
info
SerializationInfoSerialization info
context
StreamingContextstreaming context
ImagePointToMapPoint(Point)
Map an image point to a Map point
public PointF ImagePointToMapPoint(Point pt)
Parameters
pt
PointThe point on image
Returns
- PointF
The point on map
MapPointToImagePoint(MCvPoint2D64f)
Map a point to a position in the internal image
public Point MapPointToImagePoint(MCvPoint2D64f pt)
Parameters
pt
MCvPoint2D64fThe point on the map
Returns
- Point
The point on the image
MapPointToImagePoint(PointF)
Map a point to a position in the internal image
public Point MapPointToImagePoint(PointF pt)
Parameters
pt
PointFThe point on the map
Returns
- Point
The point on the image