Table of Contents

Class Map<TColor, TDepth>

Namespace
Emgu.CV
Assembly
Emgu.CV.dll

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

Inheritance
CvArray<TDepth>
Image<TColor, TDepth>
Map<TColor, TDepth>
Implements
IXmlSerializable
IEquatable<Image<TColor, TDepth>>
Inherited Members
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 RectangleF

The area this map covers.

resolution PointF

The 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 RectangleF

The area this map covers.

resolution PointF

The 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 TColor

The initial color of the map

Map(SerializationInfo, StreamingContext)

Constructor used to deserialize runtime serialized object

public Map(SerializationInfo info, StreamingContext context)

Parameters

info SerializationInfo

The serialization info

context StreamingContext

The streaming context

Properties

Area

Get the area of this map as a rectangle

public RectangleF Area { get; }

Property Value

RectangleF

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

RectangleF

Resolution

Get the resolution of this map as a 2D point

public PointF Resolution { get; }

Property Value

PointF

Methods

Copy(RectangleF)

Get a copy of the map in the specific area

public Map<TColor, TDepth> Copy(RectangleF area)

Parameters

area RectangleF

the 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 IConvexPolygonF

The convex polygon to be drawn

color TColor

The color of the convex polygon

thickness int

If 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 CircleF

The circle to be drawn

color TColor

The color of the circle

thickness int

If thickness is less than 1, the circle is filled up

lineType LineType

Line type

shift int

Number 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 LineSegment2DF

The line to be draw

color TColor

The color for the line

thickness int

The thickness of the line

lineType LineType

Line type

shift int

Number 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 RectangleF

The rectangle to draw

color TColor

The color for the rectangle

thickness int

The 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 string

The text message to be draw

bottomLeft Point

The location of the bottom left corner of the font

fontFace FontFace

Font type.

fontScale double

Font scale factor that is multiplied by the font-specific base size.

color TColor

The color of the text

thickness int

Thickness of the lines used to draw a text.

lineType LineType

Line type

bottomLeftOrigin bool

When 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 bool

if true, the last line segment is defined by the last point of the array and the first point of the array

color TColor

the color used for drawing

thickness int

the 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 SerializationInfo

Serialization info

context StreamingContext

streaming context

ImagePointToMapPoint(Point)

Map an image point to a Map point

public PointF ImagePointToMapPoint(Point pt)

Parameters

pt Point

The 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 MCvPoint2D64f

The 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 PointF

The point on the map

Returns

Point

The point on the image