本文整理汇总了C#中Window.SetProperty方法的典型用法代码示例。如果您正苦于以下问题:C# Window.SetProperty方法的具体用法?C# Window.SetProperty怎么用?C# Window.SetProperty使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Window
的用法示例。
在下文中一共展示了Window.SetProperty方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: Run
public void Run()
{
var img = Cv2.ImRead(FilePath.Asahiyama, LoadMode.Color);
var hog = new HOGDescriptor();
hog.SetSVMDetector(HOGDescriptor.GetDefaultPeopleDetector());
bool b = hog.CheckDetectorSize();
Console.WriteLine("CheckDetectorSize: {0}", b);
var watch = Stopwatch.StartNew();
// run the detector with default parameters. to get a higher hit-rate
// (and more false alarms, respectively), decrease the hitThreshold and
// groupThreshold (set groupThreshold to 0 to turn off the grouping completely).
Rect[] found = hog.DetectMultiScale(img, 0, new Size(8, 8), new Size(24, 16), 1.05, 2);
watch.Stop();
Console.WriteLine("Detection time = {0}ms", watch.ElapsedMilliseconds);
Console.WriteLine("{0} region(s) found", found.Length);
foreach (Rect rect in found)
{
// the HOG detector returns slightly larger rectangles than the real objects.
// so we slightly shrink the rectangles to get a nicer output.
var r = new Rect
{
X = rect.X + (int)Math.Round(rect.Width * 0.1),
Y = rect.Y + (int)Math.Round(rect.Height * 0.1),
Width = (int)Math.Round(rect.Width * 0.8),
Height = (int)Math.Round(rect.Height * 0.8)
};
img.Rectangle(r.TopLeft, r.BottomRight, Scalar.Red, 3, LineType.Link8, 0);
}
using (var window = new Window("people detector", WindowMode.None, img))
{
window.SetProperty(WindowProperty.Fullscreen, 1);
Cv.WaitKey(0);
}
}