I have an numpy array with image data. I want to have a slice of this data at any angle. Rotating the whole image in the array is not an option as this is too slow for my application. Thus I need something faster. To illustrate I provide an image (here the green line shows an example of a slice I need):
Asked
Active
Viewed 764 times
0
-
How exactly do you define the angle? Could you provide some example of the code you tried? – Jerzy Pawlikowski Nov 18 '15 at 16:47
-
the slice do not necessarily start from 0, correct ? is the slice necessarily increasing on your data? – Colonel Beauvel Nov 18 '15 at 16:48
-
1This isn't a `slice` in the normal Python/numpy sense. It is a selection of data points, requiring advanced indexing, e.g. `image[I,J]` where `I` and `J` are arrays or lists. – hpaulj Nov 18 '15 at 17:16
-
I define angle as angle between the x axis and the slice line. The line must cross the maximum of the Gaussian that I take picture of. I tried rotating the whole image using scipy.ndimage.interpolation.rotate and taking a simple slice. Now I am searching for a way to do it faster. As I understand accessing array data element wise is rather slow (I more used to programming in C++ where this is not a problem), so I'm trying to think of a way of doing that without it. It does not necessarity start from 0. Don't know what you mean by "increasing on data". – Pagirnis Nov 18 '15 at 17:23