how to determine image size png
13 ビュー (過去 30 日間)
古いコメントを表示
Hi all, anyone can help me how to know the pixel size of one pixel??
my image is medtest.png
>> info = imfinfo('medtest.png')
info =
struct with fields:
Filename: 'C:\Users\Akmal\Documents\MATLAB\Add-Ons\Functions\Region Growing\medtest.png'
FileModDate: '25-Dec-2020 23:21:43'
FileSize: 53631
Format: 'png'
FormatVersion: []
Width: 468
Height: 400
BitDepth: 8
ColorType: 'grayscale'
FormatSignature: [137 80 78 71 13 10 26 10]
Colormap: []
Histogram: []
InterlaceType: 'none'
Transparency: 'none'
SimpleTransparencyData: []
BackgroundColor: []
RenderingIntent: []
Chromaticities: [0.31269 0.32899 0.63999 0.33001 0.3 0.6 0.15 0.05999]
Gamma: 0.45454
XResolution: 2835
YResolution: 2835
ResolutionUnit: 'meter'
XOffset: []
YOffset: []
OffsetUnit: []
SignificantBits: []
ImageModTime: []
Title: []
Author: []
Description: []
Copyright: []
CreationTime: []
Software: []
Disclaimer: []
Warning: []
Source: []
Comment: []
OtherText: []
0 件のコメント
採用された回答
Walter Roberson
2021 年 1 月 23 日
IF you can trust the headers
XResolution: 2835
YResolution: 2835
ResolutionUnit: 'meter'
then the resolution is 2835 pixels per meter, which happens to correspond to 72 pixels per inch.
However, when you see 72 pixels per inch or 100 pixels per inch, you should pretty much assume that nominal values have been written into the headers, that might have no relationship to reality.
There is probably nothing in those headers that you should trust other than the height and width.
You either need external information (e.g., knowledge that it was taken with a microscope with particular settings), or else you need to know the true size of some object in the field of view in order to calculate scales.
0 件のコメント
その他の回答 (0 件)
参考
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!