Browse Source

Fixed the NetStandard1_4 build.

pull/262/head
Canming Huang 6 years ago
parent
commit
057f56b982
  1. 12
      Emgu.CV.Cuda/GpuMat.cs
  2. 1
      Emgu.CV.World/NetStandard1_4/Emgu.CV.World.NetStandard1_4.csproj
  3. 17
      Emgu.CV/Core/Image.cs
  4. 14
      Emgu.CV/Core/Map.cs

12
Emgu.CV.Cuda/GpuMat.cs

@ -500,13 +500,11 @@ namespace Emgu.CV.Cuda
IImage[] IImage.Split()
{
return
#if NETFX_CORE || NETSTANDARD1_4
Extensions.
#else
Array.
#endif
ConvertAll(Split(null), (m) => (IImage)m);
GpuMat[] channels = Split();
IImage[] result = new IImage[channels.Length];
for (int i = 0; i < result.Length; i++)
result[i] = (IImage)channels[i];
return result;
}
/// <summary>

1
Emgu.CV.World/NetStandard1_4/Emgu.CV.World.NetStandard1_4.csproj

@ -28,6 +28,7 @@
<ItemGroup>
<PackageReference Include="System.Drawing.Primitives" Version="4.3.0" />
<PackageReference Include="System.Runtime" Version="4.3.1" />
<PackageReference Include="System.Runtime.InteropServices.RuntimeInformation" Version="4.3.0" />
</ItemGroup>

17
Emgu.CV/Core/Image.cs

@ -792,9 +792,11 @@ namespace Emgu.CV
/// <param name="thickness"> If thickness is less than 1, the triangle is filled up </param>
public virtual void Draw(IConvexPolygonF polygon, TColor color, int thickness)
{
Point[] vertices =
PointF[] polygonVertices = polygon.GetVertices();
Array.ConvertAll<PointF, Point>(polygon.GetVertices(), Point.Round);
Point[] vertices = new Point[polygonVertices.Length];
for (int i = 0; i < polygonVertices.Length; i++)
vertices[i] = Point.Round(polygonVertices[i]);
if (thickness > 0)
DrawPolyline(vertices, true, color, thickness);
@ -2951,7 +2953,7 @@ namespace Emgu.CV
/// <typeparam name="TOtherDepth">The depth type of the result image</typeparam>
/// <param name="converter">The function to be applied to the image pixels</param>
/// <returns>The result image</returns>
public Image<TColor, TOtherDepth> Convert<TOtherDepth>(Converter<TDepth, TOtherDepth> converter)
public Image<TColor, TOtherDepth> Convert<TOtherDepth>(Func<TDepth, TOtherDepth> converter)
where TOtherDepth : new()
{
Image<TColor, TOtherDepth> res = new Image<TColor, TOtherDepth>(Size);
@ -4105,11 +4107,12 @@ namespace Emgu.CV
#region IImage
IImage[] IImage.Split()
{
return
Image<Gray, TDepth>[] channels = Split();
IImage[] result= new IImage[channels.Length];
for (int i = 0; i < result.Length; i++)
result[i] = (IImage) channels[i];
return result;
Array.ConvertAll<Image<Gray, TDepth>, IImage>(
Split(),
delegate (Image<Gray, TDepth> img) { return (IImage)img; });
}
#endregion

14
Emgu.CV/Core/Map.cs

@ -244,9 +244,11 @@ namespace Emgu.CV
/// <param name="thickness"> If thickness is less than 1, the triangle is filled up </param>
public override void Draw(IConvexPolygonF polygon, TColor color, int thickness)
{
Point[] pts = Array.ConvertAll<PointF, Point>(
polygon.GetVertices(),
MapPointToImagePoint);
PointF[] polygonVertices = polygon.GetVertices();
Point[] pts = new Point[polygonVertices.Length];
for (int i = 0; i < polygonVertices.Length; i++)
pts[i] = MapPointToImagePoint(polygonVertices[i]);
if (thickness > 0)
base.DrawPolyline(pts, true, color, thickness);
@ -279,8 +281,12 @@ namespace Emgu.CV
/// <param name="thickness">the thinkness of the line</param>
public void DrawPolyline(PointF[] pts, bool isClosed, TColor color, int thickness)
{
Point[] mapPts = new Point[pts.Length];
for (int i = 0; i < mapPts.Length; i++)
pts[i] = MapPointToImagePoint(pts[i]);
base.DrawPolyline(
Array.ConvertAll<PointF, Point>(pts, MapPointToImagePoint),
mapPts,
isClosed,
color,
thickness);

Loading…
Cancel
Save