python等高线图轮廓线提取_用Python或MATLAB从等高线图的像素点提取数据

下面是一个小的Matlab脚本,它可以完成这项工作(使用一些GUI,阅读图的倾斜部分的guidline):%// Import the data:

imdata = importdata('your_picture_file');

Gray = rgb2gray(imdata.cdata);

colorLim = [-1 1]; %// this should be set manually

%// Get the area of the data:

f = figure('Position',get(0,'ScreenSize'));

imshow(imdata.cdata,'Parent',axes('Parent',f),'InitialMagnification','fit');

%// Get the area of the data:

title('Click with the cross on the most top left area of the *data*')

da_tp_lft = round(getPosition(impoint));

title('Click with the cross on the most bottom right area of the *data*')

da_btm_rgt = round(getPosition(impoint));

dat_area = double(Gray(da_tp_lft(2):da_btm_rgt(2),da_tp_lft(1):da_btm_rgt(1)));

%// Get the area of the colorbar:

title('Click with the cross within the upper most color of the *colorbar*')

ca_tp_lft = round(getPosition(impoint));

title('Click with the cross within the bottom most color of the *colorbar*')

ca_btm_rgt = round(getPosition(impoint));

cmap_area = double(Gray(ca_tp_lft(2):ca_btm_rgt(2),ca_tp_lft(1):ca_btm_rgt(1)));

close(f)

%// Convert the colormap to data:

data = dat_area./max(cmap_area(:)).*range(colorLim)-abs(min(colorLim));

现在,data就是你要找的。在

以下是使用问题中的图显示的输出:

图示代码:

^{pr2}$

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值