Page 1 of 1
3D to 2D conversion for images
Posted: 2011-07-06T14:32:42-07:00
by raj.kumar
I need to convert 3D images to 2D images for multiple formats: jpg, mp4, mpo etc from my PHP application.
(Basically, I need to crop one of the two images in the stereoscopic 3D file.)
Could anyone suggest any frameworks/libraries which can help me with this.
Re: 3D to 2D conversion for images
Posted: 2011-07-06T15:10:05-07:00
by fmw42
What do you mean by 3D? Do you mean a pair of stereographic images? Is all you want to do simply to crop one of the two stereo images and not the other? If so, IM can do a crop of an image and output it to many formats.
convert image -crop WxH+X+Y +repage output
see
http://www.imagemagick.org/Usage/crop/#crop
see
http://www.imagemagick.org/script/formats.php#supported
What platform are you on? Do you have IM installed? If so, what version? Do you want to use the command line as above or one of the APIs
see
http://www.imagemagick.org/script/api.php
You can use simple PHP with the exec command to run an IM command line or you can rewrite the command line in one of the PHP API formats, e.g.
MagickWand for PHP
or
IMagick
Re: 3D to 2D conversion for images
Posted: 2011-07-06T17:50:27-07:00
by raj.kumar
Thanks for your reply. This is useful. I do have IM installed in a Linux environment.
So this will take care of converting 3D stereoscopic images to 2D.
Any idea how can I do this for 3D video to 2D video conversion ?
I think, IM works only for images. But how about any pointers to the commands
in tools like ffmpeg, flix, or others?
Thanks again,
Raj
Re: 3D to 2D conversion for images
Posted: 2011-07-06T18:14:20-07:00
by fmw42
raj.kumar wrote:Thanks for your reply. This is useful. I do have IM installed in a Linux environment.
So this will take care of converting 3D stereoscopic images to 2D.
Any idea how can I do this for 3D video to 2D video conversion ?
I think, IM works only for images. But how about any pointers to the commands
in tools like ffmpeg, flix, or others?
Thanks again,
Raj
I am still puzzled by your 3D format? What type of image is it? Is it just two images each such as tiff or png or jpg? What is it you are really trying to do?
You can install the ffmpeg delegate library and any others you want and then reinstall IM from source and then IM will use ffmpeg to deal with videos.
type
convert -list configure
and see what delegates IM knows about. If ffmpeg is installed it will include mpeg. Look at the line starting with DELEGATES. For example I have
DELEGATES bzlib fftw fontconfig freetype gs jpeg jng jp2 lcms2 lqr lzma
mpeg openexr png rsvg tiff x11 xml zlib
You can also see what format IM can use with your configuration by typing:
convert -list format
for video processing see
http://www.imagemagick.org/Usage/video/
for IM install from source see
http://www.imagemagick.org/download/www ... .html#unix
http://www.imagemagick.org/script/advan ... lation.php