A method and system for correcting illegal parking images based on brightness difference

Through the image correction method based on the brightness difference, the picture offset problem caused by the mechanical structure of the camera is solved, and low-cost and high-efficiency picture correction is achieved, ensuring the accuracy of the video picture.

CN119152175BActive Publication Date: 2025-03-11HUNAN VISUAL ALBERT INTELLIGENT TECH CO LTD
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202411650026.0
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2024-11-19
Publication Date
2025-03-11
Estimated Expiration
2044-11-19

AI Technical Summary

Technical Problem

The camera is unable to accurately reach the designated position due to the deviation caused by the mechanical structure, resulting in the video image being offset, which may lead to misidentification or misidentification of the vehicle.

Method used

The illegally stopped image correction method based on brightness difference is adopted. By dividing the picture into multiple picture areas, the brightness difference value of each area is calculated, the positioning template and reference bit marking are obtained, and the image correction is used to correct the picture offset.

Benefits of technology

No manual inspection or mechanical feedback adjustment is required, and the picture is corrected using pure software to reduce costs, improve efficiency, and ensure the accuracy of the video picture.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119152175B_ABST
    Figure CN119152175B_ABST
Patent Text Reader

Abstract

The present invention belongs to the technical field of illegal parking snapshot, and discloses a method and system for correcting illegal parking snapshot images based on brightness difference. The method includes controlling the camera to cyclically acquire n images to form a first image set according to set parameters; dividing each image in the first image set into i*j image areas to acquire a first positioning template; acquiring reference position marking lines in each single area of ​​the first positioning template; acquiring a second image set and a second positioning template, selecting the area in the second positioning template with the same position as the first positioning template as the effective second positioning template, and determining the reference position marking lines of the effective second positioning template; connecting the reference position marking lines of the first positioning template in pairs to obtain a first convex polygon, connecting the reference position marking lines of the effective second positioning template in pairs to obtain a second convex polygon, and performing affine transformation on the second convex polygon and the first convex polygon to perform image correction.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention belongs to the technical field of illegal parking capture, and in particular relates to image correction of illegal parking capture. Background Art

[0002] Illegal parking and temporary parking are one of the main reasons for congestion on urban roads. By placing snapshot cameras at higher positions around urban roads, the road conditions around the roads can be observed in real time, and illegally parked vehicles can be identified and warned. In order to save costs, high-speed camera dome cameras are often used for snapshots. By configuring the camera's operating trajectory, one dome camera can capture designated locations on multiple road sections.

[0003] However, long-term reciprocating operation and harsh outdoor operating conditions will cause great mechanical wear on the camera ball machine, resulting in the inability of the moving parts of the ball machine to control the camera part to reach the accurate designated position. Since the equipment is generally installed in a high and remote position, even a small angle displacement may cause a large displacement of the video image. There are usually warning and controlled areas for the video image inside the equipment. If the image is displaced, the controlled area loses its meaning, which can easily lead to misidentification of normal vehicles or missed identification of vehicles parked in the controlled area.

[0004] In actual use, the above problems can be optimized through manual inspection or the use of a mechanical structure with position feedback to reduce the probability of false alarms, but the method has the problem of low efficiency or high cost. Therefore, a low-cost and high-efficiency picture correction technology solution is needed. Summary of the invention

[0005] The technical problem to be solved by the present invention is the problem of image deviation caused by the capture camera not reaching the specified position accurately. The shortcomings and defects mentioned in the above background technology are overcome, and a method and system for correcting illegal parking capture images based on brightness difference are provided.

[0006] In order to solve the above technical problems, the present invention proposes a method for correcting illegal parking images based on brightness difference, comprising:

[0007] S1: Move the lens to a specified position, and control the camera to cyclically acquire n images to form a first image set according to set parameters;

[0008] S2: Divide each picture in the first picture set into i*j picture regions, and obtain a first positioning template according to the brightness difference of the pixel points in each region;

[0009] S3: Acquire reference position marking lines in each single area of ​​the first positioning template;

[0010] S4: when the lens moves between multiple positions and moves back to the designated position again, a second picture set and a second positioning template are obtained, an area in the second positioning template having the same position as the first positioning template is selected as a valid second positioning template, and a reference position mark line of the valid second positioning template is determined;

