当前位置:网站首页>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.
边栏推荐
- How to protect user privacy without password authentication?
- Complete activity switching according to sliding
- Redirection of redis cluster
- 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
- pytorch-softmax回归
- 13. (map data) conversion between Baidu coordinate (bd09), national survey of China coordinate (Mars coordinate, gcj02), and WGS84 coordinate system
- Simply solve the problem that the node in the redis cluster cannot read data (error) moved
- How to make your products as expensive as possible
- HiEngine:可媲美本地的云原生内存数据库引擎
- pytorch-权重衰退(weight decay)和丢弃法(dropout)
猜你喜欢

11. (map data section) how to download and use OSM data

Riddle 1

《增长黑客》阅读笔记

Splunk configuration 163 mailbox alarm

【L1、L2、smooth L1三类损失函数】

【主流Nivida显卡深度学习/强化学习/AI算力汇总】

【Win11 多用户同时登录远程桌面配置方法】

Sentinel sentinel mechanism of master automatic election in redis master-slave
![[yolov3 loss function]](/img/79/87bcc408758403cf3993acc015381a.png)
[yolov3 loss function]

13.(地图数据篇)百度坐标(BD09)、国测局坐标(火星坐标,GCJ02)、和WGS84坐标系之间的转换
随机推荐
11.(地图数据篇)OSM数据如何下载使用
Codeforces Round #804 (Div. 2)
splunk配置163邮箱告警
[mainstream nivida graphics card deep learning / reinforcement learning /ai computing power summary]
多表操作-自关联查询
调查显示传统数据安全工具在60%情况下无法抵御勒索软件攻击
Which domestic cloud management platform manufacturer is good in 2022? Why?
Principle and performance analysis of lepton lossless compression
2048 game logic
Application of a class of identities (vandermond convolution and hypergeometric functions)
Solve the grpc connection problem. Dial succeeds with transientfailure
[calculation of loss in yolov3]
C operation XML file
Implementation of array hash function in PHP
[singleshotmultiboxdetector (SSD, single step multi frame target detection)]
Pytorch weight decay and dropout
codeforces每日5题(均1700)-第五天
Principle of persistence mechanism of redis
pytorch-多层感知机MLP
[leetcode] wild card matching