Passing/Returning Cython Memoryviews vs NumPy Arrays
问题 I am writing Python code to accelerate a region properties function for labeled objects in a binary image. The following code will calculate the number of border pixels of a labeled object in a binary image given the indices of the object. The main() function will cycle through all labeled objects in a binary image 'mask' and calculate the number of border pixels for each one. I am wondering what the best way is to pass or return my variables in this Cython code. The variables are either in