Method and terminal for automatically correcting double-optical-filter switcher
Patent Information
- Application Number
- CN202411008932.0
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-07-25
- Publication Date
- 2024-11-12
Smart Images

Figure CN118945491A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the field of equipment calibration, and in particular to a method and a terminal for automatically correcting a dual-filter switcher. Background Art
[0002] In order to avoid the influence of infrared rays in daytime sunlight on imaging, an infrared filter is usually required under natural light during the day. In order to improve the night vision effect of the camera, it is necessary to cancel the infrared filtering at night. Therefore, cameras are usually equipped with a dual filter switcher (IR-CUT). The dual filter switcher can automatically switch the filter according to the changes in light to absorb or stop the absorption of infrared rays, so that the camera can guarantee the imaging results in different environments.
[0003] However, for cameras installed on robots, mechanical arms or other devices that require visual assistance, since the camera is in motion, there may be a problem of external motion falsely triggering the dual filter switch, thereby affecting the quality of the image acquired by the imaging system. The existing technology usually requires structural improvements to avoid the problem of false triggering, which is costly for the modification of hardware that has been put into use. Summary of the invention
[0004] The technical problem to be solved by the present invention is to provide a method and a terminal for automatically correcting a dual-filter switch, so as to realize an automatic correction method for a dual-filter switch with high accuracy.
[0005] In order to solve the above technical problems, a technical solution adopted by the present invention is:
[0006] A method for automatically correcting a dual filter switcher comprises the steps of:
[0007] Acquire the camera's display image in real time;
[0008] Determine whether the displayed image meets the first preset feature, and if so, obtain the current posture data of the camera and calculate it as the characteristic posture data;
[0009] The real-time posture data of the camera is acquired, the real-time posture data is classified according to the characteristic posture data to obtain a classification result, and a dual filter switch is adjusted according to the classification result.
[0010] In order to solve the above technical problems, another technical solution adopted by the present invention is:
[0011] A terminal for automatically correcting a dual filter switch comprises a memory, a processor and a computer program stored in the memory and executable on the processor, wherein the processor implements the following steps when executing the computer program:
[0012] Acquire the camera's display image in real time;
[0013] Determine whether the displayed image meets the first preset feature, and if so, obtain the current posture data of the camera and calculate it as the characteristic posture data;
[0014] The real-time posture data of the camera is acquired, the real-time posture data is classified according to the characteristic posture data to obtain a classification result, and a dual filter switch is adjusted according to the classification result.
[0015] The beneficial effects of the present invention are: testing is performed in advance to determine whether the first preset feature is met based on the displayed image of the camera, for example, determining whether the displayed image has color cast. If so, the current posture data of the camera is obtained and calculated as feature posture data for storage. When the real-time posture data of the camera is obtained, it is possible to predict whether color cast will occur by determining whether the real-time posture data matches the feature posture data. If the match indicates that color cast is very likely to occur, the dual filter switch is adjusted according to the classification result, so that color cast can be corrected in time when it occurs, thereby ensuring the image acquisition effect. BRIEF DESCRIPTION OF THE DRAWINGS
[0016] Figure 1 A flowchart of the steps of a method for automatically correcting a dual filter switch according to an embodiment of the present invention;
[0017] Figure 2 It is a structural schematic diagram of a terminal of an automatic correction dual filter switch according to an embodiment of the present invention;
[0018] Description of labels:
[0019] 1. A terminal for automatically correcting a dual filter switch; 2. A processor; 3. A memory. DETAILED DESCRIPTION
[0020] In order to explain the technical content, achieved objectives and effects of the present invention in detail, the following is an explanation in conjunction with the implementation modes and the accompanying drawings.
[0021] Please refer to Figure 1 , a method for automatically correcting a dual filter switcher, comprising the steps of:
[0022] Acquire the camera's display image in real time;
[0023] Determine whether the displayed image meets the first preset feature, and if so, obtain the current posture data of the camera and calculate it as the characteristic posture data;
[0024] The real-time posture data of the camera is acquired, the real-time posture data is classified according to the characteristic posture data to obtain a classification result, and a dual filter switch is adjusted according to the classification result.
[0025] From the above description, it can be seen that the beneficial effects of the present invention are: testing is performed in advance to determine whether the first preset feature is met based on the displayed image of the camera, for example, to determine whether the displayed image has color cast. If so, the current posture data of the camera is obtained and calculated as feature posture data for storage. When the real-time posture data of the camera is obtained, it is possible to predict whether color cast will occur by determining whether the real-time posture data matches the feature posture data. If the match indicates that color cast is very likely to occur, the dual filter switch is adjusted according to the classification result, so that color cast can be corrected in time to ensure the image acquisition effect.
[0026] Further, obtaining the current posture data of the camera and calculating it as feature posture data includes:
[0027] Acquire the first posture data of the camera at every preset time period;
[0028] When the displayed image meets the first preset feature, obtaining a timestamp of the displayed image and second posture data at that time;
[0029] Acquire all first posture data before the timestamp and second posture data corresponding to the timestamp as current posture data;
[0030] The current posture data is calculated as feature posture data.
[0031] From the above description, it can be seen that the first posture data is acquired once every preset time period, and when the displayed image meets the first preset feature, the timestamp of the displayed image is acquired, and the first posture data before the timestamp and the second posture data when meeting the first preset feature are used as the current posture data. In this way, the change of the posture data when the displayed image meets the first preset feature can be obtained, thereby improving the accuracy of the judgment result.
[0032] Further, the obtaining of the current posture data of the camera and calculating it as feature posture data comprises:
[0033] The current acceleration of the camera is obtained as current posture data through an inertial measurement unit.
[0034] From the above description, it can be seen that the acceleration obtained by the inertial measurement unit is used as the attitude data. The inertial measurement unit has a low cost and is installed on devices where the camera needs to move, such as a gimbal or a robot. There is no need to equip additional attitude measurement devices, saving costs.
[0035] Further, the obtaining of the current posture data of the camera and calculating it as feature posture data comprises:
[0036] Draw a line graph with time as the horizontal axis and the current posture data as the vertical axis;
[0037] The absolute value of the difference between the second posture data of the coordinate point corresponding to the timestamp and the previous first posture data is obtained as the characteristic posture data.
[0038] From the above description, it can be seen that the slope of the line graph is obtained as the characteristic posture data, and the absolute value of the difference between the second posture data and the previous first posture data reflects the change situation, that is, it can be judged which change situation is likely to trigger the switching of the dual filter, thereby improving the accuracy of subsequent adjustments to the dual filter switch operation.
[0039] Further, obtaining a preset number of times;
[0040] After obtaining the current posture data of the camera and calculating it as feature posture data, the method further includes:
[0041] Determine whether the number of the characteristic posture data is the same as the preset number of times. If so, stop the step of acquiring the display image of the camera in real time; otherwise, continue the step of acquiring the display image of the camera in real time.
[0042] From the above description, it can be seen that in order to balance the problem that the data of a single experiment may not be representative due to external forces, the display image that meets the first preset characteristics is acquired according to the preset number of times, and accidental influencing factors are eliminated through multiple experiments. The final determined feature posture data can be more in line with the actual situation and improve the effect of subsequent dual filter switch operations.
[0043] Further, the determining whether the number of the characteristic posture data is the same as the preset number includes:
[0044] If the number of the feature posture data is the same as the preset number, obtaining a union of all the feature posture data to obtain a feature union;
[0045] The classifying the real-time posture data according to the characteristic posture data to obtain a classification result comprises:
[0046] The real-time posture data is classified according to the feature union to obtain a classification result.
[0047] From the above description, it can be seen that after multiple experiments, the union of feature posture data is obtained as the basis for subsequent classification. Compared with using a single feature posture data as the basis for judgment after one experiment, the influence of accidental factors is eliminated through multiple experiments. Finally, the union obtained from multiple experiments is provided to the subsequent steps for judgment, which further reduces the error rate.
[0048] Further, obtaining the current posture data of the camera and calculating it as feature posture data includes:
[0049] When the displayed image meets the first preset feature, obtaining second posture data of the camera at this time;
[0050] Using the second posture data as current posture data;
[0051] The current posture data is marked as feature posture data.
[0052] From the above description, it can be seen that when the displayed image meets the first preset feature, the second posture data at that time is obtained, and the second posture data is directly used as the current posture data. Finally, the current posture data is marked as characteristic posture data. This method reduces the amount of data transmission, thereby reducing the amount of calculated data, speeding up the calculation time, and enabling users to repair the color cast of the picture more imperceptibly.
[0053] Further, adjusting the dual filter switch according to the classification result includes:
[0054] If the classification result is consistent with the characteristic posture data, the step of switching the dual filter switch is executed; otherwise, no operation is performed.
[0055] From the above description, it can be seen that in the training stage, when the displayed image meets the first preset feature, the corresponding current posture data is obtained and calculated as the characteristic posture data. Then in the judgment stage, if the daily classification result meets the characteristic posture data, it means that there is a high possibility that the first preset feature appears in the displayed image. At this time, a switching operation is performed to avoid the first preset feature appearing in the displayed image, thereby realizing automatic adjustment of the dual filter switch.
[0056] Further, the acquiring the current acceleration of the camera as the current posture data through the inertial measurement unit includes:
[0057] The current Z-axis acceleration of the camera is obtained through an inertial measurement unit as current posture data.
[0058] From the above description, it can be seen that according to the physical structure characteristics of the conventional dual-filter switch, the state change on the Z-axis is more likely to trigger the switching of non-light changes. Therefore, for obtaining the acceleration of the Z-axis, the amount of data is further reduced and the accuracy of the judgment can be guaranteed; therefore, the acceleration of the target axis for analysis can also be selected according to the dual-filter switch with different structures.
[0059] Please refer to Figure 2 A terminal for automatically correcting a dual filter switch includes a memory, a processor, and a computer program stored in the memory and executable on the processor. When the processor executes the computer program, each step in the above-mentioned method for automatically correcting a dual filter switch is implemented.
[0060] The above-mentioned method and terminal for automatically correcting a dual filter switch of the present invention can be applied to scenarios where a dual filter switch (IR-CUT) is prevented from switching due to external forces other than light changes, especially scenarios where cameras such as robots and gimbals are in a moving state. The cameras in the present invention include but are not limited to CCD (Charge-coupled Device) cameras, CMOS (Complementary Metal-Oxide-Semiconductor) cameras, etc., which are described below through specific implementation methods.
[0061] Please refer to Figure 1 , Embodiment 1 of the present invention is:
[0062] A method for automatically correcting a dual filter switcher comprises the steps of:
[0063] S1, obtaining the display image of the camera in real time;
[0064] S2, determining whether the displayed image meets the first preset feature, if so, executing S3;
[0065] S3, obtaining the current posture data of the camera and calculating it as feature posture data, including S301-S304 or S311-S313:
[0066] S301, acquiring first posture data of the camera at every preset time period;
[0067] In an optional implementation, the current acceleration of the camera is obtained as the current posture data through an inertial measurement unit; for example, the current Z-axis acceleration of the camera is obtained as the current posture data through an inertial measurement unit; the inertial measurement unit (IMU) can obtain the acceleration of three single axes, namely, X, Y and Z axes;
[0068] In an optional implementation, the preset time period of the interval is the same as the interval between two frames of the displayed image, so that the acquisition time of the posture data and the occurrence time of the corresponding situation in the displayed image can be matched, further improving the accuracy of the judgment result;
[0069] S302: when the displayed image meets the first preset feature, obtaining a timestamp of the displayed image and second posture data at that time;
[0070] In an optional implementation, the first preset feature is color cast. For example, the display image captured by the camera can be displayed in the form of a video on a mobile terminal through networking, such as in an APP on a mobile phone. Whether the first preset feature is met can be determined by using a conventional image processing algorithm, such as a model trained by obtaining features such as a histogram and a color matrix, or by using a manual judgment method. The color cast includes a purple cast on the screen, etc.
[0071] S303, acquiring all first posture data before the timestamp and second posture data corresponding to the timestamp as current posture data;
[0072] In an optional implementation, the first posture data is the posture data generated at the timestamp of the previous frame display image corresponding to the timestamp, and only two sets of posture data of the display image when the first preset feature is met and the previous frame display image are obtained for comparison, and the data to be analyzed are all data close to the first preset feature appearing, so as to further reduce the amount of calculation while ensuring the accuracy of the calculation result;
[0073] S304, calculating the current posture data as characteristic posture data, including:
[0074] S3041, drawing a line graph with the horizontal axis being time and the vertical axis being the current posture data;
[0075] S3042, obtaining the slope of the coordinate point corresponding to the timestamp as characteristic posture data; or obtaining the absolute value of the difference between the second posture data corresponding to the timestamp and the previous first posture data as characteristic posture data; both can reflect the change of acceleration, and the absolute value can reflect more detailed changes;
[0076] In an optional implementation, in step S304, the collected current posture data is passed into Python, and a line graph is drawn. Then, the changes in the three uniaxial accelerations can be obtained according to the slope of the line graph, and matched with the time point when the first preset feature appears, i.e., the timestamp; wherein, the current posture data can be imported into Python by storing it in a txt file;
[0077] S311, when the displayed image meets the first preset feature, obtaining the second posture data of the camera at this time;
[0078] S312, using the second posture data as current posture data;
[0079] S313, marking the current posture data as characteristic posture data;
[0080] Because the camera on a mobile robot or other small robot is likely to be hit during the movement of the robot, the external force impact may cause the mechanical structure of the dual filter switch to loosen and cause color cast, and the camera on the robot will generate acceleration during the movement, that is, the change of posture data during the movement is normal, and it cannot be confirmed that it is related to the first preset feature of the abnormal situation; therefore, the accuracy of judging only from the posture data at a single time point is low;
[0081] In step S3, two methods are provided. One is to directly obtain the current posture of the camera as the characteristic posture data when the displayed image meets the first preset feature, that is, to obtain the posture data of a single time point as the characteristic posture data to be compared. For example, when the posture data is acceleration, the judgment is directly made according to the acceleration. The other is to obtain all the first posture data before the timestamp when the displayed image meets the first preset feature, and calculate the characteristic posture data according to the first posture data, that is, to obtain the change of multiple time points as the characteristic posture data to be compared. For example, for acceleration, the judgment is made according to the change of acceleration.
[0082] In an optional embodiment, the method further includes: S4, determining whether the number of the characteristic posture data is the same as a preset number of times, if so, stopping the step of acquiring the display image of the camera in real time and executing S41; otherwise, continuing the step of acquiring the display image of the camera in real time; wherein the preset number of times is acquired before step S4;
[0083] S41, obtaining a union of all the feature posture data to obtain a feature union;
[0084] In an optional embodiment, when calculating the feature union, each feature posture data is taken as the starting point, and a range greater than or less than the feature posture data is taken as a set corresponding to a feature posture data, and then the union of all sets is calculated; a point equal to the starting point can also be taken in the set; if acceleration or the change value of acceleration is used as the posture data, it can be known that the more drastic the acceleration or the change value of acceleration is, the more drastic the movement of the object is, so for the acceleration or the change value of acceleration, when calculating the feature union, a range greater than or equal to the feature posture data is taken as a set corresponding to a feature posture data; if the union is not calculated in step S5, this method can also be used to obtain the set
[0085] If S301-S304 is executed, S41 includes: obtaining the union of absolute values or the union of slopes; for example, the first posture data and the second posture data corresponding to the two frames when the color change phenomenon occurs are tested multiple times, for example, the acceleration of the first posture data of the previous frame is 100 and the acceleration of the first posture data of the next frame is 600 (the unit is omitted here because it is irrelevant to the acceleration unit), and the absolute value of the difference between the two is 500. In this way, multiple groups of data are tested and calculated, and the union is taken. Assuming that the absolute values of the multiple differences are 700, 900, and 6000 respectively, then our final result is that when it is greater than or equal to 700, it is judged that the dual filter switch has switched, and it needs to automatically switch back to the original position to avoid polarization;
[0086] If S311-S313 is executed, the union of accelerations is obtained;
[0087] S5, acquiring real-time posture data of the camera, and classifying the real-time posture data according to the characteristic posture data to obtain a classification result;
[0088] For step S5, if step S41 is passed, the real-time posture data is classified according to the feature union to obtain a classification result;
[0089] In an optional implementation, if the real-time posture data falls within the range of the feature union, the classification result is consistent with the feature posture data, otherwise, the classification result is inconsistent with the feature posture data;
[0090] S6. Adjusting the dual filter switch according to the classification result, including:
[0091] If the classification result is consistent with the characteristic posture data, the step of switching the dual filter switch is executed; otherwise, no operation is performed.
[0092] Please refer to Figure 2 , Embodiment 2 of the present invention is:
[0093] A terminal 1 for automatically correcting a dual filter switch comprises a processor 2, a memory 3 and a computer program stored in the memory 3 and executable on the processor 2. When the processor 2 executes the computer program, each step in the first embodiment is implemented.
[0094] In summary, the present invention provides a method and terminal for automatically correcting a dual filter switch, by obtaining the posture data at this time as the characteristic posture data when a first preset feature that does not meet the expected display conditions occurs, such as color cast, and then considering that when the same characteristic posture data appears, it is very likely that the first preset feature appears in the displayed image; after confirming the characteristic posture data, the characteristic posture data is obtained in real time to determine whether it matches the characteristic posture data, and if it matches, it means that the first preset feature, such as color cast, is very likely to appear, and then the dual filter switch is automatically adjusted at this time, thereby realizing automatic correction of color cast, especially having a good correction effect on the automatic adjustment of the dual filter switch caused by collision.
[0095] The above descriptions are merely embodiments of the present invention and are not intended to limit the patent scope of the present invention. Any equivalent transformations made using the contents of the present invention's specification and drawings, or directly or indirectly applied in related technical fields, are also included in the patent protection scope of the present invention.
Claims
1. A method for automatically correcting a dual filter switch, characterized in that: Includes steps: Acquire the camera's display image in real time; Determine whether the displayed image meets the first preset feature, and if so, obtain the current posture data of the camera and calculate it as the characteristic posture data; The real-time posture data of the camera is acquired, the real-time posture data is classified according to the characteristic posture data to obtain a classification result, and a dual filter switch is adjusted according to the classification result.
2. A method for automatically correcting a dual filter switch according to claim 1, characterized in that: Obtaining the current posture data of the camera and calculating it as feature posture data includes: Acquire the first posture data of the camera at every preset time period; When the displayed image meets the first preset feature, obtaining a timestamp of the displayed image and second posture data at that time; Acquire all first posture data before the timestamp and second posture data corresponding to the timestamp as current posture data; The current posture data is calculated as feature posture data.
3. A method for automatically correcting a dual filter switch according to claim 1 or 2, characterized in that: The obtaining of the current posture data of the camera and calculating it as feature posture data comprises: The current acceleration of the camera is obtained as current posture data through an inertial measurement unit.
4. A method for automatically correcting a dual filter switcher according to claim 2, characterized in that: The obtaining of the current posture data of the camera and calculating it as feature posture data comprises: Draw a line graph with time as the horizontal axis and the current posture data as the vertical axis; The absolute value of the difference between the second posture data of the coordinate point corresponding to the timestamp and the previous first posture data is obtained as the characteristic posture data.
5. The method for automatically correcting a dual filter switcher according to claim 1, characterized in that: Get the preset number of times; After obtaining the current posture data of the camera and calculating it as feature posture data, the method further includes: Determine whether the number of the characteristic posture data is the same as the preset number of times. If so, stop the step of acquiring the display image of the camera in real time; otherwise, continue the step of acquiring the display image of the camera in real time.
6. A method for automatically correcting a dual filter switcher according to claim 5, characterized in that: The determining whether the number of the characteristic posture data is the same as the preset number includes: If the number of the feature posture data is the same as the preset number, obtaining a union of all the feature posture data to obtain a feature union; The classifying the real-time posture data according to the characteristic posture data to obtain a classification result comprises: The real-time posture data is classified according to the feature union to obtain a classification result.
7. The method for automatically correcting a dual filter switcher according to claim 1, characterized in that: Obtaining the current posture data of the camera and calculating it as feature posture data includes: When the displayed image meets the first preset feature, obtaining second posture data of the camera at this time; Using the second posture data as current posture data; The current posture data is marked as feature posture data.
8. The method for automatically correcting a dual filter switcher according to claim 1, characterized in that: Adjusting the dual filter switch according to the classification result includes: If the classification result is consistent with the characteristic posture data, the step of switching the dual filter switch is executed; otherwise, no operation is performed.
9. The method for automatically correcting a dual filter switcher according to claim 3, characterized in that: The acquiring the current acceleration of the camera as current posture data by using an inertial measurement unit comprises: The current Z-axis acceleration of the camera is obtained through an inertial measurement unit as current posture data.
10. A terminal for automatically correcting a dual filter switch, comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, characterized in that: When the processor executes the computer program, the method for automatically correcting a dual filter switch according to any one of claims 1 to 9 is implemented.
