1page.title=Rotation Vector CV Crosscheck 2@jd:body 3 4<!-- 5 Copyright 2015 The Android Open Source Project 6 7 Licensed under the Apache License, Version 2.0 (the "License"); 8 you may not use this file except in compliance with the License. 9 You may obtain a copy of the License at 10 11 http://www.apache.org/licenses/LICENSE-2.0 12 13 Unless required by applicable law or agreed to in writing, software 14 distributed under the License is distributed on an "AS IS" BASIS, 15 WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 16 See the License for the specific language governing permissions and 17 limitations under the License. 18--> 19<div class="figure" style="width:214px"> 20 <img src="images/acircles_pattern_reduced.png" alt="Test pattern thumbnail" height="166" /> 21 <p class="img-caption"> 22 <strong>Figure 1.</strong> Thumbnail of test pattern. Download the 23full-resolution image linked above. 24 </p> 25</div> 26<p>This page provides the steps to properly test the compatibility of your <a 27href="https://source.android.com/devices/sensors/sensor-types.html#rotation_vector">rotation 28vector sensor</a> implementation. This test should be run when the device declares 29the TYPE_ROTATION_VECTOR composite sensor feature. See this <a 30href="https://www.youtube.com/watch?v=MsDVmsH1PaI">video tutorial</a> for 31additional details.</p> 32 33<h2 id=testing>Testing</h2> 34 35<ol> 36 <li>Install OpenCV Manager on the Android device being tested. 37 <li>Download the OpenCV SDK from <a 38href="http://opencv.org/downloads.html">OpenCV.org</a>. Select 39<strong>OpenCV for Android</strong> with version 3.0.0. 40 <li>Find the APK 41from the <code>apk</code> folder inside the downloaded archive. Consult <a 42href="http://developer.android.com/tools/help/adb.html#move">installing an 43application</a> for the command to load APKs onto the Android device from 44computer. 45 <li>If there is active account logged into Google Play, also locate 46OpenCV Manager in Google Play and disable <em>Auto-update</em> in the context menu 47(the popup menu from the "..." button). 48 <img src="images/openvc-play.png" alt="Disable OpenCV Manager Auto-updates" height="533" id="disable-opencv" /> 49 <p class="img-caption"> 50 <strong>Figure 2.</strong> Disabling Auto-update in Google Play. 51 </p> 52 <li>Print out the linked <a href="images/acircles_pattern.pdf">test pattern</a>, 53disabling any scaling options when printing. The pattern should fit US 54Letter paper in landscape or anything bigger. 55<p class="note"><strong>Note:</strong> The inline picture above is low 56resolution and just for illustration. Please do not directly print it as your 57pattern.</p> 58 <li>Place the pattern on a horizontal surface. 59 <li>Start the <strong>Rotation Vector CV Crosscheck</strong> in the CTS Verifier 60app. Follow the guide to turn on airplane mode, turn off auto rotate, and 61adjust adaptive brightness and location if these changes have 62not been made.<br /> 63 <img src="images/RVCVXCheck_start.png" alt="Test initiation" height="533" id="test-start" /> 64 <p class="img-caption"> 65 <strong>Figure 3.</strong> Initiating the test. 66 </p> 67 <li>When the video preview appears, place the phone three feet (or one meter) over 68the pattern so the main camera is facing the pattern with yellow marker on the 69screen and yellow marker on the pattern aligned at the same corner.<br /> 70<img src="images/RVCVXCheck_down.png" alt="Test pattern placement" height="207" id="test-pattern-placement" /> 71 <p class="img-caption"> 72 <strong>Figure 4.</strong> Placing the test pattern. 73 </p> 74 <li>While keeping the pattern entirely in the camera view, rotate the Android 75device under test (DUT) around the pattern in three different directions, one 76by one (1, 2 and then 3 illustrated in picture below) as prompted by the 77rotation range indicator. Keep movement smooth and steady for the best result.<br /> 78 <img src="images/RVCVXCheck_flow.png" alt="Device movement" height="426" id="device-movement" /> 79 <p class="img-caption"> 80 <strong>Figure 5.</strong> Manipulating the device under test. 81 </p> 82 <li>After the capture, the camera preview will disappear and the analysis process 83will start. Wait patiently for analysis to finish; it usually takes one to five 84minutes depending on the phone performance. The phone will sound and vibrate at 85analysis completion. A numerical result will be presented on screen if the 86analysis is successful.<br /> 87 <img src="images/RVCVXCheck_next.png" alt="Test completion" height="533" id="test-complete"/> 88 <p class="img-caption"> 89 <strong>Figure 6.</strong> Finishing the test. 90 </p> 91 <li>Click <strong>next</strong> to proceed to the pass/fail screen and review the result.<br /> 92 <img src="images/RVCVXCheck_pass.png" alt="Test success" height="533" id="test-success" /> 93 <p class="img-caption"> 94 <strong>Figure 7.</strong> Passing the test. 95 </p> 96<li>Follow these tips for best results: 97 <ol> 98 <li>Since this is a manual test with complexity, you may want to try it a few times 99for the best results. 100 <li>Accelerometer, gyroscope, and magnetometer should be calibrated before testing 101for good results. 102 <li>See this <a href="https://www.youtube.com/watch?v=MsDVmsH1PaI">video 103tutorial</a> for additional details. 104 </ol> 105</ol> 106 107<h2 id=troubleshooting>Troubleshooting</h2> 108 <ol> 109 <li>Symptom: Test crashed when starting test case or immediately after finishing video recording.<br> 110 Cause: Likely an OpenCV Manager compatibility issue. Check 111 <code>logcat</code> to confirm. If confirmed, check version and arch of the 112 installed OpenCV Manager. 113 <li>Symptom: Test fails frequently due to "Too many invalid frame" errors.<br> 114 Cause: Likely due to video quality. Confirm the following conditions: 115 <ol> 116 <li>There is enough ambient lighting for the test. Natural light 117 usually gives the best result. However, when it is not available, abundant 118 light from multiple angles that does not form obvious shadows works, as well. 119 Avoid low angle lighting to reduce glare. 120 <li>The motion during video taking is smooth. Jerky movement causes 121 blur and confuses the computer vision software. 122 <li>The pattern should always be entirely in video preview frame and 123 located around the center. The pattern should be 1/4 ~ 1/2 the size of the 124 video preview window. If the pattern is too small, the accuracy is reduced. 125 If the pattern is too big, lens distortion is more obvious, and it is more 126 difficult to keep the pattern always inside video recording frame. 127 <li>The camera is able to focus well. Some devices have trouble in 128 focusing during video recording. This is usually due to there is too few 129 variations in the scene, e.g. solid color smooth floor surface. Moving test 130 pattern to a place with textured surface or introducing objects around the test 131 pattern usually helps. 132 <li>Image stabilization is turned off. 133 </ol> 134 <li>Symptom: The pitch and roll test works fine, but the yaw test regularly fails.<br> 135 Cause: First, make sure the magnetic field sensor is well calibrated. 136 Rotation vector does not function well if magnetic field sensor is not 137 calibrated.<br> 138 It is also possible that yaw axis fails due to video taking. Hold the 139 device steady and walk/move around the test pattern for the yaw section of 140 test. It is hard to maintain the quality of video while rotating device in 141 hand. 142 </ol> 143 144<h2 id=reporting>Reporting feedback</h2> 145 146<p>If the steps above do not help, please make sure to follow the feedback steps below to report your issue.</p> 147 148<p>Please gather the following information when reporting a bug:</p> 149 <ol> 150 <li>Android bugreport 151 <li>Screenshot if there is any error message on screen. 152 <li>Contents of <code>/sdcard/RVCVRecData/</code>. This folder contains 153 video files and thus can be quite large if the test has already been taken 154 multiple times. Clearing the folder and performing the test again will 155 help reduce size. Inspect video files inside to find obvious issues in 156 recording. 157 <li>Screenshot of the OpenCV Manager app. 158 </ol> 159