图像的深度为零是什么意思?
What does it mean that the depth of an image is zero?
在下面的代码中,我正在读取图像并显示它具有的通道数及其深度。
结果是channels:3和depth:0
据我所知,深度应该代表每个通道的位数。
深度为零是什么意思?
代码:
public static void main(String[] args) {
System.loadLibrary(org.opencv.core.Core.NATIVE_LIBRARY_NAME);
Mat imgSrc = new Mat();
imgSrc = Highgui.imread(PATH);
if (imgSrc.empty()) {
System.out.println("image is empty");
return;
}
System.out.println("channels: " + imgSrc.channels());
System.out.println("depth: " + imgSrc.depth());
}
}
如您所见:http://docs.opencv.org/modules/core/doc/basic_structures.html#mat-depth
深度字段不包含实际的位数。它包含在 opencv 库中定义的常量值。您必须检查版本中的那些常量才能回答 0 的含义。
编辑:在我的版本中 CvType。CV_8U == 0。所以你可以期待一个无符号字符。
在下面的代码中,我正在读取图像并显示它具有的通道数及其深度。
结果是channels:3和depth:0
据我所知,深度应该代表每个通道的位数。
深度为零是什么意思?
代码:
public static void main(String[] args) {
System.loadLibrary(org.opencv.core.Core.NATIVE_LIBRARY_NAME);
Mat imgSrc = new Mat();
imgSrc = Highgui.imread(PATH);
if (imgSrc.empty()) {
System.out.println("image is empty");
return;
}
System.out.println("channels: " + imgSrc.channels());
System.out.println("depth: " + imgSrc.depth());
}
}
如您所见:http://docs.opencv.org/modules/core/doc/basic_structures.html#mat-depth 深度字段不包含实际的位数。它包含在 opencv 库中定义的常量值。您必须检查版本中的那些常量才能回答 0 的含义。
编辑:在我的版本中 CvType。CV_8U == 0。所以你可以期待一个无符号字符。