声振论坛

 找回密码
 我要加入

QQ登录

只需一步,快速开始

查看: 1664|回复: 5

[图像处理] 怎么求三维阴影表面中极值点的x、y坐标?

[复制链接]
发表于 2006-10-18 18:00 | 显示全部楼层 |阅读模式

马上注册,结交更多好友,享用更多功能,让你轻松玩转社区。

您需要 登录 才可以下载或查看,没有账号?我要加入

x
怎么求三维阴影表面中极值点的x、y坐标?
非得对其进行x、y的偏导?
以下图为例
1.JPG
回复
分享到:

使用道具 举报

 楼主| 发表于 2006-10-18 19:36 | 显示全部楼层
版上有位大侠对如果求极值大小z有过指导
但xy如何求?
发表于 2006-10-20 10:29 | 显示全部楼层
多元函数求极值点相对比较麻烦一些,我在一个教程见过,转过来你参考一下吧


2005127172341537.gif
的极小值点。它即是著名的 Rosenbrock's "Banana" 测试函数。该测试函数有一片浅谷,许多算法难以越过此谷。

(1)从三维等位线图初步观察测试函数
x=-3:0.1:3;y=-2:0.1:4;
[X,Y]=meshgrid(x,y);
F=100*(Y-X.^2).^2+(1-X).^2;
contour3(X,Y,F,300),
xlabel('x'),ylabel('y'),axis([-3,3,-2,4,0,inf]),view([161,22])
hold on,plot3(1,1,0,'.r','MarkerSize',20),hold off
2005127172341762.gif

(2)本例采用内联函数表示测试函数如下
ff=inline('100*(x(2)-x(1)^2)^2+(1-x(1))^2','x');

(3)用单纯形法求极小值点
x0=[-1.2,1];[sx,sfval,sexit,soutput]=fminsearch(ff,x0)
Optimization terminated successfully:
the current x satisfies the termination criteria using OPTIONS.TolX of 1.000000e-004
and F(X) satisfies the convergence criteria using OPTIONS.TolFun of 1.000000e-004

sx =
1.0000 1.0000
sfval =
8.1777e-010
sexit =
1
soutput =
iterations: 85
funcCount: 159
algorithm: 'Nelder-Mead simplex direct search'

(4)用拟牛顿法求极小值点
[ux,sfval,uexit,uoutput,grid,hess]=fminunc(ff,x0)
Warning: Gradient must be provided for trust-region method;
using line-search method instead.
> In D:\MAT53\toolbox\optim\fminunc.m at line 202
Optimization terminated successfully:
Current search direction is a descent direction, and magnitude of
directional derivative in search direction less than 2*options.TolFun

ux =
1.0000 1.0000
sfval =
1.9118e-011
uexit =
1
uoutput =
iterations: 26
funcCount: 162
stepsize: 1.2992
firstorderopt: 5.0023e-004
algorithm: 'medium-scale: Quasi-Newton line search'
grid =
1.0e-003 *
-0.5002
-0.1888
hess =
820.4031 -409.5497
-409.5497 204.7720

[ 本帖最后由 happy 于 2006-10-20 10:30 编辑 ]
 楼主| 发表于 2006-10-20 10:47 | 显示全部楼层
谢谢教授
这个教程我练习过了
1.后段不能运行?
2.不能解出x、y的坐标?
 楼主| 发表于 2006-10-20 10:56 | 显示全部楼层
或者

可以不可以 如果用数值方法,就确定四周值比它都小的点--极大。
反之--极小
(引自rock兄的指点)
 楼主| 发表于 2006-10-20 11:00 | 显示全部楼层
另外
f(x,y)实际上是图中的坐标高度
那这个点有编号没?
如果用5楼rock兄的方法,类似的算法有没有?想参考下
您需要登录后才可以回帖 登录 | 我要加入

本版积分规则

QQ|小黑屋|Archiver|手机版|联系我们|声振论坛

GMT+8, 2024-5-17 01:48 , Processed in 0.055256 second(s), 21 queries , Gzip On.

Powered by Discuz! X3.4

Copyright © 2001-2021, Tencent Cloud.

快速回复 返回顶部 返回列表