How to reverse image without changing the resolution

4 ビュー (過去 30 日間)
N Rh
N Rh 2018 年 1 月 29 日
コメント済み: Guillaume 2018 年 1 月 30 日
Hi, I used the function fliplr to reverse an image with 300ppp but the image in output is with 72ppp. I want to reverse the image without changing the resolution. The code used is: I = imread(filename); B=fliplr(I); imwrite(B,...);

回答 (2 件)

Guillaume
Guillaume 2018 年 1 月 29 日
You need to learn a bit more about resolution and particularly understand that it's mostly meaningless and is only a hint to a program when it prints the image onto paper.
Matlab does not let you set the resolution of images when saved to disk (because it is pointless). Whether you say that the resolution is 300ppp, 72ppp or 1500000ppp, the exact same image is saved. That resolution is just saved as a single number alongside the image.
If your image was scanned at 300ppp, then it is still 300ppp after you've flipped it and saved it.
  9 件のコメント
Walter Roberson
Walter Roberson 2018 年 1 月 30 日
Text recognition does not depend on the resolution. For example,
Does your ability to OCR those letters depend upon how far away the skywriting is?
Guillaume
Guillaume 2018 年 1 月 30 日
We're going back to my initial statement: "You need to learn a bit more about resolution and particularly understand that it's mostly meaningless."
See this or this for example.
The only important value is the size of the image in pixels. This has not changed. The resolution in ppi or whatever is completely irrelevant. It's just a statement, the same way that I could show you a photo and tell you that photo is at 300 ppi, then show you the same photo and tell you it's at 72 dpi. It's still the same photo.
For image processing, including OCR, what you call resolution is completely irrelevant and not used for anything.

サインインしてコメントする。


Walter Roberson
Walter Roberson 2018 年 1 月 29 日
Resolution is a tag in the image, with the specific tag mechanism depending on the image format. There are no routines provided for writing JPEG or PNG tags, but see https://www.mathworks.com/matlabcentral/answers/349701-overwrite-an-image-with-new-imfinfo-data#answer_275016
  2 件のコメント
Walter Roberson
Walter Roberson 2018 年 1 月 29 日
Walter Roberson
Walter Roberson 2018 年 1 月 29 日
Also note that with Tiff class, you can have it modify the content of a Tiff image, leaving the tags intact.

サインインしてコメントする。

カテゴリ

Help Center および File ExchangeImages についてさらに検索

Community Treasure Hunt

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

Start Hunting!

Translated by