Looking for pixel as unit

20 views (last 30 days)
Charles
Charles on 26 Nov 2024 at 15:07
Commented: Charles on 26 Nov 2024 at 15:38
Hi everyone,
I've been looking for a MATLAB equivalent to the Python library Astropy.units (I only recently started using MATLAB). I found the Units of Measurement in the Symbolic Math Toolbox, which satisfy most of my needs, but can't find anything to have pixels as a unit (it is something that exists in the astropy library).
Is there something like pixels in the toolbox that I have missed? If not any idea on how to emulate it? Like creating a new unit?
Thanks in advance

Answers (1)

Image Analyst
Image Analyst on 26 Nov 2024 at 15:11
Not sure what you mean. A digital image is a matrix. A pixel is just a value at a particular location in the matrix. I don't know what you mean by "Units of Measurement". Is it some kind of list of units like pixels, mm, cm, km, inches, etc.? If you do image analysis the results are generally in pixels. If you want to convert from pixels to calibrated units such as meters, you need to multiply by a calbration factor. See my attached demo.
  1 Comment
Charles
Charles on 26 Nov 2024 at 15:38
What I meant is to use pixels as units in a similar way as the units are used in the tutorial here (MATLAB Symbolic Math Toolbox). The goal is to have a variable with the dimension of mm/pxl.
I hope it helps clarify my initial question

Sign in to comment.

Categories

Find more on Symbolic Math Toolbox in Help Center and File Exchange

Products


Release

R2024b

Community Treasure Hunt

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

Start Hunting!