Combining Views Using the two_views VicPy Module
Posted by Micah Simonsen, Last modified by Micah Simonsen on 10 August 2017 09:33 AM
Users now have the ability to combine views from two 3D systems using only a rigid speckled target. This can be used in any case where data from two systems must be combined:
- Facing systems, e..g, two sides of a tensile coupon for measuring thinning
- Parallel systems that do not overlap to achieve a wider field of view
- Systems imaging a cylinder at 90º
☞In order to start, you must have the VicPy environment and module installed: Installing VicPy
Computing the coordinate transforms
- Begin by setting up the two systems to properly image your specimen (e.g., a tensile coupon).
- For high accuracy, all good test practices must be followed with special care. Any vibration or relative motion of your two systems will cause errors; if micron accuracy is desired, motions must be kept to a submicron level.
- Set up Vic-Snap with the four cameras in two systems (System 1 and System 2). The following steps will require the files be named with -sys1- and -sys2- as inserted automatically by Vic-Snap.
- Calibrate both systems as usual; take extra care, because any calibration problems will result in measurement errors in thickness, thinning, etc.
- Ensure that all four cameras are well synchronized for the following steps1.
- Position a rigid target, speckled on both side, in the view of each system and as normal as possible to each system. This target will typically be the test article itself, when practical.
- Take a reference image in this position.
- Now, take a series of 10 or more images while rotating the object.
• Larger rotation angles will yield more accurate results as long as the object remains focused and the viewing angles are not too oblique.
• The same type of target motions that are used for system calibration are well suited for our purposes here.
- Now, run the individual data for system 1 using the image from step (7) as the reference and the images from (8) as deformed. Be sure Auto plane fit is off.
- Repeat for system 2.
- Start the Anaconda Console.
Navigate to the data directory and use the two_view.py script (see attachment) to compute the transformations in the following manner:
>python two_view.py TESTPREFIX -o project_file.z3d
The TESTPREFIX is the name of the test from Vic-Snap, i.e., the images are named TESTPREFIX-sys?-?????_?.tif. If you omit the output file, a default file named trafos.z3d will be created.
(Here, we've simplified things by copying the two_view script to the same directory as the data files, and then navigating there within the Anaconda Console.)
- For help with options and usage, type
>python two_view.py -h
- The python script computes transformations that bring the data from both systems into a common coordinate system and stores them in the specified project file. The script also writes a sequence of transformed output files to the disk and includes the data files in the specified project file. To verify correct registration, open the project file in Vic-3D, merge the data (see step 8 below) and verify that everything looks correct.
Using the computed transforms
- Proceed with the test, being sure that the systems are kept very still and rigid and that images are synchronized.
- Using the system 1 calibration, run the data from system 1, being sure to keep the plane fit off.
- Import the system 1 transform using Data... Coordinate tools... Import from project file.
- Apply the transform to all data.
- Save the project, and then repeat for system 2 with the system 2 calibration and transform.
- You should now have .out files on disk for all images for both systems, in the same Cartesian coordinate system.
- To merge the data, bring all system 1 and 2 data into a new project using Project... Data files.
- Then, click Data... Postprocessing tools... Combine data files.
The data will be automatically grouped by sequence number. You can choose an output prefix, and then click Start; the data will be written to new combined OUT files and added to the project.
1If the images cannot be perfectly synchronized, then you must use a fixture to hold the target perfectly still for each image.