Trimming the Video Sequences
When capturing video from several views (cameras), there needs to be some kind of trimming to ensure that each view correspond to each other in the digitizing process. Also it is often necessary when capturing video to capture a time sequence that is longer than the on in interest. In both cases there is a need for some kind of trimming of the beginning sequence and the end of the video sequence. The RealCap module has a built in feature that enables this trimming process. (This is one of the feature that the RealCap has and the Capture module, to be covered latter, does not have. But, for a reason that will be discussed latter. There is also a dedicated trimming module to be used with the Capture module.)
After the capturing process has ended and no frames (images) has been dropped during the process, you are asked if you would like to proceed directly to the trimming of the video.
The basic idea with trimming is to select a synchronization image/frame which is unique to the movement of interest. This could be the release of a discus or a heel strike during gait analysis or a triggered light etc. In the case of GenLock trimming is not necessary unless you want to start from particular point. However, with GenLock the process is much simpler. Do you need a GenLock? Absolutely not. Use the money for other purposes. I will show you how you can use a "software GenLock" that will do just the same and will cost you nothing. It comes with the Transformation Module. This "Software Genlock" will allow you to synchronize multiple cameras views to allow less then 1 millisecond error. Considering the fact that at 60 Hz each field can produce up to 16 millisecond discrepancy between field, this is a remarkable way to handle the potential error with software rather then spending Thousands of dollars to be able to use hardware GenLock. However, it is up to you. You can use either one.
One may ask, what is the error that I am going to have if I do not use any GenLock. Is that significant? From my experience of analyzing thousands of sequences for hundreds of different events, I feel that when using sport activities it does not matter allot. Take for example a study that we conducted at the Olympic Games in Atlanta at 1996. The conditions on the field were not suitable for high accurate analysis. We even had to use the athlete's body himself to be able to calibrate the field. After collecting the data and digitizing and filtering we were able to get better then 99 percent accuracy. Filtering the data will cause the raw data to be change more then any other factor. Therefore GenLock the cameras will not correct that. It will only assure that the cameras started at the same field and accurate within the field. To be up to 16 Millisecond off between the multiple cameras will not produce a significant error for most activities. Only when you try to determine an impact of a Golf ball on the golf club, or tennis ball on the racket surface may require this kind of accuracy. But for that you must have also cameras that collect data at over 5000 frames per second.
To be able to synchronize the multiple cameras views within one field, it is extremely important. You cannot allow more then one field discrepancy between cameras. This will create an error that might effect the results. For that reason you need the trimming capabilities. One may ask, well, how it was done before? when you did not have a GenLock or trimming capabilities. The answer to that is, that few years ago, you would have to capture frame at the time, and when you decided to synchronize on a particular event, such as heel strike, or ball impact on a racket, you would flag this particular frame as the synchronize frame and you would have to identify the same frame at each camera. This could be also an external event such as a flash light, or ball drop and contact with the ground, or, LED flash in front of the camera lens, or long time ago, a one second revolution clock in the background of the image. These were the old days, and I was there from the beginning. This how our old DOS APAS system used to work. This was before anyone else used computerized digitizing system. Yes, I was the first. In 1969 I published an article in the Ergonomics Journal about comparing knee joint angles utilizing sonar digitizer that was connected directly to the computer through time sharing system in Dartmouth College. This was the beginning of the APAS system. I was not there when Eadweard Muybridge collected his data utilizing multiple cameras to create a sequence. I am not so old... However, I can assure you that his accuracy was within one frame which means, up to 33 Millisecond or more error in synchronizing the cameras (It is possible that his frame speed was only 24 frames per second). Even in this case, he had remarkable accurate results.
After using the synchronization image/frame, the next step is to select the number pre and post images. Meaning how many images has to be stored in the AVI file for the digitizing process.
When capturing a new
view the previous setting of sync image and pre and post number of images is kept in order
to keep the same setting for the pre and post. In this way you need only to trim the
first sequence and find the same sych point for all other sequences and the pre and post
frames will remain the same. Obviously, only the synch point could be in a different time
sequence since the cameras do not start exactly at the same time unless they are
The following video file (trimming.avi, 5MB) will demonstrate the various options and will follow the text. This file utilize only the important frames. So in order for you to follow it with comfort you should play it with the MS-Mplayer frame by frame. The full trimming file is 12.5MB and can be downloaded here (trimming_example.avi 12.5MB). You should download the video file and play it as before from the MS Media Player so you can observe exactly the steps. How could you study better then that? You should notice that the Mplayer from Microsoft will play the trimming.avi trimming file at frame by frame. Not a field by field. It is only the APAS digitizing module that can separate the fields and play them field by field.
Using the Digitizing Module you can advance the video field by field, unlike using the MS Media Player that will only show you frame by frame. This is the uniqueness of the APAS system to allow this function. Use the RealCap and open an old file to trim and select the following file after you downloaded it to your computer. Then advance it field by field and you will see the frame number remain the same but the field counter Odd (O) and Even (E) change.
As you can see from the above figure, the Odd and Even fields are demonstrated. For a better demonstration you can download the frame counter here. (fieldT2.avi 2MB) You can advance the sequence field by field with the Digitizing Module and read the Odd and Even field to show you the seperation of the frame to its 2 fields at 60 hz.
When the Trim dialog is on the screen navigation through the captured sequence can be don using the following buttons:
The definition of a page is setup using the following buttons:
Selecting the Sync image: Selecting the sync image the Sync radio button must be click on. Navigate through the images and find the image you want and click the image.
Selecting the Pre number of images:
Selecting the Pre number of images the Pre radio button must be selected. When selecting
the image that has to be the first image in the sequence the number images is
automatically set. The number of images can also be set manualy using the edit box.
Selecting the Post number of images: Selecting the Post number of images the Post radio button must be selected. Determining the Post number of images the same applies as for the Pre number of images describe above only that the Post number of images respons to the number of images that has to go after the sync image.
Capturing multiple view: In case where there is multiple views (i.e. in 3D motion analysis) the selection of pre and Post number of images is only necessary for the first view. After this has been setup only the selection of the sync image is necessary keeping the sam time frame for all views.
Trim Old video..
In the File menu there is an option called Trim Old Video where it is possible to trim a previous saved video. The trimming process is still the same but before the process can take place you will be asked to find the video to trim using a simple file open dialog box.
The next video file: trimming_left_and_right_views.avi (4.5MB) illustrates the trimming procedures for two captured files. The raw data files are:
You should download these files so you can follow the trimming procedure and learn it in detail. These files will be used latter for the digitizing tutorial.
You will note in these illustration how the original files were trimmed to yields the following trimmed files:
These trimmed files will be used to be digitized.
In the process of trimming you should see how a small light on the tripod was used to synchronize the two sequences. When the light came on by crossing the beam, it was marked as the synchronize field. Then the sequence was assigned 200 fields after the synch field. For the second view the synch field was slightly difference since the cameras did not started simultaneously. However, the light indicated the synch field and then again 200 fields were selected beyond this point.
By downloading all these files, you will have the data to digitize this gate sequence.
So far, you were introduced to the RealCap to allow capturing video and the inherent trimming functions. The same functions are presented also in the Capture and the Trimming Modules which are more robust with many more functions. However, for simple capturing and trimming in a single module the RealCap will do the job.
After you learn these 4 lessons you have a choice of learning the Capture Module or go directly to the Digitizing module. One reason to go now to the digitizing module is that this will allow you to digitize the video files that were presented. However, you always should go back to learn the more comprehensive Capture Module and the Trimming Module which allow 4 sequences trimmed simultaneously.
RealCap Quick Reference
Capturing Video without VCR synchronization
Capturing Video with VCR synchronization
Trim the Video Sequence
The Tutorial will continue with Lesson 5 which introduce the Digitizing Module.