I want an algorithm to crop an image, where to start

Tag: algorithm Author: cady193 Date: 2009-08-07

I want to a content analysis of a jepg image. I wish to take a jpeg image say 251 x 261 and pass it through an algorithm to crop it to say 96 x 87. Like an intelligent cropping algorithm, with a prompt to resize the image.

I'm a slightly confused. Are you trying to crop it or resize it? They are 2 different things.
And an "intelligent crop" is a 3rd. Note though that the aspect ratios are different in the example (0.96 vs 1.1) so perhaps Andre means resizing first, then cropping to match aspect ratio?
I think you may benefit from adding some additional tags to your question: what language and system are you doing this on?
Actually I want to do the both, crop and resize, and Iwish to do it in VS2005. Either C++, C# VB or J++. I want a content anaylsis done on these images before i being transfered from PC to a mobile device.

Other Answer1

Cropping and resizing are entirely different operations, and your question makes it sound like you don't know which you want.

I can't really tell where you're at with your process, but possibly you may benefit from obtaining and using ImageMagick.


Hey thanks just realised cropping and resizing is two different things. T Hanks for pointing that out to me. However, I need to learn to integrate imageMagick in code so i will have to learn how to use it. But again I wish to get some source code to crop the image, as well as to resize it. please work with me.

Other Answer2

If you are using .NET try using this.