HV-6020: Using Video Overlay
In this tutorial you will learn how to use video overlay.
- Import and edit an image
- Overlay the image on top of an animation file and play the animation
- Import a video as a 2D image
- Overlay the video with an animation file and play the animation
- Align a video using multiple point alignment or camera properties
- Import a video as a 3D image
- Rotate and animate the video and animation file together
- Click the Image Plane tool button on the Annotations toolbar .
OR
- From the Results Browser right click and select Create > Image Plane.
The Image Plane tool allows you to import images and video files to the HyperView animation window. These images and videos can be edited and graphically placed in the animation window. They can also be imported as 2D images or 3D images which can be rotated in the graphics window just like a results file. The videos can be animated and synchronized to an animation file. See the Image Planes
topic for additional information.Import and Edit an Image, then Animate the Model
- Load the explorer.h3d file, located in the animation folder.
-
Within the Results Browser, expand the Section Cuts folder
and click on the icon next to Section 2.
The display of the section cut for Section 2 is turned off in the graphics area.
- Click the Image Plane panel button on the Annotations toolbar.
- Use the drop-down menu to set the Type: to 2D.
- Enter Altair for the Label.
-
Click on the Open File icon next to File and select the file altair.png.
The file is imported into the animation window.Note: The size of the image in the animation window.
-
To resize the image, click on any of the corners of the graphical manipulator
and drag to the new desired location. Resize the image as shown below:
-
To move the image, use the graphical manipulator in the lower left corner of
the image. Click on the horizontal axis to move the image horizontally, and
click on the vertical axis to move vertically. Center the image in the graphics
window as shown below:
You can also place the image at the center of the animation window by clicking on the Anchor tab in the Image Plane panel and selecting the Center icon .
-
Notice how the image cannot be seen because it lies under the animation. To
bring the image to the front, click on the Z-Stack tab in
the Image Plane panel and with the image label (Altair) highlighted, click the
up arrow .
-
Click on the Filter tab. Using this tab, the color white
will be removed from the image so that is has a transparent background.
- Set the Type to ColorAlpha.
- Set the Pixel mapping to Linear2.
- Set the Mode to Greaterthan.
-
Click on the Color option and pick the gray
color (just below white) from the color palette.
These settings remove the color white from the image.
- Close the Image Plane panel by clicking on the X at the top of the tab.
-
Animate the model.
Note: The model animates with the image placed on top of the model.
- Stop the animation.
Import a Video and Animate with Model
-
In the Results Browser, expand the Image Planes folder.
Note: There is the image plane named Altair that we created in the previous step.
- Right-click in the Results Browser and select Create > Image Plane.
- Set the Type: to 2D.
- For the Label, enter Explorer.
- Click on the Open File icon (next to File), select the file 06Explorer-f.avi, and click Open.
-
Select the XZ Right Plane View
to align the h3d model and the avi file in the same
plane.
-
Resize and move the image in the same manner as the
altair.png file.
-
Resize and move the image to match the size and location of the
model.
-
Resize and move the image to match the size and location of the
model.
-
Animate the model.
Note: The model animates with both the image placed on top of the model and the video in the background.
- Stop the animation.
Align a Video Using Multiple Point Alignment or by Entering Camera Properties
-
From the Image Plane panel, click on the Alignment
sub-tab. This sub-tab allows you to pick points on the image (in the image plane
tab) and corresponding nodes on the model (in the graphics window).
The points on the image and the corresponding nodes on the model should be as close and accurate as possible, in order to optimize the alignment and scaling. A minimum of seven points/nodes are required, however for this exercise we will select a total of nine points/nodes.Note: To enable the easy picking of nodes on the model, please make the image in the graphics window completely transparent by using the slider bar in the Display Options tab (sliding to High), or turn off the display of the Image plane from the Results browser tab. You can also adjust the color of the model, if necessary.
-
A set of nine node-point pairs that provided a good alignment with a very low
error value are shown in the images below. For the purpose of this exercise,
please try and select your points and nodes as closely as possible to those on
the images:
- Select the middle of the front wheel as the first point on the image (Pixel: 184 172).
-
Next, select the middle of the front wheel as the first node on the
model (Node: #2345791).
The Alignment tab is populated with the first point and node pair.
- Click the Add button and pick the second image point/node pair (Pixel: 606 178 Node: 2338497).
-
Click the Add button again and continue this
process to select the seven remaining point/node pairs (see the table
below):
Pixel: 131 253 Node: 2460819 Pixel: 117 173 Node: 2579302 Pixel: 430 362 Node: 2490332 Pixel: 257 302 Node: 2502038 Pixel: 526 360 Node: 2417448 Pixel: 400 174 Node: 2231375 Pixel: 523 188 Node: 2406298 An Error measurement is displayed above the Align button as soon as the seventh point/node pair is picked. This measurement will then be updated as additional pairs are added. An increase in the error measurement indicates that the last pair that was picked is not ideal and it is recommended that a different pair be selected instead.
Note: It is recommended that you select two points which lie on different depth levels. More points at different depths will create better alignment. Also, points located at the center area of the image/video are generally preferred than points near boundaries. Incremental adjustments to orientation can be performed with the help of graphical manipulators.
-
Click the Align button to scale and align the model and
image plane.
Note: If the currently selected points have an error value greater than 75, an error message will display and will ask if you would still like to proceed. See the Alignment section of the 2D Image Planes topic for additional information.A new view is created in the Views entity folder in the Result browser named ImagePlane1 Model1.
-
For the purposes of better visibility and analyzing correlation, a few things
can also be considered:
- Adjust the transparency of the image plane using the Display Options tab.
- Control the display order of the image planes and model using the Z-Stack tab. See the Z-Stack section of the 2D Image Planes topic for additional information.
- Apply a filter to the image using the Filter tab. See the Filter 2D Image Planes topic for additional information.
-
An alternate method for achieving alignment is also available. Go to the
Results browser tab and click on the ImagePlane Model1
view.
The Entity Editor is displayed at the bottom of the browser. You can use the Entity Editor to enter or modify the camera properties in the view. See the Views section of the Entity Editor topic for additional information.
-
All user defined or image plane alignment generated views are locked by
default. Unlock the ImagePlane1 Model1 lens type view by
unchecking the Lock box (located in the Standard section of the Entity Editor).
When a view is unlocked, it is also synchronized with the graphics window.
- Enter the camera properties for the view into the various fields located in the Camera section of the Entity Editor.
-
Animate the model.
Note: The model animates with both the image placed on top of the model and the video in the background.
- Stop the animation.
Import a Video as a 3D Object and Animate with the Model
- In the Results Browser, expand the Image Planes folder.
- Turn off the display of the two image planes already created by right clicking on both Altair and Explorer, and selecting Hide.
- Right click in the Results Browser and select Create > Image Plane.
- Set the Type: to 3D.
- Enter Explorer Video for the Label.
- Click on the Open File icon next to File and select the file 06Explorer-f.avi.
- Select the XZ Right Plane View to align the h3d model and the avi file in the same plane.
-
In the Image Plane panel, verify that you are in the Alignment tab.
This tab will be used to align the model in the video file to the model file.
- Set the Alignment Mode to 2 Point.
- Set the Plane to XZ Right.
-
The first set of reference nodes to be selected are the h3d model’s nodes.
Click on the green N1 selector to make it active, and
then select the center point of the left tire in the animation window.
If you can’t see the h3d model, simply use the Graphical Manipulator to move the video image out of the way.
-
Next activate the blue N2 selector, select the center
point of the right tire in the animation window, and then select
Done in the panel area.
When the two points have been selected, an arrow will be displayed going from N1 to N2.
- The same two points also need to be selected as reference nodes in the video. Click the yellow IN1 selector to make it active, and then select the center point on the left wheel of the image preview in the Image Plane panel.
-
Next click the yellow IN2 selector to make it active,
and then select the center point on the right wheel.
-
Click Align to align the two images.
- Click Close to close the Image Plane panel.
-
Animate the model and rotate the images in the animation window.
Note: The video can be graphically manipulated in 3-dimensions, as well as animated with the h3d file.