-
Notifications
You must be signed in to change notification settings - Fork 2
/
VP_Contour.cs
35 lines (34 loc) · 1.11 KB
/
VP_Contour.cs
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
using OpenCvSharp;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace VisionProcessor
{
/// <summary>
/// mode: RetrievalModes, Contour retrieval mode
/// method: ContourApproximationModes, Contour approximation method
/// offset: Optional offset by which every contour point is shifted.
/// This is useful if the contours are extracted from the image ROI and then they should be analyzed in the whole image context.
/// </summary>
class VP_Contour :VisionTestCase
{
RetrievalModes mode;
ContourApproximationModes method;
public Point[][] contours;
public HierarchyIndex[] hierarchies;
Point offset;
public VP_Contour() : base()
{
TestName = "findcontour";
}
public override bool run()
{
mode = (RetrievalModes)getValue("mode");
method = (ContourApproximationModes)getValue("method");
Cv2.FindContours(src, out contours, out hierarchies, mode, method);
return true;
}
}
}