Improved Method for Real-time Image Correction Based on the Control Point

In order to correct the distortion of images taken by mobile phone and solve the problem caused by selecting control points in man-machine interaction, an improved real-time image correction method is proposed. Firstly, all corner points on the test image are identified by algorithm and control points are extracted automatically from them. Then, we calculate the correction coefficient and store them on the control point method. After the correction of the image, the effective region is adaptive amplified. The experiment shows that it can correct the image with trapezoid distortion quickly and effectively, and meet the expected functional requirements. Introduction With the development of mobile Internet technology, smart phones have become an indispensable part of people's work and life. It not only enriches people's life greatly and brings a lot of convenience, but also causes some problems that cannot be ignored. Many people rely too much on their mobile phones and look down at their smartphones whenever and wherever they want. Doing this so often can affect vision, damage the cervical spine and damage health. More seriously, these "phubbing" often ignore the potential safety hazards around them, resulting in various accidents and personal injury. Based this phenomenon, it is particularly important to develop a pedestrian security protection software based on the smartphone platform. One of the core of this software is that the front camera of the smart phone can collect the road image in front of the walker in real time while the "phubbing" are walking and using the mobile phone simultaneously, and then identify the road features of the image in the background and give warning prompts when danger is found. Since there are distortions existing in the image captured by the mobile phone camera at a certain pitch angle. When the user uses the phone in the walking state, the phone will have a certain angle of tilt both in the horizontal and vertical directions, which will lead to the complex trapezoid distortion of the image taken, and affect the accuracy of subsequent image feature recognition [1]. The existing fast image correction method is based on the control point method, control points are selected by mouse click through human-computer interaction. The coordinate values of the selected points are arbitrary, and there are errors between the selected points and the ideal control points, which will lead to errors in the correction matrix coefficients, and ultimately lead to the decrease of the image distortion correction effect and recovery quality [2]. At the same time, due to the elevation angle of the mobile phone camera, the effective area of the image to be recognized will be compressed after the correction, which will affect the effect of subsequent recognition. This paper improves the existing real-time image correction method, aiming at the existing application requirements and technical problems, which can realize the automatic extraction of control points and adaptive amplification of the effective area, and realizes the real-time correction of the image of the effective area in front of the mobile phone holder [3]. Real-time Image Distortion Correction Method Based on Control Points Collect Standard Test Images Step 1: Prepare a board full of standard small squares to take standard test images, as shown in Figure 1. 223 Figure 1. Board full of standard small squares. Step 2: The adjustment range of the camera’s height and angle: take the lower left corner of mobile phone as the origin of coordinate system, take the long side of mobile phone as Y axis, the short side as X axis, When the phone is flat, Z-axis is perpendicular to the screen; pitch angle is the angle of mobile phone Y-axis rotates around X-axis, that is, the angle between the phone and the shooting plane, which is the angle between the optical axis of the camera and the vertical line of the shooting plane, Statistical analysis of its range mainly distributed in 10 to 45 degrees; the inclination angle is the angle of X-axis rotation around Y-axis, when holding the phone in the right hand, its range mainly distributed in 0 to 10 degrees, when holding the phone in the left hand, its range mainly distributed in -10 to 0 degrees. The height range of mobile phone’s camera is 110cm to 140cm. Step 3: The adjustment rules of the camera’s height and angle: fix the mobile phone on the triangle bracket and adjust the camera to 110 cm, adjust the height in the interval of 1 cm, and adjust the rotation angle of X axis and Y axis in the interval of with 1 degree, record the height of the mobile phone camera and the rotation angle of X axis and Y axis. Step 4: Collect a standard test image in real time, as shown in Figure 2. Figure 2. Collect a standard test image in real time. Extract Intersection Identify all the intersections in the test image. The intersections are the corners of the image. Use the Harris algorithm to extract the corners of the image. The specific flow is as follows: Step 1: Image preprocessing: After graying the collected Standard Test image, perform the Gauss smoothing filter. Step 2: Compare the gray value of each pixel in the standard test image with the gray value of the pixels in eight-neighbor area. As shown in Figure 3, if the difference of gray value within 20, the pixel is determined to be a similar pixel. If there are seven or eight similar pixels in eight-neighbor area, the pixel is determined to be in a flat area, not a corner; if there is only one similar pixel or no similar pixel in eight-neighbor area, it can also be determined that the pixel is not a corner.