Scale points on scaled image

8 ビュー (過去 30 日間)
Alejandro Fernández
Alejandro Fernández 2020 年 7 月 15 日
Hello, greetings. I have a little question, see if anyone knows how to solve it.
I have an image I, that to make the test, is going to be the image of cameraman, to which I am going to apply the function imresize and later edge, as you can see:
I = imread('Cameraman.tif');
II = imresize(I,0.25);
figure, subplot(1,2,1);
imshow(I,'InitialMagnification','fit');
J = edge(I);
subplot(1,2,2);
imshow(J,'InitialMagnification','fit');
And now what I do is on the image J define a polygon according to a series of points, for example:
points = [49.5,50.5;143,50.5;143,170.2;49.5,170.3];
figure, imshow(J); hold on; scatter(points(:,1),points(:,2),40,'filled');
And what I need to get is the position of those points but on the original image I. Thank you so much!

採用された回答

Dinesh Yadav
Dinesh Yadav 2020 年 7 月 21 日
The location of points remain the same as you are not using the image II anywhere. All operations are performed on I itself. In image II you are resizing by a factor of 4 (i.e from 256 x 256 to 64 x 64), therefore the location of points if the operations had been performed on II multiply the points by 4 to get locations in original image as in this case its linear downsizing.
  1 件のコメント
Alejandro Fernández
Alejandro Fernández 2020 年 7 月 22 日
Thank you so much!, i'm sorry for the code i write in the previous post because it was not correct. But your message yes!
Thank you so much again.

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

その他の回答 (0 件)

カテゴリ

Help Center および File ExchangeElementary Polygons についてさらに検索

製品


リリース

R2020a

Community Treasure Hunt

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

Start Hunting!

Translated by