how to determine image size png
14 visualizaciones (últimos 30 días)
Mostrar comentarios más antiguos
mohd akmal masud
el 23 de En. de 2021
Respondida: Walter Roberson
el 23 de En. de 2021
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 comentarios
Respuesta aceptada
Walter Roberson
el 23 de En. de 2021
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 comentarios
Más respuestas (0)
Ver también
Categorías
Más información sobre Get Started with Image Processing Toolbox en Help Center y File Exchange.
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!