matlab数字图像处理自学记录随笔(附3)-- 学习过程中用到的函数、运算

主要是用help命令查询后进行翻译加上一点自己的理解啦
加粗加斜字体为matlab查阅出来的原文

size函数

D = size(X), for M-by-N matrix X, returns the two-element row vector
D = [M,N] containing the number of rows and columns in the matrix.
For N-D arrays, size(X) returns a 1-by-N vector of dimension lengths.
Trailing singleton dimensions are ignored.

size是可以告知我们一个矩阵的大小,对于上例中的调用,把D看作一个包含两个元素的变量理解。
[M1,M2,M3,…,MN] = size(X) for N>1 returns the sizes of the first N dimensions of the array X.
另外这种包含N个元素的调用方式不太理解,就不瞎猜了。

graythresh函数

graythresh Global image threshold using Otsu’s method.
graythresh使用Otsu方法的全局图像阈值。
也就是说graythresh函数可以视为一个值,Otsu方法又称最大类间方差法/大津法

c = im2bw(I,graythresh());

就是将归一化阈值取为Otsu法得出的阈值。
thresh V.(用机器) 使脱粒;尤指旧时手持工具)打(稻、麦等;(使) 剧烈扭动,翻滚;
thrash V.为惩罚用棍子等) 抽打,连续击打;(使)激烈扭动,翻来覆去;N.快节奏重金属摇滚乐;歌载舞的聚会

cat函数

Concatenate arrays.
cat(DIM,A,B) concatenates the arrays A and B along
the dimension DIM.
cat(2,A,B) is the same as [A,B].
cat(1,A,B) is the same as [A;B].

连接数组,

.* 与 *运算

操作数都是数,二者没有区别
当为矩阵时(要求矩阵同形),
【.* 】
两矩阵对应位置元素相乘,结果作为新矩阵对应位置的元素。
【 * 】
就是矩阵乘法

uigetfile函数

uigetfile Standard open file dialog box.
[FILENAME, PATHNAME, FILTERINDEX] = uigetfile(FILTERSPEC(过滤器规格), TITLE)
displays a dialog box for the user to fill in, and returns the filename
and path strings and the index of the selected filter. A successful
return occurs only if the file exists. If the user selects a file
that does not exist, an error message is displayed, and control
returns to the dialog box. The user may then enter another filename,
or press the Cancel button.

标准地打开一个文件目录对话框,返回文件名和文件路径(字符串)。若用户所选文件不存在,将输出错误信息并返回文件对话框,或者点击取消按钮。
实例:
[filename, pathname] = uigetfile({'*.jpg'; '*.bmp'; '*.gif'}, '选择图片');

padarray函数

对矩阵进行扩充,方式当然不止这一种,

将矩阵删除行/列

x(N,:)=[];删除第N行
x(1:N)=[];删除第一至N行
x(:,N)删除第N列
x(:1:N)
详细请看:https://www.cnblogs.com/haore147/p/3633050.html

定义一个动态数组

说是动态,起始也就是事先没法确定数组大小
可以这么写a = [];

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

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值