在 VisionPro Deep Learning 中使用 Cognex VisionPro 图像

VisionPro API 处理实现 ICogImage 的图像,例如 CogImage24PlanarColor 和 CogImage8Grey。Deep Learning API 处理实现 IImage 的图像,例如 WpfImage 和 FormsImage。

注意:
  • ImageExtensions 类包含 ToCogImage 方法,该方法可以将 Deep Learning 图像转换为 ICogImage。

    请注意,生成的 ICogImage 将具有默认的 CoordinateSpaceTree。如果来回转换,您可能希望在从 ICogImage 转换到 IImage 时保留此信息,以便从 IImage 转换到 ICogImage 时可以恢复此信息。

  • 封装器还提供了一个图像类,它由 ICogImage 构成,并在后台将图像转换为实现 IImage 的图像。

下表详细说明了图像类当前接受哪些 ICogImage 类型,以及图像的通道如何根据转换的 ICogImage 类型而变化:

ICogImage 类型 转换图像的通道深度 转换图像中的通道
CogImage8Grey ImageChannelDepth.Depth8 1
CogImage24PlanarColor ImageChannelDepth.Depth8 3
CogImage16Grey ImageChannelDepth.Depth16 1
CogImage16Root ImageChannelDepth.Depth16 1

下表详细说明了哪些 IImage 类型可使用 ToCogImage 扩展方法转换:

IImage 类型 支持 ToCogImage?*
Local.LibraryImage
WpfImage
FormsImage
图像
注意:
  • 所返回的 ICogImage 的类型将取决于通道和通道深度,如上文第一个表格所述。
  • 目前,1 channel/Depth16 图像总是转换为 CogImage16Grey。