views:

37

answers:

1

I'm used to writing python scripts that interact with files, data and databases but I haven't done user-interfaces.

For my current project, I want to show an image (jpg/gif/png) to a user so it can be region-tagged. Region-tags are not just information about the image (like location or has/doesn't have people in it) but about the contents and where they are in the image.

I would like to have the user select the tag, draw a rectangle and then store the x.y coordinates of the start and end corners of the rectangle. Almost all images have one of five different tags so the process could be a button for the tag I want, then draw the rectangle over the image, agree or redo the selection and store the data when done.

I would like to get starting pointers to python GUI tools which would enable me to do this image manipulation.

+2  A: 

Python has bindings for may GUI toolkits which can allow you to display an image and interact with it in any way you want. A binding for Tk comes installed with Python. I personally recommend PyQt (a binding to the Qt library), but many people also like wxPython, a binding to wxWindows.

See here for more. Googling will turn up much more information especially on comparison between the various toolkits. There are also SO questions that address this issue - look up for the relevant tags.

Eli Bendersky
Any of those have support or modules to deal with images and creating interfaces with images?
greye
@greye: I'm sure most of them do. PyQt surely does - it even comes with demo code for working with images (a simple image editor, IIRC) - just grep `QImage` in the demo code directory.
Eli Bendersky
If you're going to be doing any image processing (e.g. extracting tagged areas), Python Imaging Library (PIL) might be worth a look. It sounds like you might not really be doing anything beyond generating some metadata though.
Nick T