It is currently Wed Sep 17, 2014 3:34 pm



Reply to topic  [ 57 posts ]  Go to page 1, 2  Next
 MPO2Stereo: Convert Fujifilm MPO files to JPEG stereo pairs 
Author Message
3D Angel Eyes (Moderator)
User avatar

Joined: Sat Apr 12, 2008 8:18 pm
Posts: 10899
jimmydonc wrote:
seriously how does your application work? Is there some long way around? what's the difference between an MPO and a jpeg? I changed the extension to jpeg out of curosity and was able to open it in photoshop. Of course it was the same as the 2 d jpeg. not it's stereo pair. where's that second image hiding in there??

Ok, let me give you a proper response. Basically an MPO file is just two standard JPEG files appended together. All my program does is slice the file into two and save the data with the JPEG extension. There is no conversion going on. The reason renaming the file to JPG works is because it is basically JPEG data. So an image program (like photoshop) will start reading the file as a JPEG and all is fine until it hits the End Of Image marker. The second image is right after that but the program is only expecting one image so it stops there. You can extract this data manually, but it will be time consuming for more than just a couple of pictures at a time. However if you have no other choice, here is how to do it.

- First off, you will need a Hex editor to manipulate the file. This one for Mac looks decent: https://www.ifd.com/product_info.php/products_id/87

- Open the MPO file in the Hex editor. Start a new search, set it to "Hex" and search for this string "FFD8FFE1". That is the Start Of Image marker for a standard JPEG/EXIF file. Your first find will be the beginning of the file naturally, so hit "Find Next". This will be the break point between the image data.

- Select all the data before this point and save it to a file with the extension "JPG", this will be the left image. Most hex editors will let you do something like "Save selection to file" or something similarly named. Now select all the data after the marker (and including the marker) and save this to another JPG file. This is the right image.

- Thats it, you're done. You now have both stereo pairs.

Obviously this is not very practical for a large set of images, but its at least a solution.

I am looking into how I can make my program for the Mac and I found a way to install OS X on my PC. If I can get OS X running it should be fairly simple to just re-compile the program for use on Mac. However this is a whole other can of worms to get into, so its probably going to be another week to two before I could have this done. But I am looking into it. I am also working on a fully featured 3D image editing program (to compete with StereoPhoto Maker) and now that I think of it, it would be nice to have cross-platform support (PC, Mac and maybe Linux). Would help at least to give me an edge. Macs are also popular with the photography crowd so if this Fujifilm camera becomes popular I could see a lot of demand for something like this. I'm not making any promises, but it is on the table.

_________________
check my blog - cybereality.com


Tue Sep 01, 2009 9:24 pm
Profile
One Eyed Hopeful

Joined: Mon Aug 31, 2009 1:19 pm
Posts: 5
a week or 2? thats all? hey. I'll wait for you. I'll donate some money for your efforts.

if you are making a program, may I offer a suggestion. a fun thought. I made a template in photoshop that I can put a stereo pair into so I can print out old timey stereoscope cards. That would be a neat plugin. easy enough to do in photoshop but would be awesome to have some automatic program.
Speaking of automatic. Batch features. I constantly use the batch feature in photoshop to apply effects to large numbers of files. A bath feature in your program would be cool too.


Wed Sep 02, 2009 10:31 pm
Profile
3D Angel Eyes (Moderator)
User avatar

Joined: Sat Apr 12, 2008 8:18 pm
Posts: 10899
jimmydonc wrote:
A batch feature in your program would be cool too.

Yeah, it already does that. You can just drag any arbitrary amount of MPOs onto the exe file and it will convert them all.

_________________
check my blog - cybereality.com


Wed Sep 02, 2009 11:51 pm
Profile
One Eyed Hopeful

Joined: Sat Sep 05, 2009 5:23 am
Posts: 4
I have a Mac and wanted to split some MPO's so built a little java app. Just extract the DMG, run SplitMPO, click "Convert File", Select a file. It writes a filename_l.jpg (left eye image) and filename_r.jpg (right eye image).

http://ssh.scrameta.net/www.scrameta.net/SplitMPO.dmg

I know the program is rubbish, but it does the job for now until someone writes something better...

Mark

Edit:Fixed URL


You do not have the required permissions to view the files attached to this post.


Last edited by scrameta on Mon Sep 07, 2009 5:17 am, edited 1 time in total.



Sat Sep 05, 2009 5:32 am
Profile
3D Angel Eyes (Moderator)
User avatar

