当前位置:网站首页>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.
边栏推荐
- 【主流Nivida显卡深度学习/强化学习/AI算力汇总】
- Acid transaction theory
- [yolov5.yaml parsing]
- [loss functions of L1, L2 and smooth L1]
- Pytorch linear regression
- Which domestic cloud management platform manufacturer is good in 2022? Why?
- 13.(地图数据篇)百度坐标(BD09)、国测局坐标(火星坐标,GCJ02)、和WGS84坐标系之间的转换
- Redis集群(主从)脑裂及解决方案
- [calculation of loss in yolov3]
- yolov5目標檢測神經網絡——損失函數計算原理
猜你喜欢

Splunk configuration 163 mailbox alarm

13. (map data) conversion between Baidu coordinate (bd09), national survey of China coordinate (Mars coordinate, gcj02), and WGS84 coordinate system

iTOP-3568开发板NPU使用安装RKNN Toolkit Lite2

Sentinel sentinel mechanism of master automatic election in redis master-slave

Principle of persistence mechanism of redis

【上采样方式-OpenCV插值】
![[pytorch pre training model modification, addition and deletion of specific layers]](/img/cb/aa0b1116ec9b98e3ee5725aa58f4fe.png)
[pytorch pre training model modification, addition and deletion of specific layers]

How to protect user privacy without password authentication?

谜语1

【Win11 多用户同时登录远程桌面配置方法】
随机推荐
HiEngine:可媲美本地的云原生内存数据库引擎
1. Laravel creation project of PHP
投资理财适合女生吗?女生可以买哪些理财产品?
Principle of redis cluster mode
Hiengine: comparable to the local cloud native memory database engine
[deploy pytoch project through onnx using tensorrt]
Vscode shortcut key
redis集群中hash tag 使用
[yolov3 loss function]
Liunx prohibit Ping explain the different usage of traceroute
Linux安装部署LAMP(Apache+MySQL+PHP)
[configuration method of win11 multi-user simultaneous login remote desktop]
Multi table operation - sub query
How can China Africa diamond accessory stones be inlaid to be safe and beautiful?
iTOP-3568开发板NPU使用安装RKNN Toolkit Lite2
互联网公司实习岗位选择与简易版职业发展规划
XML解析
Project summary notes series wstax kt session2 code analysis
Error modulenotfounderror: no module named 'cv2 aruco‘
Programmers are involved and maintain industry competitiveness