Skip to main content
. 2023 Aug 29;23(17):7502. doi: 10.3390/s23177502
Algorithm 1 Principle of location coding for non-standard environmental maps
Coding Principle
Input: Image edge length a, number of grids n × n
Output: Grid edge length u = a/n
1. Loop n times starting from the first line
2. Loop n times starting from the first column
3. The encoding position y for each loop row is u × j, and j is the current number of columns
4. Each loop has a column encoding position x of u × i, where i represents the current number of rows
5. The encoded value for each position is num2str ((i − 1) × a/u + j
6. End column loop
7. End row loop
8. End