Joined: Sat Apr 12, 2008 8:18 pm
Posts: 10899
scrameta wrote:
I have a Mac and wanted to split some MPO's so built a little java app. Just extract the DMG, run SplitMPO, click "Convert File", Select a file. It writes a filename_l.jpg (left eye image) and filename_r.jpg (right eye image).

Very nice work man.

_________________
check my blog - cybereality.com


Sat Sep 05, 2009 8:33 am
Profile
One Eyed Hopeful

Joined: Sat Sep 05, 2009 5:23 am
Posts: 4
I had a quick play to improve this this morning, since viewing them was annoying me! i.e. open left/right, resize windows etc...

Anyway it has some new features:
i) Convert a whole directory
ii) Displays last converted image
iii) Ability to select previously converted images (from current directory)
iv) Crosseyed or straight option

http://ssh.scrameta.net/www.scrameta.net/SplitMPOv2.dmg

I've also attached the jar in case someone wants to try this on a non-Mac. I think I might need to fix directory selection on non-Macs...

Mark

edit: Fixed URL


You do not have the required permissions to view the files attached to this post.


Last edited by scrameta on Mon Sep 07, 2009 5:17 am, edited 1 time in total.



Sun Sep 06, 2009 5:22 am
Profile
3D Angel Eyes (Moderator)
User avatar

Joined: Sat Apr 12, 2008 8:18 pm
Posts: 10899
This is really great news, now I don't have to bust my balls porting to Mac.

I am in the process of adding support for JPS output and hopefully that will be done soon (almost working now).

_________________
check my blog - cybereality.com


Sun Sep 06, 2009 8:54 am
Profile
One Eyed Hopeful

Joined: Sat Sep 05, 2009 5:23 am
Posts: 4
Yes I should add JPS output too. Just jpeg with the images next to each other right? Also I think animated gif for the wiggle style viewing would be good. Have to see how much Java will just do for me for almost free...

I'd offer to do the Mac port of your stuff, but I can't be bothered to learn Objective C and the OSX API right now!

Has anyone with a Mac tried this BTW? In case I messed up the deployment and it only runs on mine...

Mark


Sun Sep 06, 2009 1:06 pm
Profile
One Eyed Hopeful

Joined: Sat Oct 10, 2009 6:31 pm
Posts: 1
I just got a FUji W1 today. I almost sent it back until I downloaded your app for the MAC. It works fine for me (IMAC 20" Intel)

Bernard


Sat Oct 10, 2009 6:38 pm
Profile
One Eyed Hopeful
User avatar

Joined: Tue Oct 13, 2009 3:23 pm
Posts: 1
I have just updated my 3D slide maker for the Mac to include MPO files.
It's free at:- http://www.thebox.myzen.co.uk/Steroscopic_Site/Software.html
It's a bit of a hack, let me know if it works for you.


Tue Oct 13, 2009 3:29 pm
Profile
3D Angel Eyes (Moderator)
User avatar

Joined: Sat Apr 12, 2008 8:18 pm
Posts: 10899
I figured I'd post the source in case anyone wants. I compiled using Visual C++ 2008 Express, but it should work with any compiler.

Attachment:
MPO2Stereo.zip


You do not have the required permissions to view the files attached to this post.

_________________
check my blog - cybereality.com


Tue Oct 20, 2009 6:33 pm
Profile
One Eyed Hopeful

Joined: Wed Nov 04, 2009 1:25 am
Posts: 1
I am developing C++ class MPOWritter. The goal is to write mpo files which can be opened with Fuji Finepix V1 digital frame. The class is almost complete but it has some issue. I am looking tool that will help me to find that issue. I found Stereo Photo maker program, which has functionality to create MPO files. It also can preview mpo files. When I created mpo file with that program digital frame opens it as mpo file. When I creating mpo file using my class frame doesn't recognize it as MPO file. It opens file as single image. However stereo Photo Maker opens that file as MPO image. When I using your MPO2Stereo tool Left image becomes invalid jpeg while right image becomes valid. I think having your sources I will easily debug and find issue. Could you send it to my email arman.hunanyan@gmail.com. Thanks in advance


Wed Nov 04, 2009 1:45 am
Profile
3D Angel Eyes (Moderator)
User avatar

Joined: Sat Apr 12, 2008 8:18 pm
Posts: 10899
The source is posted in the post directly above the last one. It should be pretty easy to follow. The MPO is basically just two JPGs in one file, as I'm sure you realized. The left image is first, then the right image. If your left image is getting corrupted then most likely you are not writing the proper end of file marker for the JPEG/EXIF data. Take a look at some real MPO files and split them with my program if necessary. Then use a hex editor to check the last byte of data. That is most likely where the error is.

_________________
check my blog - cybereality.com


Wed Nov 04, 2009 7:24 pm
Profile
One Eyed Hopeful

Joined: Sat Sep 05, 2009 5:23 am
Posts: 4
That Slide Maker looks cool. Any chance of a PPC tiger build? :-)


