gpt4 book ai didi

image - 在 OpenCV 2 中将 8 位图像转换为 32 位图像

转载 作者:太空宇宙 更新时间:2023-11-03 21:01:42 31 4
gpt4 key购买 nike

如何将 8 位垫转换为 32 位垫以在 kmeans 函数中使用。我尝试使用 ConvertScale,但编译器说它是一个未知函数。我正在使用 OpenCV 2.3.1 并希望避免使用旧版本的 API 调用。

提前致谢!

最佳答案

你可以使用convertTo

cv::Mat mat = do your thing using CV_8S (or CV_8U)
cv::Mat dst = do your other thing
mat.convertTo(dst, CV_32S);

关于image - 在 OpenCV 2 中将 8 位图像转换为 32 位图像,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/8976502/

31 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com