how to make figure perfectly squared?
203 ビュー (過去 30 日間)
古いコメントを表示
I would like to make a perfect squared figure. When I use axis equal I still find that y-axis is stretched more than x-axis and does not make a perfect square. It appears like a rectangle elongated in y-direction. I do not want to change x and y limits.
I understand that my PC screen does not have 1:1 ratio, but how to get figure in 1:1 ratio??
Can anyone please help me making figure perfectly squared?
Here is the tentative code:
clear; close all; clc;
subplot(131)
plot((1:20),(5:5:100))
xlim([1,20]); ylim([5,100]);
axis normal;
axis square;
subplot(132)
plot((1:20),(5:5:100))
xlim([1,20]); ylim([5,100]);
axis normal;
axis square;
subplot(133)
plot((1:20),(5:5:100))
xlim([1,20]); ylim([5,100]);
axis normal;
axis square;
![](https://www.mathworks.com/matlabcentral/answers/uploaded_files/1106230/image.jpeg)
I want a figure like this . Square.
Any help will be greatly appriciated.
Thank you very much in advance!
0 件のコメント
採用された回答
Walter Roberson
2022 年 8 月 24 日
編集済み: Walter Roberson
2022 年 8 月 24 日
You will need to create a calibration pattern and record it with some external camera, and create an undistortion matrix. You would draw into an array instead of on to the display, and then you would apply the undistortion matrix to it to arrive at the final image to display. The image would then pass through the distortion of your pc display and the distortion and undistortion would cancel out.
The computer vision toolbox contains tools for analyzing camera distortion that could be applied in reverse.
If this sounds as if I am blaming your pc display or your graphics hardware for not displaying correctly, then you have understood correctly.
2 件のコメント
Image Analyst
2022 年 8 月 24 日
@MP Walter's answer doesn't sound "very rude" to me. He's saying that the distortion might be caused by your video adapter settings. Are they set to the "recommended" screen resolution settings? As far as I know the recommended settings are always for square pixels. If your recommended settings are 1980x1080 and you have it set for 1440x1080 then it may stretch the image so that something that would appear square with square pixel resolution setting will not appear square.
Walter Roberson
2022 年 8 月 24 日
There are several different standard types of distortion for CRT displays, including pincushioning and bowing.
LCD and OLED and QLED displays are considerably less prone to some kinds of distortions, but they are not free of distortion, especially if viewed at angles.
Those are distortion at the physical display level. There is also potential distortion if the graphics card is sending incorrect or less-than-optimal information, due to settings or problems with the graphics driver or problems with the graphics card.
In the past I have used axis square on my iMac and measured the size of a data rectangle with digital calipers. On my system, the lengths of the two sides was equal to within round-off error.
その他の回答 (0 件)
参考
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!