> Den 17. des. 2013 kl. 01:59 skrev Rafael Vasco <
rafael...@gmail.com>:
>
> Hi, i'm just getting started with Cython. My situation is that i'm trying to get more speed of a scanline floodfill function that i made ,
By the way:
If I were your boss, I'd fire you right there. Well, almost.
Do not reinwent the wheel!
For image processing in Python, learn to use NumPy and tools like:
scikit-image
scipy.ndimage
OpenCV
VTK and mayavi2 mlab scripting
PyOpenGL
matplotlib
PIL
Intel IPP (e.g. with Cython)
In this case, you probably want cv2.floodFill from OpenCV or ImageDraw.floodfill from PIL.
(There is an object called ImageQt for interfacing PIL with PyQt/PySide QImage. OpenCV can be interfaced via NumPy.)
Trying to outsmart toolkits like these is brain dead. Intel engineers have e.g. spent years on optimising and quality checking the OpenCV library. You cannot do it better yourself, or if you could, it would still be a complete waste of time.
Check the existing toolkits first. If they don't fit, then write your own code.
Regards,
Sturla