Rotation vector CV crosscheck

Test pattern thumbnail

Figure 1. Thumbnail of test pattern. Download the full-resolution image linked above.

This page provides the steps to properly test the compatibility of your rotation vector sensor implementation. This test should be run when the device declares the TYPE_ROTATION_VECTOR composite sensor feature.

Test

  1. Install OpenCV Manager on the Android device being tested.
  2. Download the OpenCV-3.0.0-android-sdk.zip package from SourceForge.net.
  3. Find the APK from the apk folder inside the downloaded archive. Load the APK on the device from a computer using the adb install command with the --bypass-low-target-sdk-block option. For devices running Android 13 or lower, this --bypass-low-target-sdk-block option isn't necessary. For more information, see Install an app.
  4. If there is an active account logged into Google Play, locate OpenCV Manager in Google Play and disable Auto-update in the context menu (the popup menu from the "..." button).

    Disable OpenCV Manager Auto-updates

    Figure 2. Disabling Auto-update in Google Play.

  5. Print out the linked test pattern, disabling any scaling options when printing. The pattern should fit US Letter paper in landscape or anything bigger.

    Note: The inline picture above is low resolution and just for illustration. Please do not directly print it as your pattern.

  6. Place the pattern on a horizontal surface.
  7. Start the Rotation Vector CV Crosscheck in the CTS Verifier app. Follow the guide to turn on airplane mode, turn off auto rotate, and adjust adaptive brightness and location if these changes have not been made.
    Test initiation

    Figure 3. Initiating the test.

  8. When the video preview appears, place the phone three feet (or one meter) over the pattern so the main camera is facing the pattern with yellow marker on the screen and yellow marker on the pattern aligned at the same corner.
    Test pattern placement

    Figure 4. Placing the test pattern.

  9. While keeping the pattern entirely in the camera view, rotate the Android device under test (DUT) around the pattern in three different directions, one by one (1, 2 and then 3 illustrated in picture below) as prompted by the rotation range indicator. Keep movement smooth and steady for the best result.
    Device movement

    Figure 5. Manipulating the device under test.

  10. After the capture, the camera preview will disappear and the analysis process will start. Wait patiently for analysis to finish; it usually takes one to five minutes depending on the phone performance. The phone will sound and vibrate at analysis completion. A numerical result will be presented on screen if the analysis is successful.
    Test completion

    Figure 6. Finishing the test.

  11. Click next to proceed to the pass/fail screen and review the result.
    Test success

    Figure 7. Passing the test.

  12. Follow these tips for best results:
    1. Since this is a manual test with complexity, you may want to try it a few times for the best results.
    2. Accelerometer, gyroscope, and magnetometer should be calibrated before testing for good results.

Troubleshoot

  1. Symptom: Test crashed when starting test case or immediately after finishing video recording.
    Cause: Likely an OpenCV Manager compatibility issue. Check logcat to confirm. If confirmed, check version and arch of the installed OpenCV Manager.
  2. Symptom: Test fails frequently due to "Too many invalid frame" errors.
    Cause: Likely due to video quality. Confirm the following conditions:
    1. There is enough ambient lighting for the test. Natural light usually gives the best result. However, when it is not available, abundant light from multiple angles that does not form obvious shadows works, as well. Avoid low angle lighting to reduce glare.
    2. The motion during video taking is smooth. Jerky movement causes blur and confuses the computer vision software.
    3. The pattern should always be entirely in video preview frame and located around the center. The pattern should be 1/4 ~ 1/2 the size of the video preview window. If the pattern is too small, the accuracy is reduced. If the pattern is too big, lens distortion is more obvious, and it is more difficult to keep the pattern always inside video recording frame.
    4. The camera is able to focus well. Some devices have trouble in focusing during video recording. This is usually due to there is too few variations in the scene, e.g. solid color smooth floor surface. Moving test pattern to a place with textured surface or introducing objects around the test pattern usually helps.
    5. Image stabilization is turned off.
  3. Symptom: The pitch and roll test works fine, but the yaw test regularly fails.
    Cause: First, make sure the magnetic field sensor is well calibrated. Rotation vector does not function well if magnetic field sensor is not calibrated.
    It is also possible that yaw axis fails due to video taking. Hold the device steady and walk/move around the test pattern for the yaw section of test. It is hard to maintain the quality of video while rotating device in hand.

Report feedback

If the steps above do not help, please make sure to follow the feedback steps below to report your issue.

Please gather the following information when reporting a bug:

  1. Android bugreport
  2. Screenshot if there is any error message on screen.
  3. Contents of /sdcard/RVCVRecData/. This folder contains video files and thus can be quite large if the test has already been taken multiple times. Clearing the folder and performing the test again will help reduce size. Inspect video files inside to find obvious issues in recording.
  4. Screenshot of the OpenCV Manager app.