Can I create images with accurate size in mm ?

조회 수: 5 (최근 30일)
MaryD
MaryD 2024년 1월 17일
답변: Muskan 2024년 1월 23일
I need to create phantom data- for example white sqare on black background with known size and position in milimiters. Is it possible to create something like that in matlab? Or does matlab perform with pixels size only ?
  댓글 수: 1
DGM
DGM 2024년 1월 17일
편집: DGM 2024년 1월 17일
Raster image data is in pixels only. Any information about physical size is either implied by the relative scale of reference features within the physical image, or by metadata stored in the file header, though the vast majority of default-generated resolution metadata in non-technical images is either contextually meaningless or wrong. If all you have is a white square on a black background, then there is no implied scale. If you want to include that information, it depends how you want to do it and what file format you're using.

댓글을 달려면 로그인하십시오.

채택된 답변

Image Analyst
Image Analyst 2024년 1월 23일
Using a known distance in real world units and a measured pixel distance in your image, you can create a spatial calibration factor "mmPerPixel" that you can multiply your pixel measurements by. See my attached demo for how to do that.

추가 답변 (1개)

Muskan
Muskan 2024년 1월 23일
Hi Mary,
As per my understanding, in MATLAB, image representation is inherently based on pixel units. As such, to facilitate the use of different units such as millimeters (mm), one would need to implement a custom conversion routine. Currently, MathWorks does not provide a built-in function specifically for this purpose.

카테고리

Help CenterFile Exchange에서 Image Processing Toolbox에 대해 자세히 알아보기

제품


릴리스

R2022b

Community Treasure Hunt

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

Start Hunting!

Translated by