Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1,519 changes: 1,519 additions & 0 deletions src/OpenCvSharp/Cv2/Cv2_geometry.cs

Large diffs are not rendered by default.

1,257 changes: 0 additions & 1,257 deletions src/OpenCvSharp/Cv2/Cv2_imgproc.cs

Large diffs are not rendered by default.

Large diffs are not rendered by default.

Large diffs are not rendered by default.

17 changes: 7 additions & 10 deletions src/OpenCvSharp/Modules/dnn/Cv2.Dnn.cs
Original file line number Diff line number Diff line change
Expand Up @@ -62,23 +62,20 @@ public static partial class Dnn

/// <summary>
/// Read deep learning network represented in one of the supported formats.
///
/// This function automatically detects an origin framework of trained model
/// and calls an appropriate function such @ref readNetFromCaffe, @ref readNetFromTensorflow,
///
/// This function automatically detects an origin framework of trained model
/// and calls an appropriate function such @ref readNetFromTensorflow, @ref readNetFromONNX,
/// or @ref readNetFromModelOptimizer. The Caffe, Darknet and Torch parsers were removed in OpenCV 5.
/// </summary>
/// <param name="model">Binary file contains trained weights. The following file
/// * extensions are expected for models from different frameworks:
/// * * `*.caffemodel` (Caffe, http://caffe.berkeleyvision.org/)
/// * * `*.pb` (TensorFlow, https://www.tensorflow.org/)
/// * * `*.t7` | `*.net` (Torch, http://torch.ch/)
/// * * `*.weights` (Darknet, https://pjreddie.com/darknet/)
/// * * `*.bin` (DLDT, https://software.intel.com/openvino-toolkit)</param>
/// * * `*.onnx` (ONNX, https://onnx.ai/)
/// * * `*.bin` (OpenVINO, https://software.intel.com/openvino-toolkit)</param>
/// <param name="config">Text file contains network configuration. It could be a
/// * file with the following extensions:
/// * * `*.prototxt` (Caffe, http://caffe.berkeleyvision.org/)
/// * * `*.pbtxt` (TensorFlow, https://www.tensorflow.org/)
/// * * `*.cfg` (Darknet, https://pjreddie.com/darknet/)
/// * * `*.xml` (DLDT, https://software.intel.com/openvino-toolkit)</param>
/// * * `*.xml` (OpenVINO, https://software.intel.com/openvino-toolkit)</param>
/// <param name="framework">Explicit framework name tag to determine a format.</param>
/// <returns></returns>
/// <param name="engine">DNN engine to use. <see cref="EngineType.Auto"/> tries the new engine first and falls back to the classic one.</param>
Expand Down
17 changes: 7 additions & 10 deletions src/OpenCvSharp/Modules/dnn/Net.cs
Original file line number Diff line number Diff line change
Expand Up @@ -146,23 +146,20 @@ private void InitSafeHandle(IntPtr p, bool ownsHandle = true)

/// <summary>
/// Read deep learning network represented in one of the supported formats.
///
/// This function automatically detects an origin framework of trained model
/// and calls an appropriate function such @ref readNetFromCaffe, @ref readNetFromTensorflow,
///
/// This function automatically detects an origin framework of trained model
/// and calls an appropriate function such @ref readNetFromTensorflow, @ref readNetFromONNX,
/// or @ref readNetFromModelOptimizer. The Caffe, Darknet and Torch parsers were removed in OpenCV 5.
/// </summary>
/// <param name="model">Binary file contains trained weights. The following file
/// * extensions are expected for models from different frameworks:
/// * * `*.caffemodel` (Caffe, http://caffe.berkeleyvision.org/)
/// * * `*.pb` (TensorFlow, https://www.tensorflow.org/)
/// * * `*.t7` | `*.net` (Torch, http://torch.ch/)
/// * * `*.weights` (Darknet, https://pjreddie.com/darknet/)
/// * * `*.bin` (DLDT, https://software.intel.com/openvino-toolkit)</param>
/// * * `*.onnx` (ONNX, https://onnx.ai/)
/// * * `*.bin` (OpenVINO, https://software.intel.com/openvino-toolkit)</param>
/// <param name="config">Text file contains network configuration. It could be a
/// * file with the following extensions:
/// * * `*.prototxt` (Caffe, http://caffe.berkeleyvision.org/)
/// * * `*.pbtxt` (TensorFlow, https://www.tensorflow.org/)
/// * * `*.cfg` (Darknet, https://pjreddie.com/darknet/)
/// * * `*.xml` (DLDT, https://software.intel.com/openvino-toolkit)</param>
/// * * `*.xml` (OpenVINO, https://software.intel.com/openvino-toolkit)</param>
/// <param name="framework">Explicit framework name tag to determine a format.</param>
/// <returns></returns>
/// <param name="engine">DNN engine to use. <see cref="EngineType.Auto"/> tries the new engine first and falls back to the classic one.</param>
Expand Down
18 changes: 18 additions & 0 deletions src/OpenCvSharp/Modules/geometry/Enum/MSTAlgorithm.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
namespace OpenCvSharp;

// ReSharper disable InconsistentNaming
/// <summary>
/// Algorithms available for building a Minimum Spanning Tree (MST). See <see cref="Cv2.BuildMST"/>.
/// </summary>
public enum MSTAlgorithm
{
/// <summary>
/// Prim's algorithm.
/// </summary>
Prim = 0,

/// <summary>
/// Kruskal's algorithm.
/// </summary>
Kruskal = 1
}
27 changes: 27 additions & 0 deletions src/OpenCvSharp/Modules/geometry/MSTEdge.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
using System.Runtime.InteropServices;

#pragma warning disable CA1051

namespace OpenCvSharp;

/// <summary>
/// Represents an edge in a graph for Minimum Spanning Tree (MST) computation. See <see cref="Cv2.BuildMST"/>.
/// </summary>
[StructLayout(LayoutKind.Sequential)]
public record struct MSTEdge(int Source, int Target, double Weight)
{
/// <summary>
/// Source node index.
/// </summary>
public int Source = Source;

/// <summary>
/// Target node index.
/// </summary>
public int Target = Target;

/// <summary>
/// Edge weight.
/// </summary>
public double Weight = Weight;
}
2 changes: 1 addition & 1 deletion src/OpenCvSharp/Modules/imgproc/Moments.cs
Original file line number Diff line number Diff line change
Expand Up @@ -147,7 +147,7 @@ public Moments(IEnumerable<Point2f> array, bool binaryImage = false)
private void InitializeFromInputArray(InputArray array, bool binaryImage)
{
NativeMethods.HandleException(
NativeMethods.imgproc_moments(array.Proxy, binaryImage ? 1 : 0, out var m));
NativeMethods.geometry_moments(array.Proxy, binaryImage ? 1 : 0, out var m));
GC.KeepAlive(array.Source);
Initialize(m.m00, m.m10, m.m01, m.m20, m.m11, m.m02, m.m30, m.m21, m.m12, m.m03);
}
Expand Down
Loading
Loading