views:

123

answers:

5

Hi, I have searched on the web for software that batch convert image at different rotation angle from a source file, but my searches went unsuccessful. Does what I am looking for exists? What would be awesome is an application that we browse for a source image in PNG and a target directory and when a button is pressed the program create every "source-" + angle + ".png" like source-1.png to source-360.png.

Anyone know such a program?

EDIT

For more clarity, I want to put oriented marker inside google map in a asp.net web app. Since google map api doesn't allow to set the angle we want to show the image, I will set the src of tag with the link to the wanted angle. Something similar can be found there with the planes (direct link to plane at 0 degree, 180 degree, 290 degree).

So I have my basic png file 20px by 20px, but I rather prefer not to create 360 images wich would be a pain because I have 6 type of images for now and counting. So I was looking for a little soft that would help me achieve this.

A: 

Check out photosynth and see if that's not what you're trying to do.

No Refunds No Returns
gee ... someone hates working software that does exactly what the question asked for. maybe an explanation for the downvotes?
No Refunds No Returns
I didn't downvote you...but the point is that photosynth does *not* do what the asker is desiring.
Beska
This guy is describing photosynth. He could be the PM.
No Refunds No Returns
Photosynth does not do what he's asking for...I think you're misinterpreting the question. (I base this assertion on the response I got for my answer, and the fact that @egarcia's answer, which is similar, but better, than mine, is marked as the accepted answer.) He's just taking a 2d image, rotating it, and resaving it...and he wants to automate it. No 3d, real or simulated, involved.
Beska
+2  A: 

EDIT: the parent didn't correctly expose the problem. It sounded like 3D stuff at the beginning.

For rotating images, you can use ImageMagick

It is a console program, but it can be used very easily to rotate images. This:

convert image.png -rotate 45 image-45.png

Will create a new image called image-45.png that is the result of rotating image.png 45 degrees.

You can make a bat or sh file to automatize this process (so you have a proper name and the 360 images generated on a loop). However the script is completely different depending on what platform you are on.

Please include what is your platform (Windows, Linux, Mac) so I can be more specific.

egarcia
coming from an image processing background, this is quite a complicated task, IMHO.Using google sketchup, on the other hand, has made it quite easy, if you understand the principles behind it
ram
mm I removed the sketchup reference days ago. You must have read a cached page.
egarcia
A: 

Actually, you could create a short routine in Photoshop that would do this. Photoshop allows you easily rotate by an arbitrary angle. You can save this as an action, and then (assuming photoshop hasn't changed too drastically in the last few releases) save that action as an executable that you can run on your images.

Something to consider is that rotating an image, saving it, rotating that modified image, and so on, you will probably encounter increasing picture degradation. Ideally, you should have all of your rotations based off your original image. That might make the photoshop solution a bit more difficult...not sure if there's an easy way to put parameters (angle, in your case) into the saved routines.

Finally, are you sure you need 360 images? I'd suspect that you could get away with maybe 36 images, and just give the user the closest one, and at that image size (you say your input image is 20x20), it would be just fine.

Beska
I don't have photoshop :-( Can't afford it. But you are probably right for the 36 images instead of 360. Kudos for the fact that you posted an answer about my question.
lucian.jp
A: 

Paste the following code into LINQPad:

using(var sourceImage = Image.FromFile(@"C:\Path\To\Image")) {
    for(int angle = 0; angle < 360; angle += 10) {
        using(var newImage = new Bitmap(sourceImage.Width, sourceImage.Height)) 
        using(var g = Graphics.FromImage(newImage)) { 
            g.TranslateTransform(sourceImage.Width / 2, sourceImage.Height / 2);
            g.RotateTransform(angle);
            g.DrawImage(sourceImage, -sourceImage.Width / 2, -sourceImage.Height / 2);

            newImage.Save(@"C:\Whatever\Rotated Images\" + angle + ".png");
        }
    }
}
SLaks
What you are doing is called "affine" transform. What he is asking for is 360 degree image reconstruction
ram
@Ram: Are you sure?
SLaks
yup: http://en.wikipedia.org/wiki/Affine_transformation. Generating 3D object from single/multiple images is quite comples, considering the perspective nature of the camera (and hence it is called perspective transformation). Generating 3D information from single image is even more harder than with multiple images. look in google for single view meterology
ram
@Ram: AFAIK, he doesn't have a 3D image.
SLaks
yup, you dont need a 3D image to create a 3D representation of the object. see Criminisi's work http://research.microsoft.com/apps/pubs/default.aspx?id=67278
ram
it's 2d stuff, not 3d
egarcia
The OP does not want a 3d image. He's looking for rotations of a 2d image. That's it.
Beska
A: 

My company's Eyebatch software can do it. http://www.atalasoft.com/eyebatch/ It's not free, but we donate all proceeds to charity.

If you want to use .NET to do it, we make DotImage Photo, which also makes this pretty easy http://www.atalasoft.com/products/dotimage/photo

Lou Franco
Lou : Do you do 3D reconstruction from 2D images ?
ram
Not sure what you mean by that, but if it's something like PhotoSynth, then no. But either of those products can create rotated images from a given one. Eyebatch is an application that allows you to create image processing batch commands with a simple GUI.
Lou Franco