当前位置:网站首页>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.
边栏推荐
- 谜语1
- Halcon template matching actual code (I)
- 【load dataset】
- Linux安装部署LAMP(Apache+MySQL+PHP)
- Liunx prohibit Ping explain the different usage of traceroute
- Yolov 5 Target Detection Neural Network - Loss Function Calculation Principle
- Troubleshooting of high memory usage of redis in a production environment
- C # implements WinForm DataGridView control to support overlay data binding
- [yolov5.yaml parsing]
- Open3D 网格(曲面)赋色
猜你喜欢
redis主从模式
1个插件搞定网页中的广告
[pytorch pre training model modification, addition and deletion of specific layers]
[untitled]
Simply solve the problem that the node in the redis cluster cannot read data (error) moved
HiEngine:可媲美本地的云原生内存数据库引擎
自动化测试生命周期
XML解析
Liunx prohibit Ping explain the different usage of traceroute
【pytorch 修改预训练模型:实测加载预训练模型与模型随机初始化差别不大】
随机推荐
redis主从模式
Shell script file traversal STR to array string splicing
[deploy pytoch project through onnx using tensorrt]
871. Minimum Number of Refueling Stops
byte2String、string2Byte
【yolov3损失函数】
多表操作-子查询
abap查表程序
C # implements WinForm DataGridView control to support overlay data binding
[yolov3 loss function]
Solve readobjectstart: expect {or N, but found n, error found in 1 byte of
阻止瀏覽器後退操作
codeforces每日5题(均1700)-第五天
【yolov5.yaml解析】
The most comprehensive new database in the whole network, multidimensional table platform inventory note, flowus, airtable, seatable, Vig table Vika, flying Book Multidimensional table, heipayun, Zhix
Linux Installation and deployment lamp (apache+mysql+php)
Programmers are involved and maintain industry competitiveness
Troubleshooting of high memory usage of redis in a production environment
[configuration method of win11 multi-user simultaneous login remote desktop]
Codeworks 5 questions per day (1700 average) - day 5