Wednesday, August 2, 2017

Twin NX1000 Image Processing

In this blog I will describe how I process my images from the twin NX1000 rig with the z-bar. Same concepts apply for all twin camera rigs in the z-configuration (the left camera is upside down).

There are three steps involved:

  1. Transfer: Transfer the images from the camera to the computer.
  2. Match: Make sure that the images are matched in pairs (needed for multicoversion)
  3. Process: Read the left image, read the right image, align, save, repeat. You can do this manually or use multicoversion where you go have a cup of coffee, read the paper, and come back when everything is done.

Sounds simple, but the devil is in the details. It is always in the details. One complicating factor is that the images from the left camera are upside down.

Let’s look at these three operations closely:

Transfer Images

This is a common operation when using twin cameras for stereo, but I have found that it confuses some people. The confusion comes from not understanding computers (specifically Windows and the concept of folders). But that's a topic for another day.

First, I have the SD cards clearly labeled R and L, so there is no confusion which is which:




I also have permanent folders in my computer for the R and L images. I download the R images in a folder clearly marked for the R images and the L images to a folder clearly marked for the L images.

Here is how Windows Explorer (Windows 7) shows the two folders, when placed side-by-side. As you can see, the images from the L camera are upside down (click at the picture to enlarge).



Match Images

When shooting with twin cameras, occasionally one camera fires while the other does not. This happens with the Samsung NX1000 cameras if one is turned on while the other is off, or one is turned off while the other is on. For one reason or another, there might be extra (non-matching) images. When this happens to me during shooting, I immediately delete the extra image. By following good turning on/off procedures (see: http://drt3d.blogspot.com/2017/07/tips-for-using-twin-nx1000-cameras.html) I do not get many “orphan” images. But I always check to make sure the images are matched, before I do multicoversion because if they are not matched, multiconversion will fail.

You could match images using Windows Explorer (look at the picture above, you can visually see if there are any extra images, and delete them), however I like to use StereoPhoto Maker’s “Open File List” which is very similar to Windows Explorer, only better.

Note: Some people use and recommend StereoPruner. This is a program by Cyclopital3D that can be downloaded here: http://www.cyclopital3d.com/SUPPORT-AND-DOWNLOADS.html This program sorts the right and left folders to match the images.

Personally, I prefer to use "Open Image File List". Even if you use StereoPruner, you should become familiar with this SPM function because it is very useful.

SPM – Open Image File List

Open StereoPhoto Maker (SPM) and under File, select “Open Image file list”. This opens a window that looks very similar to Windows Explorer. I navigate the folders to find the L folder. At the top select “Open another instance”. This opens a second window. I navigate to find the R folder. These steps are shown here:




When everything is said and done, I have two folders (from SPM) side by side, the left sitting on the right (on purpose, so I can cross-view the images). Here is what I see:




I scroll down (both SPM folders scroll at the same time, nice!) freeviewing the images. This allows me to detect any extra images, which I then delete. When I am done, I have matching R and L images and I am ready to process them. The entire operation takes a minute or two.

Before we move to the final step, I want to make you aware of two things.

Image Numbering & Renaming:

If you look at the pictures above, you will notice that the image numbering of the R and L files is totally different. For example, the first image in the L folder is SAM_9600, while the first image on the R folder is SAM_1337. These numbers are off by 8000+. I have done this on purpose.

If you format new SD cards and reset the image number, then the numbers from each camera will be matching. Eventually, with errors and orphan images, they will drift away but not by much. If the  image names overlap, then SPM will not do multi-conversion correctly. In this case, you will need to rename one group of images.

You can rename the entire group of images (usually the L images) with SPM. While on the Image File List, go to “Edit”, then “Select All Files,” then right click and select “Multi-Rename”. This is a powerful function that allows you to do interesting renaming in the entire group of images. As powerful as it is, I prefer not to use it.

With previous twin camera systems, I tried to keep the file numbers matching. That was a pain. Now, I follow a different strategy: I have them as different as possible. By keeping a totally different file numbering, I do not have to worry about renaming images.

How did I change the file name sequence? I reset the numbering in only one of the two cameras at some point and this gets the numbers totally out of sequence. You can reset the file numbers via the menu, as I mention in this blog: http://drt3d.blogspot.com/2017/07/putting-twin-samsung-nx1000-camera-rig.html

Orientation Tag:

Notice that SPM shows the left image straight up but it has a number “3” in the corner. This number is called the “Orientation tag.” There are actually 8 different tags shown here:




By right-clicking at an image, you can select a different orientation tag. You can also select all the files (“Edit”, “Select All Files”) and change the tags on all of them (right click, “Set the Orientation….” (select what you like)).

Where does the orientation tag come from? It comes from the camera. If the camera knows that it is upside down, it marks the image with tag 3 “180 rotated”. Normally, all left images should have a tag of 3, but there is a situation where the camera does not know it is upside down. This happens when you point the camera up or down. In this case, the camera will give the file a standard “Original” tag because it is not aware it is upside down (think about this for a second…. when you point the camera directly up or down, there is no up or down camera). Because I shoot up and down often, I might select all files in the left folder and force the “3” tag before I try to match them. That’s just a detail, but it will eventually happen to you and you will wonder why an image from the L camera does not have the orientation tag “3” like the rest of the images. Now you know why.

Process Images

Processing the images can be done either manually (one at a time) or using multiconversion (batch processing, done by SPM).

For manual processing, go under “File,” “Open L/R Images,” find the left image, then find the right (the program prompts you). You then can do autoalignment (“Adjust”, “Auto Alignment” or press Alt-A). Save the combined and aligned image. If you move to the next image, SPM will automatically load the left image from the left folder and the right image from the right folder, because it is a clever program (so you do not need to navigate folders again).

Some people like to do manual processing like that. I prefer to do multicoversion. I don’t even attempt to view anything until everything has been aligned using multicoversion.

With multicoversion you go under “File” and “Multi Conversion,” and set up the dialog screen. You select “Independent (L/R)” as the Input file Type, tell the program where to find the R and L images, where (and how) to save the aligned image and anything else you want it to do. Here is how my multi conversion screen looks:




When I start multiconverion ("Covert All Files"), I always check the first image to make sure it is OK. If I see something wrong, I stop it, make corrections in the dialog screen and try again. You can check the aligned/saved images by opening another instance of SPM (you can run as many instances of the program as you like).

Everything sounds good. Except, when you load the image you just converted, you will notice that it is upside down!  It looks like this:




This is happening because SPM uses the name and orientation tag, from the L image to assign to the aligned image. Because the L image is upside down (orientation tag “3”) the resulting stereo pair will also have orientation tag “3”. To change this, after the alignment is completed, you can use SPM’s Image File List, select all the files and change the tag to “1”.

I have settled for a slightly different procedure: After I match the R and L images, I change the orientation tag of all L images to “1” (normal). Then, in the multiconverion screen, for the L image I select: “Rotation (180)”. The program then rotates the L image before alignment and the resulting image is not upside down because it carries the tag “1”. This is how my multiconverion screen looks (the only difference from the previous screen is the red square):




This completes my procedure. It is not very complicated and many steps are similar to when using any twin camera system. The only complication is that the left camera is upside down and it is the left image that SPM uses to give the aligned/saved image its name and orientation tag.

After a while, the processing steps become automatic. If anyone has any ideas or thinks they are doing this much easier or faster, I’d like to hear from you.



No comments: