Why am i getting different result from matrix grayscale in my base and matrix value from imwrite the grayscale data in my base?

1 vue (au cours des 30 derniers jours)
Please help me, i have matrixes value in my base. There are grayscale value from rgb2gray and matrix value from imread image where the image is result from imwrite grayscale value in my base. But, after i check it the value are different each other. Please tell me why they are different?
  4 commentaires
Walter Roberson
Walter Roberson le 19 Juin 2018
Are you perhaps using jpeg? The values stored for jpg will not match what you asked imwrite to save unless you tell it to use lossless compression.
Dicki Andrea
Dicki Andrea le 19 Juin 2018
Yes, i used it. I dont know that 'jpeg' is the problem. What should i do?

Connectez-vous pour commenter.

Réponses (1)

Walter Roberson
Walter Roberson le 19 Juin 2018
When you write data to a JPEG image, never expect to be able to read back exactly the same data again, unless you used 'Mode', 'lossless'. (Note: in my decades, I have only ever seen one genuine lossless jpeg that wasn't not just an artificial image to prove that JPEG can write lossless images.)
We recommend that you write using PNG or TIFF or BMP images.

Catégories

En savoir plus sur Denoising and Compression dans Help Center et File Exchange

Produits


Version

R2017a

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by