C++中convertTo对应的python代码

C++中convertTo对应的python代码,第1张

C++中convertTo对应的python代码

C++类型转化代码

Mat_ dst; // dst 需要是3通道浮点型
src.convertTo(dst, CV_32F, 1.0/255.0);

对应python代码:

# python 没有 convertTo
src.astype(np.float32)  # 类型
dst = src/255.0  # 缩放

欢迎分享,转载请注明来源:内存溢出

原文地址:https://54852.com/zaji/5651752.html

(0)
打赏 微信扫一扫微信扫一扫 支付宝扫一扫支付宝扫一扫
上一篇 2022-12-16
下一篇2022-12-16

发表评论

登录后才能评论

评论列表(0条)

    保存