当前位置:网站首页>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.
边栏推荐
- 调查显示传统数据安全工具在60%情况下无法抵御勒索软件攻击
- Redis集群(主从)脑裂及解决方案
- 【主流Nivida显卡深度学习/强化学习/AI算力汇总】
- 1. Laravel creation project of PHP
- 12.(地图数据篇)cesium城市建筑物贴图
- [deploy pytoch project through onnx using tensorrt]
- Halcon 模板匹配实战代码(一)
- 2022年国内云管平台厂商哪家好?为什么?
- Ncp1342 chip substitute pn8213 65W gallium nitride charger scheme
- Codeforces Round #804 (Div. 2)
猜你喜欢
Simply solve the problem that the node in the redis cluster cannot read data (error) moved
[upsampling method opencv interpolation]
Uniapp + unicloud + Unipay realize wechat applet payment function
iTOP-3568开发板NPU使用安装RKNN Toolkit Lite2
[mainstream nivida graphics card deep learning / reinforcement learning /ai computing power summary]
[pytorch modifies the pre training model: there is little difference between the measured loading pre training model and the random initialization of the model]
【云原生 | Kubernetes篇】Ingress案例实战(十三)
Reading notes of growth hacker
[crawler] Charles unknown error
[untitled]
随机推荐
12. (map data) cesium city building map
Time tools
View all processes of multiple machines
Codeworks 5 questions per day (1700 average) - day 5
Video networkState 属性
Vscode shortcut key
11. (map data section) how to download and use OSM data
【云原生 | Kubernetes篇】Ingress案例实战(十三)
pytorch-权重衰退(weight decay)和丢弃法(dropout)
redis的持久化机制原理
Implementation of array hash function in PHP
pytorch-线性回归
redis集群中hash tag 使用
Unity xlua monoproxy mono proxy class
【上采样方式-OpenCV插值】
Codeforces Round #804 (Div. 2)
Acid transaction theory
Unity Xlua MonoProxy Mono代理类
[pytorch pre training model modification, addition and deletion of specific layers]
Redis master-slave mode