[0011] S5: Connect the reference position marking lines of the first positioning template in pairs to obtain a first convex polygon, connect the reference position marking lines of the effective second positioning template in pairs to obtain a second convex polygon, and perform affine transformation on the second convex polygon and the first convex polygon to perform image correction;

[0012] Preferably, the setting parameters include: focal length, exposure time, and ISO sensitivity.

[0013] Preferably, obtaining the first positioning template includes: using B to represent brightness, Q to represent area, and S to represent the sum of differences, dividing each picture in the picture set into i*j picture areas, calculating the brightness difference between two adjacent pixels in each picture area according to a set order, and obtaining the sum of the differences of all pixels in each picture area as BQS[i*j], each picture area is regarded as a BQS area, sorting the values ​​from large to small, and selecting the first m areas as BQS[m];

[0014] The n pictures in the first picture set are processed in the same way, the first m BQS areas of each picture are selected and recorded as BQS[m]n, the BQS areas existing in the n pictures are selected as valid areas, and the first positioning template is determined according to the valid areas.

[0015] Preferably, determining the first positioning template based on the valid area includes: judging the number of valid areas, if the total number of valid areas is greater than a specified threshold, judging it as a valid area positioning identification, if the value is not reached, abandoning the selected valid area, adjusting the focal length parameters, reacquiring the first picture set and recalculating the first positioning template.

[0016] Preferably, the setting sequence is: based on the initial direction of the picture acquired by the camera, from left to right and from top to bottom. The reference direction of the picture is set to prevent the setting sequence from being wrong due to picture rotation.

[0017] Preferably, obtaining the reference position mark line includes: for each pixel point in the single BQS area of ​​the first positioning template, traversing 8 neighbors to obtain the brightness difference, taking a depth-first approach, calculating the brightness difference along the 8-neighbor direction, and when the brightness difference between the subsequent pixel point and the previous pixel point is within the threshold BD, the subsequent pixel point is identified as a valid point, and the traversal continues along the vector direction of the previous pixel point-valid point to obtain all points within the BD range. After traversing all the points, each point is sorted based on the sum of the number of valid points selected based on the depth-first approach, and a straight line connecting the points in the ranking sequences 1 and 2 is selected, and the obtained straight line is used as the reference position mark line of the single BQS area of ​​the first positioning template; wherein, the 8 neighbors refer to the 8 neighboring pixel points around the pixel point.

[0018] Preferably, after selecting the points of the ranking sequences 1 and 2 to connect the straight line, the method further includes: judging the width of the straight line; if the width of the straight line is not less than the specified width, it meets the requirements; if the width of the straight line is less than the specified width, the straight line is considered invalid; the straight line is connected with the points of the ranking sequences 1 and 3 to make the same judgment on the obtained straight line width again; if it meets the requirements, it is identified as a reference position marking line; if it still does not meet the requirements, the points of the ranking sequence 1 are removed and recalculated from the points of the ranking sequences 2 and 3; the above process of connecting straight lines and judging the width is repeated until a straight line that meets the requirements is selected as the reference position marking line.

[0019] Preferably, before connecting the reference position marking lines in the first positioning template in pairs, the method also includes: comparing the reference position of the first template with the reference position of the second template, and when the distance error between the reference position of the first template and the corresponding reference position of the second template is within a specified threshold, they are identified as the same reference positions in the same area, and only the same reference positions of the first template and the second template are subsequently connected in pairs.

[0020] The present invention also provides a system for correcting illegal parking images based on brightness difference, comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the processor implements the steps of any of the above methods when executing the computer program.

[0021] Compared with the prior art, the present invention has the following beneficial effects:

[0022] The present invention obtains a positioning template and a reference position in the picture by analyzing the brightness difference information of the captured picture. When the capture camera fails to accurately reach the specified position due to deviation caused by the mechanical structure, the deviated picture is corrected to the original picture by comparing the positioning template and the reference position between the pictures. No manual inspection or other mechanical feedback adjustment means are required, and the picture is corrected in a pure software manner, which has the characteristics of low cost and high efficiency. BRIEF DESCRIPTION OF THE DRAWINGS

[0023] In order to more clearly illustrate the embodiments of the present invention or the technical solutions in the prior art, the drawings required for use in the embodiments or the description of the prior art will be briefly introduced below. Obviously, the drawings described below are some embodiments of the present invention. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying creative work.