Sun Dec 13, 2009 4:07 pm
Profile
One Eyed Hopeful

Joined: Wed Jan 20, 2010 6:21 am
Posts: 1
There is another way to work with MPO files. Latest version of STOIK Imagic 5.0.4 (http://www.stoik.com/imagic) can split MPO files such as made by FujiFilm FinePix Real 3D W1 into standard JPEGs, generate stereo pairs (JPS, PNS), and anaglyphs. STOIK Imagic is free, but some advanced features will require purchase of activation key after initial 30 days. Splitting of MPO into JPEGs is available in free version.


Wed Jan 20, 2010 6:25 am
Profile
Two Eyed Hopeful

Joined: Tue Dec 22, 2009 11:48 am
Posts: 79
Hello,

I'm working on S-3D apps for Linux. I wan't to include MPO viewing or converting. But I can't find MPO files.
Can you help me please ?

Thank you,

Magestik.

PS: Sorry for my bad english ... I'm french.


Fri Feb 05, 2010 10:00 am
Profile
3D Angel Eyes (Moderator)
User avatar

Joined: Sat Apr 12, 2008 8:18 pm
Posts: 10899
There are some MPO files in this post:
viewtopic.php?p=32306#p32306

_________________
check my blog - cybereality.com


Fri Feb 05, 2010 7:00 pm
Profile
One Eyed Hopeful

Joined: Wed Aug 25, 2010 2:11 pm
Posts: 2
I have found the link to this page in the program from here:
http://3dvision-blog.com/tag/mpo2jps/
I like that program, but I needed to convert all files of a directory.
I have modifed the BAT-file to convert all MPO-files of a directory to JPS-files:

FOR /F %%i IN ('dir /b /s *.mpo') DO (
"%~dp0\MPO2Stereo.exe" "%%i"
"%~dp0\jpg2jps.exe" "%%i" -delete
)

Maybe this is helpfull for other people too...


Wed Aug 25, 2010 2:23 pm
Profile
3D Angel Eyes (Moderator)
User avatar

Joined: Sat Apr 12, 2008 8:18 pm
Posts: 10899
You can also simply drag a number of files over the EXE and it will convert them all at once.

_________________
check my blog - cybereality.com


Wed Aug 25, 2010 8:40 pm
Profile
One Eyed Hopeful

Joined: Wed Aug 25, 2010 2:11 pm
Posts: 2
Yes, I like your program and I can drag a number of files over the EXE, but that does not work with the batch-file, which creates a JPS-file too.
You find it when you click on the link I have submitted before.
I have now found a way to resize the new JPGs too. Maybe this is a more interesting feature for other users
(because you can now create easily jps- and jpg-files for your website which your custom resolution):
Code:
@echo off
set linksa=_L.JPG
set rechtsa=_R.JPG

if %1.==loop1. goto loop1

FOR /F %%i IN ('dir /b /s *.mpo') DO call %0 loop1 %%i
goto ende

:loop1
"%~dp0\MPO2Stereo.exe" "%2"
set alt=%2
set neu=%alt:~0,-4%
"c:\Program Files (x86)\IrfanView\i_view32.exe" "%neu%%linksa%" /resize_long=800 /aspectratio /resample /convert="%neu%%linksa%"
"c:\Program Files (x86)\IrfanView\i_view32.exe" "%neu%%rechtsa%" /resize_long=800 /aspectratio /resample /convert="%neu%%rechtsa%"
"%~dp0\jpg2jps.exe" "%2" -delete
goto ende


Fri Aug 27, 2010 3:27 pm
Profile
3D Angel Eyes (Moderator)
User avatar

Joined: Sat Apr 12, 2008 8:18 pm
Posts: 10899
You may also want to take a look at my other utility, MPO2JPS, which converts directly to JPS:
viewtopic.php?f=3&t=4419

_________________
check my blog - cybereality.com


Sat Aug 28, 2010 2:24 pm
Profile
One Eyed Hopeful

Joined: Tue Sep 14, 2010 3:32 am
Posts: 4
thanks for writing MPO2Stereo, cybereality
thanks for writing SplitMPOv2, scrameta

they make the W1 usable ; P


Tue Sep 14, 2010 3:44 am
Profile
3D Angel Eyes (Moderator)
User avatar

Joined: Sat Apr 12, 2008 8:18 pm
Posts: 10899
No problem. Anything I can do to help.

_________________
check my blog - cybereality.com


Thu Sep 16, 2010 8:07 pm
Profile
One Eyed Hopeful

Joined: Thu Jan 20, 2011 1:06 pm
Posts: 1
Location: Toronto, ON Canada
Great program, but I was unable to use the MPO to JPG converter to convert by dragging from windows. It will run the converter, but the physical files are never created. I had to do it one by one from the dos promt.


Thu Jan 20, 2011 1:38 pm
Profile WWW
3D Angel Eyes (Moderator)
User avatar

Joined: Sat Apr 12, 2008 8:18 pm
Posts: 10899
Yeah, there was a problem with the file paths. I know on Vista 32-bit it works perfectly and you can drag and drop files on the exe. Other OSes may not not work the same, but the files should still be created. Its just that the folder is wrong. I don't remember where the JPEGs went, but they're on your computer somewhere. You could try searching for the filename and see if it comes up (for example: myImage.mpo would become myImage_L.jpg and myImage_R.jpg so search for that).

_________________
check my blog - cybereality.com


Thu Jan 20, 2011 8:07 pm
Profile
One Eyed Hopeful

Joined: Mon Feb 28, 2011 11:25 pm
Posts: 9
I tried the hex technique that cybereality suggested, and I noticed that the first image isn't always the left image. Here are two MPO files. What's interesting is they both have the same camera make, model, and software. I'm working on parsing the MPO file specification to see how I can determine the difference between the two.

DSCF0006 (chess) has the left-eye content as the first image.
DSCF0035 (bench) has the right-eye content as the first image

I have a batch of 25 sample MPO files, and 6 of them has the left-eye first, but 19 of them have the right-eye first. These are taken from Fjufilm's Real 3D W1, W3, and Sony DSC-TX9

Any ideas?

Thanks,

- Phil


You do not have the required permissions to view the files attached to this post.


Tue Mar 01, 2011 6:19 pm
Profile
3D Angel Eyes (Moderator)
User avatar

Joined: Sat Apr 12, 2008 8:18 pm
Posts: 10899
Interesting. Not sure what the answer is. All the MPOs I was testing with I believe were Left eye first, and I tried at least a dozen. But its possible there is something else going on. I am planning on picking up the W3 at some point, so that will make it a lot easy for me to test these things and update the program.

_________________
check my blog - cybereality.com


Tue Mar 01, 2011 6:33 pm
Profile
3D Angel Eyes (Moderator)
User avatar

Joined: Sat Apr 12, 2008 8:18 pm
Posts: 10899
@philipkd: I just looked at those images you posted and they are fine. Tried them with the DDD photo viewer and they looked good. Then I converted them to JPS using my MPO2JPS utility and the JPS files were rendered correctly. So I assume those images had left image first, just like all the other ones I tried. So I am not sure what they were supposed to prove.

_________________
check my blog - cybereality.com


Tue Mar 01, 2011 7:34 pm
Profile
One Eyed Hopeful

Joined: Mon Feb 28, 2011 11:25 pm
Posts: 9
Thank you for verifying this. You're right. I made the wrong guesses as to which eyes the images corresponded to. My mistake was not cropping appropriately according to parallax information. I found out how to do it here:

http://www.davidglover.org/2010/09/usin ... xunix.html


Tue Mar 01, 2011 7:49 pm
Profile
One Eyed Hopeful

Joined: Mon Feb 28, 2011 11:25 pm
Posts: 9
I just wanted to let you know I finished my website that'll convert MPO to various formats: http://3dporch.com/

I gained a lot from the resources in this thread, so I want to thank you. Have a go at the site, and let me know what you think!


Wed Mar 02, 2011 11:37 am
Profile
One Eyed Hopeful

Joined: Sat Mar 26, 2011 12:40 pm
Posts: 1
Surry guys for stupid question, but I'am beginer on your forum and in 3D technologies also and not in good english speaking performance (Iam ukrainian). In this topic I found lot of useful link and participant of this forum seems very professional. In this case let me ask you, is the any analog of StereoTracer software for mac for making this lovely GIF. I mean not a simple gif animation from MPO file, I mean good mathematic algorithm as in link above.

Thank for reply before :)


