bytedeco / javacv

Java interface to OpenCV, FFmpeg, and more
Other
7.45k stars 1.57k forks source link

When encoding webp images using umat, the quality parameter does not work #2010

Closed jpyo0613 closed 1 year ago

jpyo0613 commented 1 year ago
    fun encodeWebP(uMat: UMat): ByteArray {
        val param = IntPointer(1).put(opencv_imgcodecs.IMWRITE_WEBP_QUALITY, 55)
        val bytePointer = BytePointer()
        opencv_imgcodecs.imencode(".webp", uMat, bytePointer, param)
        val length = bytePointer.limit().toInt()
        val result = ByteArray(length)
        bytePointer.get(result)
        return result
    }

use UMat result = 20230408_003847

use Mat result = 20230408_003901

Is it a bug in javacv or am I using it incorrectly?

saudet commented 1 year ago

Duplicate of https://github.com/bytedeco/javacpp-presets/issues/1345