[0024] Figure 1 It is a flow chart of a method for correcting illegally parked images based on brightness difference provided by an embodiment of the present invention;

[0025] Figure 2 It is a schematic diagram of obtaining a convex polygon by connecting reference position marking lines of positioning templates in pairs in an embodiment of the present invention;

[0026] Figure 3 It is a schematic diagram of a single BQS area of ​​the positioning template in an embodiment of the present invention. DETAILED DESCRIPTION

[0027] In order to facilitate the understanding of the present invention, the present invention will be described more comprehensively and meticulously below in conjunction with the accompanying drawings and preferred embodiments of the present invention, but the protection scope of the present invention is not limited to the following specific embodiments.

[0028] Unless otherwise defined, all professional terms used below have the same meanings as those generally understood by those skilled in the art. The professional terms used herein are only for the purpose of describing specific embodiments and are not intended to limit the scope of protection of the present invention.

[0029] Unless otherwise specified, various raw materials, reagents, instruments and equipment used in the present invention can be purchased from the market or prepared by existing methods.

[0030] Example:

[0031] Figure 1 A method for correcting illegal parking images based on brightness difference according to an embodiment of the present invention is shown, comprising the following steps:

[0032] S1: Move the lens to a specified position, and control the camera to cyclically acquire n images to form a first image set according to set parameters;

[0033] S2: Divide each picture in the first picture set into i*j picture regions, and obtain a first positioning template according to the brightness difference of the pixel points in each region;

[0034] S3: Acquire reference position marking lines in each single area of ​​the first positioning template;

[0035] S4: when the lens moves to the designated position again, a second picture set and a second positioning template are obtained, an area in the second positioning template having the same position as the first positioning template is selected as a valid second positioning template, and a reference position mark line of the valid second positioning template is determined;

[0036] S5: As follows Figure 2 As shown, a convex polygon is obtained by connecting reference position marking lines in pairs, the reference position marking lines of the first positioning template are connected in pairs to obtain a first convex polygon, and the reference position marking lines of the effective second positioning template are connected in pairs to obtain a second convex polygon. Image correction is performed by performing affine transformation on the second convex polygon and the first convex polygon.

[0037] The above-mentioned illegal parking image correction method based on brightness difference analyzes the brightness difference information of the captured picture to obtain the positioning template and reference position in the picture. When the capture camera fails to accurately reach the specified position due to deviations caused by mechanical structure, the deviated picture is corrected to the original picture by comparing the positioning template and the reference position between the pictures. No manual inspection or other mechanical feedback adjustment means are required, and the picture is corrected by pure software, which is low-cost and high-efficiency.

[0038] As a preferred implementation, the setting parameters include: focal length, exposure time, and ISO sensitivity, the focal length f = 20 mm, the exposure time is 0.1 second, and ISO = 100.

[0039] As a preferred implementation, the obtaining of the first positioning template includes: using B to represent brightness, Q to represent area, and S to represent the sum of differences, dividing each picture in the picture set into i*j picture areas, calculating the brightness difference between two adjacent pixels for all pixels in each picture area according to a set order, and obtaining the sum of the differences of all pixels in each picture area as BQS[i*j], each picture area is regarded as a BQS area, sorting the values ​​from large to small, and selecting the first m areas as BQS[m]; performing the same processing on the n pictures in the first picture set, selecting the first m BQS areas of each picture as BQS[m]n, selecting the BQS areas existing in the n pictures as valid areas, and determining the first positioning template according to the valid areas.

[0040] For the i*j image regions of a single picture in the picture set, for all the pixels in each region, calculate the brightness difference between two adjacent pixels according to the set order, and obtain the difference and BQS[i*j] of all the pixels in each region, sort the values ​​from large to small, select the first m = 10 regions and record them as BQS

[10] ; perform the same process on the n pictures in the first picture set, select the first 10 regions BQS

[10] n of each picture, select the areas that exist in the n pictures as valid areas, and determine the first positioning template based on the valid areas.

[0041] It is worth noting that when the camera acquires a set of images, it may capture moving targets. The positions of these targets in the n images change as they move. By selecting the area that exists in the n images as the valid area, it is possible to effectively avoid using moving targets as feature recognition results. Only fixed and obvious features in the images are identified, thus avoiding the selection of the wrong positioning template.

