-
Notifications
You must be signed in to change notification settings - Fork 33
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
in JPEG2000, CompressionRatioFactor is different in the image #29
Comments
The ratio is recalculated from the result, see this code. I guess the result differs in openJPEG due to the wavelet decomposition and an approximation to obtain a certain number of bytes, see the documentation https://github.com/uclouvain/openjpeg/wiki/DocJ2KCodec |
The problem lies in how you compute the compressed length:
You seem to assume that the size of the buffer didn't change, and that the size of each element changed, when in fact it's both. You should compute the ratio based on the size of the buffer in bytes.
comp.mem_pos is the size of the compressed buffer. |
I'm not sure I follow the reasoning.
For compressedLength, the Mat object is used only to store the compressed bytes. It is not an image, buf.elemSize() is always egual to 1. |
If you think something is wrong with the current code, please publish a PR. |
problem:
result:
default value for CompressionRatioFactor is 10
LossyImageCompressionRatio is 13.332180546726
expected:
LossyImageCompressionRatio should be 10
The text was updated successfully, but these errors were encountered: