python - OpenCV mat::convertTo in python

前端 未结 3 1292
时光说笑
时光说笑 2020-12-03 13:55

Is there any function in the OpenCV python wrapper that does the same thing as Mat\'s convertTo method in OpenCV 2?

I basically want to call this function in python

3条回答
  •  甜味超标
    2020-12-03 14:26

    If you are not trying to convert the data type, use this:

    cv2.convertScaleAbs(image, result, alpha, beta)
    

    where alpha is you scale factor and beta is a shift value. More details in the OpenCV docs.

提交回复
热议问题