[0042] As a preferred implementation, the determining of the first positioning template according to the valid area includes: judging the number of valid areas, if the total number of valid areas is greater than a specified threshold value M / 2, judging as valid area positioning identification, if the value is not reached, abandoning the selected valid area, adjusting the focal length parameter, reacquiring the first picture set and recalculating the first positioning template. In an example, M is 10, and the specified threshold value is 5.

[0043] It is worth noting that the number of valid areas in the positioning template means the number of features in the picture. The more valid areas there are, the more obvious the features of the picture are. By identifying the number of valid areas in the positioning template, it is possible to determine whether the features of the current picture are obvious. If there are too few features in the picture, adjusting the focal length can change the viewing angle range of the camera's captured picture, so that the picture contains more feature details, thereby increasing the number of valid areas in the positioning template and ensuring the accuracy of positioning and identifying the picture.

[0044] As a preferred implementation, the setting sequence is: based on the initial direction of the image captured by the camera, from left to right and from top to bottom.

[0045] As a preferred embodiment, obtaining the reference position mark line includes: Figure 3As shown, for each pixel point in the single BQS area of ​​the first positioning template, traverse the 8 neighbors to obtain the brightness difference, and adopt a depth-first approach to calculate the brightness difference along the 8 neighbors. When the brightness difference between the subsequent pixel point and the previous pixel point is within the threshold BD = 10%, the subsequent pixel point is identified as a valid point, and the traversal continues along the vector direction of the previous pixel point-valid point to obtain all points within the BD range. After traversing all points, sort the sum of the number of valid points selected based on the depth-first selection for each point, select the point connection line of the ranking sequence 1 and 2, and use the obtained line as the reference position mark line of the single BQS area of ​​the first positioning template. There are multiple BQS areas in the positioning template. The reference position mark line of each BQS area in the positioning template can be obtained by the above method. Among them, 8 neighbors refer to the 8 neighboring pixel points around the pixel point. Specifically, it refers to a 9-square grid including the pixel point, with the pixel point as the center point and the remaining points as 8 neighbor points.

[0046] It is worth noting that this embodiment uses a straight line as the reference position mark line in the positioning template, so that the reference position mark line has a more prominent edge feature and boundary sense, which is conducive to feature recognition of the picture.

[0047] As a preferred embodiment, after selecting the points of the ranking sequences 1 and 2 to connect the straight line, the method further includes: judging the width of the straight line, if the width of the straight line is not less than 1 / 3 of the width of a single BQS area, it meets the requirements, if the width of the straight line is less than the specified width, the straight line is considered invalid, and the straight line is connected with the points of the ranking sequences 1 and 3 to make the same judgment on the obtained straight line width again, if it meets the requirements, it is identified as a reference position marking line, if it still does not meet the requirements, remove the points of the ranking sequence 1, and recalculate from the points of the ranking sequences 2 and 3 until a straight line that meets the requirements is selected as the reference position marking line.

[0048] As a preferred embodiment, before connecting the reference position marking lines in the first positioning template in pairs, the method also includes: comparing the reference position of the first template with the reference position of the second template, and when the distance error between the reference position of the first template and the corresponding reference position of the second template is within a threshold of 5%, they are identified as the same reference positions in the same area, and only the same reference positions of the first template and the second template are subsequently connected in pairs.

[0049] The present application also provides a system for correcting illegally parked images based on brightness difference, comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the processor implements the steps of the above method when executing the computer program. The system for correcting illegally parked images based on brightness difference can implement various embodiments of the above method for correcting illegally parked images based on brightness difference, and can achieve the same beneficial effects, which will not be described in detail here.

[0050] The preferred specific embodiments of the present invention are described in detail above. It should be understood that a person skilled in the art can make many modifications and changes based on the concept of the present invention without creative work. Therefore, any technical solution that can be obtained by a person skilled in the art through logical analysis, reasoning or limited experiments based on the concept of the present invention on the basis of the prior art should be within the scope of protection determined by the claims.

Claims

1. A method for correcting illegal parking images based on brightness difference, characterized in that The following steps are involved: S1: Move the lens to a specified position, and control the camera to cyclically acquire n images to form a first image set according to set parameters; S2: Divide each picture in the first picture set into i*j picture regions, and obtain a first positioning template according to the brightness difference of the pixel points in each region; S3: Acquire reference position marking lines in each single area of ​​the first positioning template; S4: when the lens moves to the designated position again, a second picture set and a second positioning template are obtained, an area in the second positioning template having the same position as the first positioning template is selected as a valid second positioning template, and a reference position mark line of the valid second positioning template is determined; S5: Connect the reference position marking lines of the first positioning template in pairs to obtain a first convex polygon, connect the reference position marking lines of the effective second positioning template in pairs to obtain a second convex polygon, and perform affine transformation on the second convex polygon and the first convex polygon to perform image correction; The setting parameters in S1 include: focal length, exposure time, and ISO sensitivity; S2: obtaining the first positioning template includes: Use B to represent brightness, Q to represent area, and S to represent the sum of differences. Divide each picture in the picture set into i*j picture areas. For all pixels in each picture area, calculate the brightness difference between two adjacent pixels according to the set order, and obtain the sum of the differences of all pixels in each picture area, which is recorded as BQS[i*j]. Each picture area is regarded as a BQS area. Sort the values ​​from large to small, and select the first m areas, which are recorded as BQS[m]. The n pictures in the first picture set are processed in the same way, the first m BQS areas of each picture are selected and recorded as BQS[m]n, the BQS areas existing in the n pictures are selected as valid areas, and the first positioning template is determined according to the valid areas.

2. The method for correcting illegal parking images based on brightness difference according to claim 1, characterized in that: The step of determining the first positioning template according to the effective area includes: The number of valid areas is judged. If the total number of valid areas is greater than the specified threshold, it is judged as valid area positioning and identification. If the value is not reached, the selected valid area is abandoned, the focal length parameters are adjusted, the first picture set is re-acquired and the first positioning template is recalculated.

3. The method for correcting illegal parking images based on brightness difference according to claim 1, characterized in that: The setting sequence is: based on the initial direction of the image acquired by the camera, from left to right and from top to bottom.

4. The method for correcting illegal parking images based on brightness difference according to claim 1, characterized in that: S3 said obtaining the reference position mark line comprises: For each pixel point in the single BQS area of ​​the first positioning template, traverse the 8 neighbors to obtain the brightness difference, and adopt a depth-first approach to calculate the brightness difference along the 8 neighbors. When the brightness difference between the subsequent pixel point and the previous pixel point is within the threshold BD, the subsequent pixel point is identified as a valid point, and the traversal continues along the vector direction of the previous pixel point-valid point to obtain all points within the BD range. After traversing all points, sort each point based on the sum of the number of valid points selected based on the depth-first selection, select a straight line connecting the points in the ranking sequence 1 and 2, and use the obtained straight line as the reference position mark line of the single BQS area of ​​the first positioning template; wherein, the 8 neighbors refer to the 8 neighboring pixel points around the pixel point.

5. The method for correcting illegal parking images based on brightness difference according to claim 4, characterized in that: After selecting a straight line connecting the points of the ranking sequences 1 and 2, the method further includes: The width of the straight line is judged. If the width of the straight line is not less than the specified width, it meets the requirements. If the width of the straight line is less than the specified width, the straight line is considered invalid. The straight line is connected with the points in the ranking sequences 1 and 3 and the obtained straight line width is judged again in the same way. If it meets the requirements, it is identified as the reference position mark line. If it still does not meet the requirements, the points in the ranking sequence 1 are removed and recalculated from the points in the ranking sequences 2 and 3 until a straight line that meets the requirements is selected as the reference position mark line.

6. The method for correcting illegal parking images based on brightness difference according to claim 1, characterized in that: Before the step of connecting the reference position marking lines in the first positioning template in pairs in step S5, the method further includes: The reference position of the first template is compared with the reference position of the second template. When the distance error between the reference position of the first template and the corresponding reference position of the second template is within the specified threshold, they are identified as the same reference position in the same area, and only the same reference positions of the first template and the second template are subsequently connected in pairs.

7. A system for correcting illegal parking images based on brightness difference, 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 steps of the method described in any one of claims 1 to 6 are implemented.

Citation Information

Patent Citations

  • Self-adaptive panoramic stitching method based on snapshot pictures of dome camera

    CN111815517A

  • Detection method capable of realizing multiple geometric measurement characteristics

    CN113838039A