我一直在尝试按照 OpenCv for Unity 上的结构光格雷码教程(它是 OpenCV java 的端口)来重新创建结构光函数
https://docs.opencv.org/4.1.2/dc/da9/tutorial_decode_graycode_pattern.html
这些教程看起来很简单,但我认为它们现在可能已经过时了。例如,API 的格雷码部分不再有“解码”功能 https://docs.opencv.org/trunk/d1/dec/classcv_1_1structured__light_1_1GrayCodePattern.html
Mat disparityMap;
bool decoded = graycode->decode(captured_pattern, disparityMap, blackImages, whiteImages,
structured_light::DECODE_3D_UNDERWORLD);
相反,我认为我可能需要以某种方式使用 getProjPixel() ?我找不到使用此在线想法的任何其他示例。
这是我对如何使用它的粗略想法
for(int x = 0; x < 1920; x++)
{
for(int y = 0; y < 1080; y++)
{
Point thepoint= new Point(-1,-1);
grayCode.getProjPixel(photosCam1, x, y, thepoint );
projPix.Add(thepoint);
}
}
但我完全不知道接下来我要做什么来从中获得点云(并最终获得统一的网格),或者我是否正在走正确的方向
最佳答案
不幸的是,答案似乎是 OpenCV 的 Java 端口在结构光模块方面并不完整。所以基本上没有办法真正解码java捕获的图像(或unity的后续端口)
太糟糕了!
关于java - OpenCV 结构光 getProjPixel() 示例,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/59043044/