Sat Mar 26, 2011 12:56 pm
Profile
One Eyed Hopeful

Joined: Thu Jun 16, 2011 1:53 am
Posts: 1
I used cybereality's idea to get the left and right images in Python using the Python Imaging Library. This example doesn't save the images, as I am using them in a Python app:-

from PIL import Image
from StringIO import StringIO
file = open(r'F:\My Pictures\FinePix W3 3D\DCIM\100_FUJI\DSCF0007.MPO', 'rb')
left = Image.open(file)
left.show()
file.seek(4) # skip SOI and APP1 markers of 1st image
data = file.read() # read both images
file.close()
offset = data.find('\xFF\xD8\xFF\xE1') # find SOI and APP1 markers of 2nd image
file = StringIO(data[offset:]) # make a file containing the 2nd image
right = Image.open(file)
right.show()
file.close()


Fri Jun 17, 2011 9:21 pm
Profile
3D Angel Eyes (Moderator)
User avatar

Joined: Sat Apr 12, 2008 8:18 pm
Posts: 10899
Ok cool.

_________________
check my blog - cybereality.com


Sat Jun 18, 2011 8:42 am
Profile
One Eyed Hopeful

Joined: Wed Apr 18, 2012 8:48 pm
Posts: 2
Hey guys, thanks for all the great work. I recently bought a viewsonic 3DPF8 3d Digital frame. I converted my .mpo files to side-by-side .jpg using Mpo2Stereo, but when I view the image on the digital frame, it displays it as 2 2D side-by-side images instead of 1 3D image. Its not the frame, because I tried loading some side-by-side images that I found online and they seem to work great. I also tried the stereo photo maker, but get the same results. Any help is greatly appreciated. Thanks in advance!.


