问题描述
我在Matlab中使用以下代码绘制了一个二阶多项式:
I plot a second-order polynomial using the following code in Matlab:
xx = 1 : 4000;
mu = 1.0e+03 * [ 2.0733; 0.6569];
b = 198;
P = [2.5577, -1.0134, 102.4344];
figure;imshow(img,'border','tight');
hold on;
plot(xx,polyval(P,xx,[],mu)+b,'LineWidth',1.5,'Color','r');
它产生以下图像:
但是,如果我注释掉figure;imshow(img,'border','tight');
,它会显示以下曲线:
However, if I comment out the figure;imshow(img,'border','tight');
it shows the following curve:
首先,我不知道为什么这两个图不同,哪个是多项式的正确图.
First, I don't know why these two plots differ and which is the right plot of the polynomial.
第二,我寻找一种针对图1所示对象的弯曲程度的度量,以便能够比较两个具有低弯曲或高弯曲(曲率)的对象.但是,我不知道如何从多项式公式中提取这种度量.我尝试使用x^2
(P(2))的系数,但是我不确定它是否代表图1中的曲线,因为图2显示了一些不同的东西.
Second, I look for a measure for the degree of bending for the object shown in Figure 1, so that I be able to compare two objects with low or high bending (curvature). However, I don't know how to extract such a measure from the polynomial formula. I tried to use the coefficient of x^2
(P(2)), but I am not sure if it is a representative of the curve in Figure 1, because Figure 2 shows something different.
推荐答案
第一部分:如果您指的是曲率符号,则应注意图像或矩阵中的坐标系和一个情节.当我们plot
时,如在您的绘图中一样,通常左下角对应于x轴和y轴的最小值.而在图像坐标系中,您会看到以下内容:
First part: If you are referring to the sign of curvature, you should notice the coordinate systems in an image or in a matrix and that of a plot. When we plot
, as in your plot, usually the lower-left corner corresponds to the minimum of both x- and y-axis. Whereas in an image coordinate system, you have something like:
协调(带有行和列索引)从左上角开始.
The coordination (with row and column index) starts from the upper-left corner.
两条曲线之间的另一个视觉差异是它们的绝对曲率,这是由于轴限制所致.如果将轴限制设置为相等,则会看到两条相等弯曲的曲线.使用 xlim
和 ylim
.
The other visual difference between the two curves is their absolute curvature, and that is due to nothing but the axis limits. If you set the axis limits to be equal you will see two equally bent curves. Use xlim
and ylim
for this purpose.
第二部分::如果要量化应用于系统的负载/压力/重量,则系数x^2
的绝对值为单调变量.因此,您可以单独依靠它,并且可以通过对系统施加不同的已知应力量来对其进行校准.
Second part: If you want to quantify the load / pressure / weight applied to the system, the absolute value of the coefficient of x^2
is a monotonic variable. Therefore you can rely on it solely and calibrate it with applying different known amounts of stress to the system.
这篇关于Matlab中二次多项式曲率的度量的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!