当前位置:网站首页>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.
边栏推荐
- [singleshotmultiboxdetector (SSD, single step multi frame target detection)]
- Prevent browser backward operation
- abap查表程序
- 12.(地图数据篇)cesium城市建筑物贴图
- Halcon template matching actual code (I)
- 【PyTorch预训练模型修改、增删特定层】
- HiEngine:可媲美本地的云原生内存数据库引擎
- 【yolov5.yaml解析】
- 【 YOLOv3中Loss部分计算】
- [loss functions of L1, L2 and smooth L1]
猜你喜欢
自动化测试生命周期
[pytorch modifies the pre training model: there is little difference between the measured loading pre training model and the random initialization of the model]
Yolov 5 Target Detection Neural Network - Loss Function Calculation Principle
【Win11 多用户同时登录远程桌面配置方法】
Hiengine: comparable to the local cloud native memory database engine
Yolov5 target detection neural network -- calculation principle of loss function
Pytorch MLP
【SingleShotMultiBoxDetector(SSD,单步多框目标检测)】
多表操作-自关联查询
Simply solve the problem that the node in the redis cluster cannot read data (error) moved
随机推荐
[deploy pytoch project through onnx using tensorrt]
vscode快捷键
Pytorch softmax regression
【yolov5.yaml解析】
Check the debug port information in rancher and do idea remote JVM debug
Error modulenotfounderror: no module named 'cv2 aruco‘
How to get a token from tokenstream based on Lucene 3.5.0
Shell script file traversal STR to array string splicing
How to make your products as expensive as possible
COMSOL -- establishment of geometric model -- establishment of two-dimensional graphics
1 plug-in to handle advertisements in web pages
[loss functions of L1, L2 and smooth L1]
ABAP table lookup program
abap查表程序
【ijkplayer】when i compile file “compile-ffmpeg.sh“ ,it show error “No such file or directory“.
【load dataset】
Proof of the thinking of Hanoi Tower problem
redis的持久化机制原理
Which domestic cloud management platform manufacturer is good in 2022? Why?
Mongodb replica set