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.
3D to 2D conversion for images
- fmw42
- Posts: 25562
- Joined: 2007-07-02T17:14:51-07:00
- Authentication code: 1152
- Location: Sunnyvale, California, USA
Re: 3D to 2D conversion for images
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
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
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
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
- fmw42
- Posts: 25562
- Joined: 2007-07-02T17:14:51-07:00
- Authentication code: 1152
- Location: Sunnyvale, California, USA
Re: 3D to 2D conversion for images
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?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
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