123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293 |
-
- namespace YOLODetectProcessLib
- {
- /// <summary>
- /// 在规整图像(使其尺寸符合网络输入尺寸)时的一些元信息
- /// 在将网络输出结果坐标转换到原始图像坐标时,需要这些信息
- /// </summary>
- public struct MoldedImageMetas
- {
- /// <summary>
- /// 网络中输入图像层的高度
- /// </summary>
- public int NetImgInputHeight { get; set; }
- /// <summary>
- /// 网络中输入图像层的宽度
- /// </summary>
- public int NetImgInputWidth { get; set; }
- /// <summary>
- /// 网络中输入图像层的通道数
- /// </summary>
- public int NetImgInputChannels { get; set; }
- /// <summary>
- /// 原始图像的高度
- /// </summary>
- public int OrigImgHeight { get; set; }
- /// <summary>
- /// 原始图像的宽度
- /// </summary>
- public int OrigImgWidth { get; set; }
- /// <summary>
- /// 在原始图像上感兴趣区域的左上点纵坐标
- /// </summary>
- public int ROIRectTop { get; set; }
- /// <summary>
- /// 在原始图像上感兴趣区域的左上点横坐标
- /// </summary>
- public int ROIRectLeft { get; set; }
- /// <summary>
- /// 在原始图像上感兴趣区域的高度
- /// </summary>
- public int ROIRectHeight { get; set; }
- /// <summary>
- /// 在原始图像上感兴趣区域的宽度
- /// </summary>
- public int ROIRectWidth { get; set; }
- /// <summary>
- /// 在将ROI规整成网络所需的尺寸时,上面填充的像素个数
- /// </summary>
- public int MoldTop { get; set; }
- /// <summary>
- /// 在将ROI规整成网络所需的尺寸时,左边填充的像素个数
- /// </summary>
- public int MoldLeft { get; set; }
- /// <summary>
- /// 在将ROI规整成网络所需的尺寸时,ROI实际缩放的高度
- /// </summary>
- public int MoldHeight { get; set; }
- /// <summary>
- /// 在将ROI规整成网络所需的尺寸时,ROI实际缩放的宽度
- /// </summary>
- public int MoldWidth { get; set; }
- public MoldedImageMetas(int netHeight, int netWidth, int netChannel, int origHeight, int origWidth,
- int roiTop, int roiLeft, int roiHeight, int roiWidth, int moldTop, int moldLeft, int moldHeight, int moldWidth)
- {
- NetImgInputHeight = netHeight;
- NetImgInputWidth = netWidth;
- NetImgInputChannels = netChannel;
- OrigImgHeight = origHeight;
- OrigImgWidth = origWidth;
- ROIRectTop = roiTop;
- ROIRectLeft = roiLeft;
- ROIRectHeight = roiHeight;
- ROIRectWidth = roiWidth;
- MoldTop = moldTop;
- MoldLeft = moldLeft;
- MoldHeight = moldHeight;
- MoldWidth = moldWidth;
- }
- }
- }
|