Matlab
heibaigezi
这个作者很懒,什么都没留下…
展开
-
Matlab比较2个 二维矩阵 或 二维图像 相似度的方法总结
1、corr2A = ;B = ;cor = corr2(A,B)2、通过直方图相似性比较(参考:https://blog.csdn.net/xiaojianzhao/article/details/103785809) 如果两张图像的直方图一样,或者有极高的相似度,那么在一定程度上,可以认为这两幅图是一样的,这就是直方图比较的应用之一。通过默认的欧氏距离来比较直方图的相似性大小,值越小,两个图像的直方图越相似。i1 = a;i2 = b;[c1,n]=imhist(i..原创 2020-07-07 16:36:42 · 14812 阅读 · 4 评论 -
matlab中二维数组中大于0的有多少个
count = length(find(mask(:)>0))原创 2020-05-13 17:17:13 · 2945 阅读 · 0 评论 -
matlab中图像掩模 | 2个二维数组的掩模
参考:https://www.cnblogs.com/bithuaning/p/6925037.html测试:arr=[1 2 3;4 5 6;7 8 9]mask=[1 0 1;0 1 0;1 0 1];ret = arr.*mask原创 2020-05-13 16:48:08 · 942 阅读 · 0 评论 -
Matlab fscanf的用法
参考网址:http://blog.sina.com.cn/s/blog_4cfb5a6201015i8q.html(因为这篇博客稍微会用fscanf了,但不太清楚原理,以后补笔记)转载 2019-12-31 09:50:38 · 414 阅读 · 0 评论 -
Matlab形态学处理
原文很详细,转了,笔记以后补(flag还是要立的,打脸就打脸了)参考网址:https://www.cnblogs.com/tornadomeet/archive/2012/03/20/2408086.html转载 2019-12-29 18:08:07 · 375 阅读 · 0 评论 -
统计数组中各数字(元素)出现的次数
如何统计一个数组中各数字(元素)出现的频数、频率和累积频率?这里以案例形式做一个总结。转自Matlab论坛:https://www.ilovematlab.cn/thread-67367-1-1.html第一种方法:调用MATLAB自带的函数tabulate统计一个数组中各数字(元素)出现的频数、频率【例1】统计数值型数组中各元素出现的频数、频率。 >> x = [2...转载 2019-12-25 10:40:32 · 6424 阅读 · 0 评论 -
Matlab广度优先搜索(BFS)、深度优先搜索(DFS)
参考网址:https://blog.csdn.net/weixin_33888907/article/details/86039662如果需要对一幅图像进行广度优先搜索,如,从图像的质心出发广度优先搜索所有的点。(等做完了所有的功能再回来补)...原创 2019-12-24 17:42:29 · 4660 阅读 · 0 评论 -
Matlab的gradient函数
计算规则: [Fx,Fy] = gradient(F),其中Fx为其水平方向上的梯度,Fy为其垂直方向上的梯度。Fx的第一列元素为原矩阵第二列与第一列元素之差,Fx的第二列元素为原矩阵第三列与第一列元素之差除以2,以此类推:Fx(i,j) = (F(i,j+1) - F(i,j-1)) / 2。最后一列则为最后两列之差。同理,可以得到Fy。...原创 2019-12-23 10:06:14 · 601 阅读 · 0 评论 -
Matlab矩阵旋转45度
1.函数曲线x=linspace(-2,2);y=x.^2;A=[cosd(-45) -sind(-45);sind(-45) cosd(-45)]*[x;y];figure;plot(x,y,'r',A(1,:),A(2,:));axis equal;legend('原图像','顺时针旋转45°后的图像')2.图像旋转~=矩阵旋转mat = [1 2 3;4 5 ...原创 2019-12-17 09:52:43 · 7779 阅读 · 2 评论 -
Error:while loading shared libraries xxx.so.xxx.cannot open shared object file:No such file or dire
在linux | Ubuntu系统下安装Matlab运行环境MCR参考网址:https://www.mathworks.com/matlabcentral/answers/267562-how-can-i-resolve-this-mcc-runtime-error-cannot-open-shared-object-library#answer_211306根据网址,我的操作如下:1...原创 2019-12-06 16:43:27 · 313 阅读 · 0 评论 -
Matlab如何用imwrite函数写UINT16的图像 || Matlab报错:UINT16图像数据需要特定设置为12或16的位深
1. 在Matlab命令窗口输入命令:helpimwrite会有如下解释:If the input array is of class uint16 and the format supports 16-bit data (JPEG, PNG, and TIFF), imwrite outputs the data as 16-bit values. If the format do...转载 2019-12-05 21:32:56 · 3481 阅读 · 0 评论 -
Matlab写txt文件怎么换行?
Matlab将数据写进txt:https://blog.csdn.net/heibaigezi/article/details/85234131在上面的代码中,直接\n,就实现了,但后来就是不能复现,查了一下,换成\r\n就可以实现换行了...原创 2019-01-09 21:08:13 · 3308 阅读 · 0 评论 -
Matlab将数据写进txt文件
fileID = fopen('test.txt','a+') % w : 删掉原来文件中的内容。a+:追加写入fprintf(fileID,'%s','this is a test sentence!!!!!!!!');fileID = fopen('hello.txt','w');for i = 1:64 for j = 1:64 fprintf(fi...原创 2018-12-24 15:37:56 · 4582 阅读 · 0 评论