Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ch12 dense_mapping.cpp 稠密建图最终保存depth.png图像全黑问题 #323

Open
icefrogplus opened this issue Oct 3, 2024 · 0 comments

Comments

@icefrogplus
Copy link

depth保存的是浮点数,直接表示深度,用cv::imshow()函数会自动拉伸显示灰度信息,但cv::imwrite()函数只是保存值的结果,并不能拉伸显示,要做0~255的拉伸:
main()函数里面修改
// 将深度图像归一化到 0-255 的范围
cv::Mat depth_normalized;
depth.convertTo(depth_normalized, CV_8U, 255.0 *0.4); // 乘0.4和作者显示一样
cv::imwrite("depth.png", depth_normalized); // 保存深度图结果

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant