The present disclosure relates to a camera recalibration system and the method thereof.
Recently, camera-based surveillance systems have become more and more popular in communities, buildings, parks, and even residences to perform security and environmental monitoring therein, so as to improve social security of daily life. Those cameras are usually disposed on building walls or fixed to utility poles on the roadside, so they are subject to be deviated, obstructed, or damaged naturally or artificially, especially the changes in the position and viewing angle thereof. Thus the cameras can't work well in the way they are supposed to do. Although most of the surveillance systems have been equipped with functions of sensor detection, the sensors can only detect power failures, signal troubles, or mechanical faults of hardware. The systems are generally unaware of whether image-capturing conditions of the cameras are deviated or obstructed in real time. It usually takes long time to retune the cameras to their original settings after the extraordinary events occur. In such cases, the images or records captured by the out-of-condition cameras may not what they are presumed, which may cause serious impacts on the applications of intelligent video analysis.
Therefore, it is in need of a system and method for recalibrating cameras in an automatic way, which can provide the system with calibration information and inform the maintenance operators to adjust and recover the out-of-condition cameras to the original working statuses. And thereby, the camera-based surveillance system can be improved with less costs of maintenance.
According to one aspect of the present disclosure, one embodiment provides a camera recalibration system including: a first camera, which is to be recalibrated, for capturing image; an image processing unit comprising a storage unit for storing a first image and a second image, the second image being captured by the first camera; and a computing unit for measuring camera motion from the first image to the second image and computing calibration information corresponding to the camera motion; and a display unit for presenting the calibration information.
According to another aspect of the present disclosure, another embodiment provides a method for recalibrating a camera which is to be recalibrated, the method comprising the steps of: providing a first image; capturing a second image by using the camera; measuring a camera motion from the first image to the second image and computing calibration information corresponding to the camera motion; and presenting the calibration information in the second image.
Furthermore, the foregoing recalibration method can be embodied in a computer program product containing at least one instruction, the at least one instruction for being downloaded to a computer system to perform the recalibration method.
Also, the foregoing recalibration method can be embodied in a computer readable medium containing a computer program, the computer program performing the recalibration method after being downloaded to a computer system.
Further scope of applicability of the present application will become more apparent from the detailed description given hereinafter. However, it should be understood that the detailed description and specific examples, while indicating exemplary embodiments of the disclosure, are given by way of illustration only, since various changes and modifications within the spirit and scope of the disclosure will become apparent to those skilled in the art from this detailed description.
The present disclosure will become more fully understood from the detailed description given herein below and the accompanying drawings which are given by way of illustration only, and thus are not limitative of the present disclosure and wherein:
For further understanding and recognizing the fulfilled functions and structural characteristics of the disclosure, several exemplary embodiments cooperating with detailed description are presented as the following.
Please refer to
The storage unit 122 can store at least two images, which include a first image and a second image.
The computing unit 124 is for measuring a camera motion from the first image to the second images and computing calibration information corresponding to the camera motion. To measure the camera motion, the computing unit 124 extracts local feature points from the first and second images, and generate the matched feature points between the first image and the second image. A set of first feature vectors and a set of their paired second feature vectors are then respectively formed, wherein each first feature vector is formed by connecting a feature point to another feature point in the first image, and each second feature vector is formed by connecting the corresponding matched feature points in the second image. The camera motion containing a motion of camera roll and a scaling factor between the first and second images can hence be measured according the sets of the first and second feature vectors. Moreover, the first image can be transformed into a third image according to the motion of camera roll and the scaling factor of the second image. The camera motion containing horizontal and vertical motions can hence be measured with multiple sets of matched feature points between the third image and the second image. On the other hand, the second image can be transformed into a fourth image according to the motion of camera roll and the scaling factor of the first image. The camera motion containing horizontal and vertical motions can also be measured with multiple sets of matched feature points between the fourth image and the first image. Further, the computing unit 124 can compute calibration information which is corresponding to the camera motion measured by the computing unit 124. The camera motion may include the motions of both magnitude and direction, while the calibration information includes the calibration in both magnitude and direction corresponding to the camera motion, respectively. The calibration magnitude is equal to the motion magnitude of the camera motion, while the calibration direction is opposite to the motion direction of the camera motion.
The calibration information further includes a sign, a sound, or a frequency as a prompt and the display unit 130 presents the calibration information to the operators who perform the calibration upon the to-be-recalibrated camera. In a camera recalibration system according to an exemplary embodiment, the display unit 130 displays the second images captured by the first camera 110 in real time, and simultaneously attach the foregoing calibration information to the second images. The image processing unit 120 and/or the display unit 130 may be implemented with a PDA (personal digital assistant), an MID (mobile internet device), a smart phone, a laptop computer, or a portable multimedia device; but is not limited thereof, they can be the other type of computer or processor with a display or monitor.
The camera recalibration in the embodiment is based on the relative camera motion between the first and second images, wherein the first image is used as a reference image and the second image is an image captured by the to-be-recalibrated first camera 110. In the system 100, the camera motion can be measured with regard to the horizontal and vertical motions, the motions of camera roll (a phase angle either in clockwise or in counter-clockwise direction), and the scaling factor (either scale-up or scale-down).
The motion of camera roll can be measured by a central tendency of a data set which is composed of motion of camera yaw and camera pitch between a plurality of first feature vectors and their paired second feature vectors, wherein each first feature vector is formed by connecting a feature point to another feature point in the first image, each second feature vector is formed by connecting a feature point to another feature point in the second image, and each feature point extracted from the first image corresponds to each feature point extracted from the second image. The statistical measure of central tendency is computed from a group consisting of arithmetic mean, the median, the mode, and the histogram statistic. Therein regarding the histogram statistic, a data set is classified into multiple groups according to a predetermined value, then a histogram is formed of the statistical distribution of the groups, and finally the histogram statistic can be measured by the arithmetic mean of the bin of the highest tabular frequency and the at least one right-side and left-side nearest neighbor bins.
Similarly, the scaling factor can be measured by a central tendency of a data set which is composed of ratios of length of a plurality of the first feature vectors to their paired second feature vectors, wherein each first feature vector is formed by connecting a feature point to another feature point in the first image, each second feature vector is formed by connecting a feature point to another feature point in the second image, and each feature point extracted from the first image corresponds to each feature point extracted from the second image.
Furthermore, the first image is rotated in accordance with the motion of camera roll of the second image and scaled in accordance with the scaling factor of the second image to form a third image. The horizontal motion is measured by a central tendency of a data set which is composed of horizontal movements between feature points of the third image and their matched feature points of the second image, and the vertical motion is measured by a central tendency of a data set which is composed of vertical movements between feature points of the third image and their matched feature points of the second image. On the other hand, the second image also can be rotated in accordance with the motion of camera roll of the first image and scaled in accordance with the scaling factor of the first image to form a fourth image. The horizontal motion is measured by a central tendency of a data set which is composed of horizontal movements between feature points of the fourth image and their matched feature points of the first image, and the vertical motion is measured by a central tendency of a data set which is composed of vertical movements between feature points of the fourth image and their matched feature points of the first image.
When a camera is deviated, obstructed, or damaged naturally or artificially, the camera recalibration system 100 of the embodiment can provide maintenance operators of the system with warning signals and calibration information. Whereby, the operators may be informed to adjust and calibrate position, view angle, or direction of the camera. If the camera is deviated slightly, the system is capable of adjusting the camera automatically so as to recover its original working conditions. The computing unit 124 is provided for measuring the camera motion and computing the calibration information for the operators to perform the system's maintenance.
Besides the calibration magnitude and calibration direction, the calibration information may further include a sign, a sound, or a frequency as a prompt. The calibration magnitude is equal to the motion magnitude of the camera motion, while the calibration direction is opposite to the motion direction of the Camera motion. Considering the sound or the frequency, the magnitude of the sound or the frequency can be turned up or down. But regarding the prompt sign,
Furthermore, to equip the first camera 110 with an auto-notifying function, the camera recalibration system 100 according to the embodiment further includes a control unit 140, which is coupled to the image processing unit 120, so as to provide a warning signal when the measured camera motion of the camera 110 satisfies a predetermined condition; for example, the motion magnitude or motion direction exceeds a predetermined threshold. On the other respect, if the system 100 or the control unit 140 is set in an auto-adjustment mode and the camera motion does not exceed the predetermined threshold; for example, the motion magnitude or motion direction is less than the predetermined threshold but more than zero, the control unit 140 can perform transformation of image coordinate so as to transform the coordinate system of the image captured by the first camera 110 to that of its original setting, and hence to reduce the labor maintenance cost for the camera 110. To perform the auto-adjustment operation, the system 100 may extract feature points from the first and second images, wherein each feature point of the first image corresponds to each feature point of the second image. Then a set of first feature vectors and a set of their paired second feature vectors can be respectively formed, wherein each first feature vector is formed by connecting a feature point to another feature point in the first image, and each second feature vector is formed by connecting the corresponding matched feature points in the second image. Consequently, the camera motion such as a motion of camera roll, a scaling factor, and horizontal and vertical motions between the first and second images can be measured according the sets of the first and second feature vectors. Furthermore, the system 100 may perform coordinate transformation of the feature points between the first and second images in two ways. Firstly, coordinates of the feature points of the first image can be transformed from the coordinate system of the first image to that of the second image, according to the camera motion. Then a spatial distance between each transformed feature point of the first image and its corresponding feature point of the second image can be measured according to the coordinate system of the second image. If the spatial distance exceeds a predetermined threshold, the system 100 regards it as mismatched feature point and discards it from the group of matched feature points. Secondly, coordinates of the feature points of the second image can be transformed from the coordinate system of the second image to that of the first image, according to the camera motion. Then a spatial distance between each transformed feature point of the second image and its corresponding feature point of the first image can be measured according to the coordinate system of the first image. If the spatial distance exceeds a predetermined threshold, the system 100 regards it as the mismatched feature point and discards it from the group of matched feature points. The remaining feature points of spatial distance less than the predetermined threshold can then be used to participate in the matrix transformation. Finally, the transform matrix can be computed according to at least four of the remaining correct feature points by means of RANSAC (Random Sample Consensus), BruteForce, SVD (Singular Value Decomposition), and other prior-art computational methods of matrix transformation.
Please refer to
According to Step 210, the first image can be an image captured by the first camera 110 being originally setup, an image captured by a second camera 110-1 being originally setup, or an image at a predetermined location captured by any camera. The first image serves as a reference image for the calibration of the first camera 110. According to Step 220, the second image is the image captured by the first camera 110. Here, the recalibration of camera and the capturing of image have been described in the first embodiment and hence is not going to be restated in detail.
According to Step 230, the measuring step of the camera motion between the first and second images can be divided into the following sub-steps. In Step 232, local feature points can be extracted from the first and second images. In Step 234, feature points matching are performed between the first image and the second image. In Step 236, a set of first feature vectors and a set of their paired second feature vectors are formed respectively, wherein each first feature vector is formed by connecting a feature point to another feature point in the first image, and each second feature vector is formed by connecting the corresponding matched feature points in the second image. In Step 238, the camera motion including a motion of camera roll and a scaling factor can be measured according the sets of the first and second feature vectors. And in Step 239, horizontal and vertical motions can be computed accordingly.
To detect and extract the local image features, a lot of prior-art methods such as SIFT, SURF, LBP, or MSER can be applied to the present embodiment. After the local feature points are extracted, the feature points matching in the first and second images are performed, so as to estimate various motion diversions for first camera 110. The motion of camera roll can be measured by a central tendency of a data set which is composed of motion of camera yaw and camera pitch between a plurality of first feature vectors and their paired second feature vectors, wherein each first feature vector is formed by connecting a feature point to another feature point in the first image, each second feature vector is formed by connecting a feature point to another feature point in the second image, and each feature point extracted from the first image corresponds to each feature point extracted from the second image. The statistical measure of central tendency is selected and computed from a group consisting of arithmetic mean, the median, the mode, and the histogram statistic. Regarding the histogram statistic, for example, a data set is classified into multiple groups according to a predetermined value, then a histogram is formed of the statistical distribution of the groups, and finally the histogram statistic can be measured by the arithmetic mean of the bin of the highest tabular frequency and the at least one right-side and left-side nearest neighbor bins. Similarly, the scaling factor can be measured by a central tendency of a data set which is composed of ratios of length of a plurality of the first feature vectors to their paired second feature vectors, wherein each first feature vector is formed by connecting a feature point to another feature point in the first image, each second feature vector is formed by connecting a feature point to another feature point in the second image, and each feature point extracted from the first image corresponds to each feature point extracted from the second image.
Furthermore, the first image is rotated in accordance with the motion of camera roll of the second image and scaled in accordance with the scaling factor of the second image to form a third image. Then the feature points of the third image can be extracted in correspondence with the feature points in the first and second images. The horizontal motion is measured by a central tendency of a data set which is composed of horizontal movements between feature points of the third image and their matched feature points of the second image in horizontal, and the vertical motion is measured by a central tendency of a data set which is composed of vertical movements between feature points of the third image and their matched feature points of the second image. On the other hand, the second image can also be rotated in accordance with the motion of camera roll of the first image and scaled in accordance with the scaling factor of the first image to form a fourth image. Then the feature points of the fourth image can be extracted in correspondence with the feature points in the first and second images. The horizontal motion can be measured by a central tendency of a data set which is composed of horizontal movements between feature points of the fourth image and their matched feature points of the first image, and the vertical motion can be measured by a central tendency of a data set which is composed of vertical movements between feature points of the fourth image and their matched feature points of the first image. Also regarding the histogram statistic, a data set is classified into multiple groups according to a predetermined value, then a histogram is formed of the statistical distribution of the groups, and finally the histogram statistic can be measured by the arithmetic mean of the bin of the highest tabular frequency and the at least one right-side and left-side nearest neighbor bins.
In an exemplary embodiment as shown in
Regarding the scaling factor, the ratios between lengths of the two feature vectors can be represented by
The whole quantity range of the ratios can be divided into a plurality of groups with a bin size of 0.1, and then a histogram is formed of the statistical distribution of the groups. The histogram statistic of scaling factor szoom can be measured by the arithmetic mean of the bin of the highest tabular frequency and the at least one right-side and left-side nearest neighbor bins. The image may have been scaled down with a scaling factor less than 1, while the image may have been scaled up with a scaling factor more than 1.
Regarding the motions in horizontal and vertical, the first and second images can be transformed so as to be in the same reference angle. For example, the first image can be rotated by a phase angle φroll with its central point translated to the origin of the coordinate system. Thus each pixel translation of the first image is mapped to the Cartesian coordinates by
and then transformed into its polar coordinates with rotation of the phase angle φroll:
After the rotation, the coordinates of each pixel become pb,i″=(x″, y″), i=1, 2, . . . , l, and then the horizontal and vertical motions can be expressed as
m
i
=p
t,i
−p
b,i″=(Δxi,Δyi)=(xt,i−x″,yt,i−y″),i=1, 2, . . . , l
wherein Δxi and Δyi respectively denote the motions in the horizontal and vertical directions for each corresponding pair of feature points. The Δxi and Δyi can be divided into a plurality of groups with a bin size of 10 pixels, and then a histogram is formed of the statistical distribution of the groups. The histogram statistic of the horizontal and vertical motions can be respectively measured by the arithmetic mean of the bin of the highest tabular frequency and the at least one right-side and left-side nearest neighbor bins. After all, in a spherical camera model, the camera pitch angle can be
and the camera yaw angle can be
wherein θv is the vertical view angle of the camera, θh is the horizontal view angle, h is the image pixel in the vertical direction, and w is the image pixel in the horizontal direction.
In Step 270, corresponding to the camera motion in Steps 238 and 239, the camera motion can be represented in a form of prompt sign, which can be referred to the foregoing descriptions of prompt sign in the first embodiment. In Step 240, the camera motion is checked to see whether it satisfies a predetermined condition. For example, if the measured camera motion such as the motion magnitude or motion direction of the first camera 110 exceeds a predetermined threshold, a warning signal can be transmitted in Step 250; otherwise, it will be checked further if the first camera 110 is set in an auto-adjustment mode. If the first camera 110 operates in the auto-adjustment mode, the transformation of image coordinate can be performed as in Step 305; otherwise, in Step 270, the second image captured by the first camera 110 can be displayed on a display monitor 130 in real time, and the calibration information corresponding to the camera motion can also be shown in the second image, so as to provide on-site operators with more detailed information.
In an exemplary embodiment, the image coordinate of the foregoing first image is transformed according to the measured camera motion including a motion of camera roll and a scaling factor. A difference err, between each corresponding pair of feature points can be computed by the equation:
err
i=√{square root over ((xt,i−xb,i′)2+(yt,i−yb,i′)2)}{square root over ((xt,i−xb,i′)2+(yt,i−yb,i′)2)},i1, 2, . . . , l
If the difference err, exceeds a predetermined threshold Terror, the matched feature points will be regarded as mismatched feature points and discarded from the group of matched feature points. The matched feature points with their difference erri not exceeding the threshold Terror can then be kept in the group of matched feature points to participate in the matrix transformation.
The foregoing method of recalibrating a camera can be implemented in a form of computer program product, which is composed of instructions. Preferably, the instructions can be downloaded to a computer system to perform the recalibration method, whereby the computer system can function as the camera recalibration system.
Further, the computer program product can be stored in a computer readable medium, which can be any type of data storage device, such as an ROM (Read-Only Memory), an RAM (Random-Access Memory), a CD-ROM, a magnetic tape, a soft disk, an optical data storage device, or a carrier (for example, data transmission through the Internet). The computer program may perform the foregoing method of recalibrating a camera, after being downloaded to a computer system.
With respect to the above description then, it is to be realized that the optimum dimensional relationships for the parts of the disclosure, to include variations in size, materials, shape, form, function and manner of operation, assembly and use, are deemed readily apparent and obvious to one skilled in the art, and all equivalent relationships to those illustrated in the drawings and described in the specification are intended to be encompassed by the present disclosure.
Number | Date | Country | Kind |
---|---|---|---|
099144577 | Dec 2010 | TW | national |