2

I would like to create some training data for a neural network. Let's say I have a photograph of lots of biological cells. I want to draw a box of a fixed size around each cell and save the selection as a separate file.

What software could accomplish this? I'd like something free and open-source, that works on Windows. Ideally I'd like a workflow in which I click on the image, a pre-specified box shows up, the file gets automatically cropped and saved, and then I can carry on clicking and cropping.

1

Using the free and open source GIMP (link), you could customize a script to crop as many images as you want via batch mode.

Here's a sample that is "close", but you'd need to edit to meet your needs. It crops the images using the center as the centerpoint of the crop.

Batch crop images... but keep centered:

http://registry.gimp.org/node/27360

Batch crop images, top left based:

https://stackoverflow.com/questions/25324220/halfmanualy-crop-image

Another custom AutoCrop for GIMP:

https://stackoverflow.com/questions/5811378/how-do-i-write-a-custom-auto-crop-script-using-the-gimp

  • Thanks! Does GIMP allow you to use the mouse to position a box and then crop and save as a separate file? I want to keep creating smaller sub-images of the same size. – a25bedc5-3d09-41b8-82fb-ea6c353d75ae Mar 18 '16 at 22:43
  • There's a "trick" for that. Open up all the images as layers (drag and drop them all into the same image), then you can use a plugin like this to export each image out to a separate file: registry.gimp.org/node/28268 – Baronz Mar 18 '16 at 22:54

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.