フィルターのクリア

Change pixels to mm in axes

7 ビュー (過去 30 日間)
Eliska Paulikova
Eliska Paulikova 2023 年 3 月 3 日
コメント済み: Eliska Paulikova 2023 年 3 月 3 日
Hello, I have an image, I know that 1 pixel is 0.14mm. But if I plot some points from the image. The axes is in pixels. But I would like to have it in mm. How can I do it? Thank you so much

回答 (2 件)

Simon Chan
Simon Chan 2023 年 3 月 3 日
Read about function imref2d
  1 件のコメント
Eliska Paulikova
Eliska Paulikova 2023 年 3 月 3 日
Thank you so much

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


DUY Nguyen
DUY Nguyen 2023 年 3 月 3 日
Hi Eliska, you can try this code:
% Load image
I = imread('your_image.bmp');
% Define conversion factor
conversion_factor = 0.14; % mm/pixel
% Get size of image
[M, N] = size(I);
% Create spatial referencing object
ref = imref2d([M N],conversion_factor,conversion_factor);
% Plot points on millimeter-scale axis
imshow(I, ref);
  3 件のコメント
Eliska Paulikova
Eliska Paulikova 2023 年 3 月 3 日
Eliska Paulikova
Eliska Paulikova 2023 年 3 月 3 日
I was trying to use imred2D function, but as you can see I have a problem here. I don't know what to do with a table

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

カテゴリ

Help Center および File ExchangeGraphics Object Programming についてさらに検索

製品


リリース

R2022b

Community Treasure Hunt

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

Start Hunting!

Translated by