本文整理汇总了C#中IplImage.Zero方法的典型用法代码示例。如果您正苦于以下问题:C# IplImage.Zero方法的具体用法?C# IplImage.Zero怎么用?C# IplImage.Zero使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类IplImage
的用法示例。
在下文中一共展示了IplImage.Zero方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: RetrieveFleshRegion
/// <summary>
/// バックプロジェクションにより肌色領域を求める
/// </summary>
/// <param name="imgSrc"></param>
/// <param name="hsvPlanes"></param>
/// <param name="imgRender"></param>
private void RetrieveFleshRegion(IplImage imgSrc, IplImage[] hsvPlanes, IplImage imgDst)
{
int[] histSize = new int[] {30, 32};
float[] hRanges = {0.0f, 20f};
float[] sRanges = {50f, 255f};
float[][] ranges = {hRanges, sRanges};
imgDst.Zero();
using (CvHistogram hist = new CvHistogram(histSize, HistogramFormat.Array, ranges, true))
{
hist.Calc(hsvPlanes, false, null);
float minValue, maxValue;
hist.GetMinMaxValue(out minValue, out maxValue);
hist.Normalize(imgSrc.Width * imgSrc.Height * 255 / maxValue);
hist.CalcBackProject(hsvPlanes, imgDst);
}
}
示例2: DebugShowOldLabel
public void DebugShowOldLabel(IplImage oldLabels)
{
using (IplImage img = new IplImage(oldLabels.Size, BitDepth.U8, 1))
{
img.Zero();
for (int r = 0; r < img.Height; r++)
{
for (int c = 0; c < img.Width; c++)
{
try
{
if (oldLabels[r, c] != 0)
img[r, c] = 255;
}
catch
{
throw;
}
}
}
CvWindow.ShowImages("old", img);
}
}
示例3: DebugShow
/// <summary>
///
/// </summary>
public void DebugShow()
{
using (IplImage img = new IplImage(Cols, Rows, BitDepth.U8, 1))
{
img.Zero();
for (int r = 0; r < Rows; r++)
{
for (int c = 0; c < Cols; c++)
{
if (Values[r, c] != 0)
img[r, c] = 255;
}
}
CvWindow.ShowImages(img);
}
}
示例4: FilterByMaximalBlob
/// <summary>
/// ラベリングにより最大の面積の領域を残す
/// </summary>
/// <param name="imgSrc"></param>
/// <param name="imgRender"></param>
private void FilterByMaximalBlob(IplImage imgSrc, IplImage imgDst)
{
CvBlobs blobs = new CvBlobs();
imgDst.Zero();
blobs.Label(imgSrc);
CvBlob max = blobs.GreaterBlob();
if (max == null)
return;
blobs.FilterByArea(max.Area, max.Area);
blobs.FilterLabels(imgDst);
}