当前位置:网站首页>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.
边栏推荐
- COMSOL -- establishment of geometric model -- establishment of two-dimensional graphics
- 一类恒等式的应用(范德蒙德卷积与超几何函数)
- Simply solve the problem that the node in the redis cluster cannot read data (error) moved
- 你做自动化测试为什么总是失败?
- The survey shows that traditional data security tools cannot resist blackmail software attacks in 60% of cases
- 1个插件搞定网页中的广告
- 投资理财适合女生吗?女生可以买哪些理财产品?
- How to protect user privacy without password authentication?
- Idea set the number of open file windows
- 调查显示传统数据安全工具在60%情况下无法抵御勒索软件攻击
猜你喜欢
Check the debug port information in rancher and do idea remote JVM debug
Uniapp + unicloud + Unipay realize wechat applet payment function
多表操作-自关联查询
[singleshotmultiboxdetector (SSD, single step multi frame target detection)]
Thoughts and suggestions on the construction of intelligent management and control system platform for safe production in petrochemical enterprises
Intern position selection and simplified career development planning in Internet companies
How to protect user privacy without password authentication?
Reading notes of growth hacker
Principle of persistence mechanism of redis
[yolov5.yaml parsing]
随机推荐
How can China Africa diamond accessory stones be inlaid to be safe and beautiful?
yolov5目标检测神经网络——损失函数计算原理
The survey shows that traditional data security tools cannot resist blackmail software attacks in 60% of cases
XML解析
中非 钻石副石怎么镶嵌,才能既安全又好看?
Redis集群(主从)脑裂及解决方案
你做自动化测试为什么总是失败?
ABAP table lookup program
Codeworks 5 questions per day (1700 average) - day 5
【TFLite, ONNX, CoreML, TensorRT Export】
13.(地图数据篇)百度坐标(BD09)、国测局坐标(火星坐标,GCJ02)、和WGS84坐标系之间的转换
Unity xlua monoproxy mono proxy class
Ncp1342 chip substitute pn8213 65W gallium nitride charger scheme
Sentinel sentinel mechanism of master automatic election in redis master-slave
Vscode shortcut key
Linux安装部署LAMP(Apache+MySQL+PHP)
XML parsing
Redis cluster (master-slave) brain crack and solution
Complete activity switching according to sliding
Project summary notes series wstax kt session2 code analysis