View full-text article in PMC Sensors (Basel). 2019 Jun 30;19(13):2903. doi: 10.3390/s19132903 Search in PMC Search in PubMed View in NLM Catalog Add to search Copyright and License information © 2019 by the authors. Licensee MDPI, Basel, Switzerland. This article is an open access article distributed under the terms and conditions of the Creative Commons Attribution (CC BY) license (http://creativecommons.org/licenses/by/4.0/). PMC Copyright notice Algorithm 1 Tensor assembler. 1:proceduregenerate tensor(I, x, y, ws, CND) 2: T=∅ 3: for m=x−CND:x+CND do 4: for n=y−CND:y+CND do 5: crop a rectangular patch with a top-left corner point at n, m and size ws 6: append window to T 7: end for 8: end for 9: return T 10: end procedure