matlab中如何提取等高线,在Python或MATLAB中从等高线图中提取数据
这是一个小型的Matlab脚本,可以完成这项工作(使用一些GUI,在图的斜角处读取guidlines):
%// 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 就是你要找的 .
以下是使用问题中的图形输出的说明:
插图的代码:
figure('Position',[100 200 1200 400]);
subplot 121
imshow(imdata.cdata)
hold on
plot(da_tp_lft(1),da_tp_lft(2),'m+','MarkerSize',7,'LineWidth',2)
plot(da_btm_rgt(1),da_btm_rgt(2),'m+','MarkerSize',7,'LineWidth',2)
plot(ca_tp_lft(1),ca_tp_lft(2),'r+','MarkerSize',7,'LineWidth',2)
plot(ca_btm_rgt(1),ca_btm_rgt(2),'r+','MarkerSize',7,'LineWidth',2)
hold off
title('The original image')
subplot 122
surf(data)
shading interp
view(50,40)
colorbar
caxis([-1 1])
title('Illusration of the data')
axis tight
matlab中如何提取等高线,在Python或MATLAB中从等高线图中提取数据相关推荐
- matlab hanning窗口怎么使用,在Python和Matlab中,Hanning窗口值不匹配
在scipy.signal中,函数hanning已弃用.要使用的函数是scipy.signal.hann.在 numpy.hanning和{}计算相同的窗口. 函数包括窗口末尾的零值.要匹配您在问题中 ...
- python3中zip函数_用python实现矩阵转置,python3 中zip()函数
前几天群里有同学提出了一个问题:手头现在有个列表,列表里面两个元素,比如[1, 2],之后不断的添加新的列表,往原来相应位置添加.例如添加[3, 4]使原列表扩充为[[1, 3], [2, 4]],再 ...
- python中wb什么意思,使用Python,“ wb”在此代码中是什么意思?
Code: file('pinax/media/a.jpg', 'wb') 解决方案 File mode, write and binary. Since you are writing a .jpg ...
- excel调用python编程-使用Python和xlwt向Excel文件中写入中文的实例
sheet1.write(row_num,0,f) row_num = 1 book.save('demo.xls') 程序执行结果如下: grey@DESKTOP-3T80NPQ:/mnt/e/01 ...
- 使用Python,OpenCV从静态背景中提取移动前景
使用Python,OpenCV从静态背景中提取移动前景 1. 效果图 2. 原理 3. 源码 参考 这篇博客将介绍OpenCV中的背景减法方法--即从静态背景中提取移动前景.在许多基于视觉的应用中,背 ...
- python实现matlab中的diff,Python实现matlab数据绘制
自从使用python脚本后,经常用来调试数据的matlab终于有了一个简单易用的替代方案,相比matlab的.m语言,我更喜欢用python来解决.毕竟在python当中,相比.m主意很多编程工作都可 ...
- 范德蒙德矩阵在MATLAB中怎么表示,Python 之 Python与MATLAB 矩阵操作总结
Python 之 Python与MATLAB 矩阵操作小结 一.线形代数理论基础 线形代数(linear algebra)是数学的一个分支,研究矩阵理论.向量空间.线性变换和有限维线形方程组等内容. ...
- matlab如何截取图像的中间部分_利用matlab提取并分割RGB图像中的某一个已知像素值的图像...
已知一副RGB图像中的的像素值,利用matlab将其分割出来并以二进制图像形式显示: %extract.m clear all; I=imread('new_original.png'); figur ...
- 全面对比 MATLAB、Julia、Python,谁在科学计算中更胜一筹?
数百种编程语言,各有优劣,各自也都有自己最为适用的场景.那么就科学计算领域而言,主流的 MATLAB.Julia.Python 会有哪些最为独特的优势呢?又存在哪些让开发者无力的缺陷?在本文中,我们将 ...
最新文章
- java当前月份减一个月_在java编程中怎样用%表示当前月份的上一个月和下一个月...
- VS报错:此项目需要缓解Spectre漏洞的库
- oss导出数据为空时怎么处理_sql数据库导出空库的搜索结果-阿里云开发者社区...
- 关于模拟量转光纤的不同实现方法与区别
- 【Linux】vi编辑器命令
- 1111 复习 形状的打印
- Linux中apt install的lock问题
- servlet mysql 分页_Java基础94 分页查询(以MySQL数据库为例,Servlet技术)
- 计算机字符编码从0/1到UTF-8
- php 股票历史api接口,新浪股票接口获取历史数据
- CSS——div垂直居中及div内文字垂直居中
- 桔梗载药上浮 柴胡升于左 升麻生于右
- PT站的分享精神,我所向往的PT分享模式(原创)
- linux 网桥端口,linux网桥
- [中科]寒武纪,不愁钱路无客户
- 《指数基金投资指南》读书笔记_2022002
- 计算机专业英语辅导教材,计算机专业英语2全套教材.ppt
- Android给图片加水印
- 【工作笔记】Springboot一个比较通用的数据脱敏处理办法
- POJ 3696 神TM数论