当前位置:网站首页>Matlab label2idx function (convert the label matrix into a cell array with linear index)
Matlab label2idx function (convert the label matrix into a cell array with linear index)
2022-07-05 11:58:00 【**inevitable**】
List of articles
grammar
pixelIndexList = label2idx(L)
explain
pixelIndexList = label2idx(L)
% The label matrix L The described area is converted to a linear index pixelIndexList.
Example
Calculate the pixel index list of the small label matrix
% Create a small sample matrix with three areas
BW = logical([1 1 1 0 0 0 0 0
1 1 1 0 1 1 0 0
1 1 1 0 1 1 0 0
1 1 1 0 0 0 0 0
1 1 1 0 0 0 1 0
1 1 1 0 0 0 1 0
1 1 1 0 0 1 1 0
1 1 1 0 0 0 0 0]);
% Create a label matrix from this sample image
L = bwlabel(BW)

% Get the linear index list of all pixels in each region
% This function returns an array of cells , The array has elements of each region found in the label matrix
pixelIndexList = label2idx(L)

% Check one of the returned pixel index lists
% for example , View the second cell in the returned cell array
% It contains information marked as “ 2” Linear index of all pixels in the region of
% The upper left corner of this area is pixels BW(2,5), It is the th in the linear index 34 Pixel
pixelIndexList{2}

Input parameters
L : Label matrix
Label matrix , An array of numbers specified as any dimension .
data type :single | double | int8 | int16 | int32 | int64 | uint8 | uint16 | uint32 | uint64 | logical
Output parameters
pixelIndexList : Linear index of pixels in the region
Linear index of pixels in the region , With 1×n Cell array returns . Every element of the output pixelIndexList {n} It's a vector , It includes L All linear indexes in , among L be equal to n.
边栏推荐
- 一次生产环境redis内存占用居高不下问题排查
- [upsampling method opencv interpolation]
- Principle of redis cluster mode
- Yolov5 target detection neural network -- calculation principle of loss function
- Uniapp + unicloud + Unipay realize wechat applet payment function
- Is investment and finance suitable for girls? What financial products can girls buy?
- JS for loop number exception
- [deploy pytoch project through onnx using tensorrt]
- 阻止瀏覽器後退操作
- Riddle 1
猜你喜欢

Error modulenotfounderror: no module named 'cv2 aruco‘
![[mainstream nivida graphics card deep learning / reinforcement learning /ai computing power summary]](/img/1a/dd7453bc5afc6458334ea08aed7998.png)
[mainstream nivida graphics card deep learning / reinforcement learning /ai computing power summary]

Redis集群(主从)脑裂及解决方案

redis的持久化机制原理

多表操作-自关联查询

How to protect user privacy without password authentication?

pytorch-权重衰退(weight decay)和丢弃法(dropout)

【PyTorch预训练模型修改、增删特定层】

【云原生 | Kubernetes篇】Ingress案例实战(十三)

Redis master-slave mode
随机推荐
yolov5目標檢測神經網絡——損失函數計算原理
[upsampling method opencv interpolation]
Web API configuration custom route
Codeforces Round #804 (Div. 2)
Sentinel sentinel mechanism of master automatic election in redis master-slave
ACID事务理论
HiEngine:可媲美本地的云原生内存数据库引擎
13.(地图数据篇)百度坐标(BD09)、国测局坐标(火星坐标,GCJ02)、和WGS84坐标系之间的转换
Yolov5 target detection neural network -- calculation principle of loss function
自动化测试生命周期
Principle and performance analysis of lepton lossless compression
网络五连鞭
Linux安装部署LAMP(Apache+MySQL+PHP)
简单解决redis cluster中从节点读取不了数据(error) MOVED
【TFLite, ONNX, CoreML, TensorRT Export】
codeforces每日5题(均1700)-第五天
abap查表程序
阻止浏览器后退操作
vscode快捷键
[untitled]