View full-text article in PMC Sensors (Basel). 2024 Jan 30;24(3):897. doi: 10.3390/s24030897 Search in PMC Search in PubMed View in NLM Catalog Add to search Copyright and License information © 2024 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 (https://creativecommons.org/licenses/by/4.0/). PMC Copyright notice Algorithm A1 Cartesian to Polar Conversion Algorithm procedure CartesianToPolar(img) rows←img.height cols←img.width centerX←cols/2 centerY←rows/2 X,Y←CreateMeshgrid(1tocols,1torows) X←X−centerX Y←centerY−Y θ←CalculateAngle(Y,X) ρ←CalculateDistance(X,Y) theta_rho_pairs←EmptyList() for ifrom0torows−1 do for jfrom0tocols−1 do if img[i,j]>0 then theta_rho_pairs.append([θ[i,j],ρ[i,j]]) end if end for end for return theta_rho_pairs end procedure