Wed Apr 18, 2012 9:11 pm
Profile
3D Angel Eyes (Moderator)
User avatar

Joined: Sat Apr 12, 2008 8:18 pm
Posts: 10899
Can you post one of the images that works so I can see the format? Also, you may want to try MPO2JPS and then renaming the files to JPG.

viewtopic.php?f=3&t=4419&p=31457

_________________
check my blog - cybereality.com


Wed Apr 18, 2012 9:29 pm
Profile
One Eyed Hopeful

Joined: Wed Apr 18, 2012 8:48 pm
Posts: 2
Thank you very much cybereality. I tried the MPO2JPS and it seems to work now. Thanks!!!


Fri Apr 20, 2012 10:04 pm
Profile
One Eyed Hopeful

Joined: Thu Jun 05, 2014 11:56 am
Posts: 3
ozzman2020 wrote:
Thank you very much cybereality. ..

+1
But. How to work with multiple images simultaneously?
that is, how to handle multiple photos at a time?


Thu Jun 05, 2014 12:08 pm
Profile
3D Angel Eyes (Moderator)
User avatar

Joined: Sat Apr 12, 2008 8:18 pm
Posts: 10899
You can just drag multiple files onto the exe file at once.

Or you can use a command window and type each name out, ie:

MPO2Stereo.exe img1.mpo img2.mpo img3.mpo ...

_________________
check my blog - cybereality.com


Thu Jun 05, 2014 9:10 pm
Profile
One Eyed Hopeful

Joined: Thu Jun 05, 2014 11:56 am
Posts: 3
tried - http://yadi.sk/d/3aE7NALUSXHpk
I do something wrong?


Fri Jun 06, 2014 12:37 pm
Profile
3D Angel Eyes (Moderator)
User avatar

Joined: Sat Apr 12, 2008 8:18 pm
Posts: 10899
That batch file is not my work, and I don't know how to use it.

Please use the exe file from this post: viewtopic.php?f=3&t=4419&p=31457

_________________
check my blog - cybereality.com


Fri Jun 06, 2014 9:49 pm
Profile
Display posts from previous:  Sort by  
Reply to topic   [ 57 posts ]  Go to page 1, 2  Next

Who is online

Users browsing this forum: Google [Bot] and 3 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Jump to:  
Powered by phpBB® Forum Software © phpBB Group
Designed by STSoftware.