Slow python image processing with PIL and numpy?

Rather than looping over each row and column you can shift the array left, right, up, and down for the appropriate number of elements. On each shift you accumulate your values in a base array. After the shifting and accumulating you compute your average and apply your threshold to return a mask.

See this post which has a general discussion on the topic. The idea is take advantage of numpy's broadcasting, which will apply a function or operator to all elements of an array in C rather than Python.

There are better segmentation algorithms included in http://scikits-image.org , but if you want to build your own you can look at this example, based on clustering, called ICM segmentation. Specify N=4 to identify four regions.

I cant really gove you an answer,but what I can give you is a way to a solution, that is you have to find the anglde that you relate to or peaks your interest. A good paper is one that people get drawn into because it reaches them ln some way.As for me WW11 to me, I think of the holocaust and the effect it had on the survivors, their families and those who stood by and did nothing until it was too late.

Related Questions