Rapid image recognition method and device based on wide-angle camera
The central corner point is searched twice through the gradient value, and the target area of the wide-angle camera is obtained by using the second central corner point as a reference, which solves the difficulty of ROI recognition caused by distortion and improves recognition efficiency.
Patent Information
- Application Number
- CN202510613688.9
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-05-13
- Publication Date
- 2025-09-23
AI Technical Summary
Wide-angle cameras produce barrel distortion when recognizing image ROIs, which increases the difficulty of identifying and locating the ROI area and reduces recognition efficiency.
The central corner point is searched twice by the gradient value, and the second central corner point is used as the reference to obtain the nearest boundary point of the four pixels with the specified offset. The offset is automatically adjusted to identify the target area.
The search accuracy and recognition efficiency of the central corner points are improved, the target area can be quickly located, and image recognition in large distorted areas can be adapted.
Smart Images

Figure CN120689576A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the technical field of image recognition, and in particular to a method and device for rapid image recognition based on a wide-angle camera. Background Art
[0002] In computer vision tasks, identifying the ROI (Region of Interest) in an image can reduce the amount of data processed and improve computational efficiency. For example, in face recognition, first finding the ROI where the face resides, then performing feature extraction and recognition in this area, is more efficient than processing the entire image. The ROI can highlight key features, remove unnecessary background noise, and improve recognition and analysis accuracy.
[0003] Automatic detection technology includes target detection algorithms based on deep learning, which can automatically detect and locate targets in images as ROIs, as well as traditional detection methods based on edge detection and threshold segmentation.
[0004] However, in actual use, when using a wide-angle camera to perform ROI recognition of an image, it will cause barrel distortion of the image, resulting in deformation of the shape and size of objects at the edge of the image, thereby affecting the accurate judgment of the object's position and form, and increasing the difficulty of identifying and locating the ROI area of the image. Summary of the Invention
[0005] In the prior art, when a wide-angle camera is used to perform ROI recognition of an image, the image is subjected to barrel distortion, which not only increases the difficulty of identifying and locating the ROI region of the image, but also reduces the recognition efficiency.
[0006] In response to the above problems, a method and device for rapid image recognition based on a wide-angle camera are proposed. By using the gradient value to perform a secondary search for the central corner point, the search accuracy of the central corner point is improved. By taking the second central corner point as the benchmark and obtaining the four nearest boundary points of the four pixel points with a specified offset, the target center area is obtained. The offset can be automatically adjusted according to the FOV based on the wide-angle camera without changing the drawing. Even for areas with relatively large distortion, the target area can be quickly searched, thereby improving the recognition efficiency.
[0007] In a first aspect, a method for rapid image recognition based on a wide-angle camera comprises: Step 100: Acquire an image to be identified, and perform binarization processing on the image to be identified to obtain a binarized image; Step 200: Obtain a first central corner point based on the gradient value of each pixel point of the binary image in a specified direction, and perform sub-pixel corner point search on the first central corner point to obtain a second central corner point; Step 300: Using the second center corner point as a reference, obtain four pixel points with a specified offset, and perform a search based on the four pixel points to obtain four boundary points closest to the four pixel points. The area enclosed by the lines connecting the four boundary points and the second center corner point is the target center area.
[0008] In conjunction with the wide-angle camera-based rapid image recognition method described in the first aspect of the present invention, in a first possible implementation, step 100 includes: Step 110: read the image to be identified and perform grayscale processing on the read image to be identified to obtain a grayscale image to be identified; Step 120 : Binarize the grayscale image to be identified according to a specified threshold value to obtain the binarized image.
[0009] In conjunction with the first possible implementation of the first aspect of the present invention, in a second possible implementation, step 110 includes: Step 111: read the image to be identified and obtain an image data array of the image to be identified; Step 112: Convert the RGB value of each pixel in the image data array into a grayscale value by weight, to obtain the grayscale image to be identified.
[0010] In conjunction with the second possible implementation manner of the first aspect of the present invention, in a third possible implementation manner, step 120 includes: Step 121: Obtain an empirically defined threshold value; Step 122: Compare the grayscale value of each pixel in the grayscale image to be identified with the specified threshold. If the grayscale value is greater than the specified threshold, the pixel is processed as a white pixel. If the grayscale value is less than the specified threshold, the pixel is processed as a black pixel to obtain the binary image.
[0011] In conjunction with the wide-angle camera-based rapid image recognition method described in the first aspect of the present invention, in a fourth possible implementation, step 200 includes: Step 210: calculate the first gradient value in the horizontal direction and the second gradient value in the vertical direction of each pixel; Step 220: If both the first gradient value and the second gradient value are smaller than a predetermined gradient threshold, the pixel point is determined to be a first central corner point.
[0012] In conjunction with the fourth possible implementation manner of the first aspect of the present invention, in a fifth possible implementation manner, step 200 further includes: Step 230: Obtain a search box area of the first central corner point; Step 240: performing grayscale interpolation on the search frame area using bilinear interpolation to obtain a sub-pixel grayscale value distribution; Step 250: Perform a secondary search for the central corner point in the search box area according to the gradient value to obtain the second central corner point.
[0013] In conjunction with the wide-angle camera-based rapid image recognition method described in the first aspect of the present invention, in a sixth possible implementation, step 300 includes: Step 310: Obtain a first offset and a second offset in the vertical direction; Step 320: Acquire two pixel points in a vertical direction according to the first offset and the second offset; Step 330: Perform a horizontal search based on the two pixel points in the vertical direction to obtain two boundary points closest to the two pixel points in the vertical direction.
[0014] In conjunction with the wide-angle camera-based rapid image recognition method described in the first aspect of the present invention, in a seventh possible implementation, step 300 further includes: Step 340: Obtain a third offset and a fourth offset in the horizontal direction; Step 350: Acquire two pixel points in the horizontal direction according to the third offset and the fourth offset; Step 360: Perform a vertical search based on the two pixel points in the horizontal direction to obtain two boundary points closest to the two pixel points in the horizontal direction.
[0015] In a second aspect, a device for rapid image recognition based on a wide-angle camera is provided, which adopts the method for rapid image recognition based on a wide-angle camera described in the first aspect, comprising: A binarization module is configured to obtain an image to be identified and perform binarization processing on the image to be identified to obtain a binarized image; a first search module is configured to obtain a first central corner point based on the gradient value of each pixel point of the binarized image in a specified direction, and perform sub-pixel corner point search on the first central corner point to obtain a second central corner point; The second search module is used to obtain four pixel points with a specified offset based on the second central corner point, and to search based on the four pixel points to obtain four boundary points closest to the four pixel points. The area enclosed by the lines connecting the four boundary points and the second central corner point is the target center area.
[0016] In conjunction with the wide-angle camera-based rapid image recognition device according to the second aspect of the present invention, in a first possible implementation manner, the second search module includes: a first search unit and a second search unit; The first search unit is configured to obtain a first offset and a second offset in a vertical direction, obtain two pixel points in the vertical direction based on the first offset and the second offset, and perform a horizontal search based on the two pixel points in the vertical direction to obtain two boundary points closest to the two pixel points in the vertical direction; The second search unit is used to obtain a third offset and a fourth offset in the horizontal direction, and obtain two pixel points in the horizontal direction based on the third offset and the fourth offset, and perform a vertical search based on the two pixel points in the horizontal direction to obtain the two boundary points closest to the two pixel points in the horizontal direction.
[0017] The method and device for rapid image recognition based on a wide-angle camera described in the present invention improve the search accuracy of the central corner point by performing a secondary search for the central corner point using the gradient value. The target central area is obtained by obtaining the four nearest boundary points of four pixel points with a specified offset based on the second central corner point. The offset can be automatically adjusted according to the FOV based on the wide-angle camera without changing the drawing. Even for areas with relatively large distortion, the target area can be quickly searched, thereby improving recognition efficiency. BRIEF DESCRIPTION OF THE DRAWINGS
[0018] In order to more clearly illustrate the technical solutions in the embodiments of the present invention, the following briefly introduces the drawings required for use in the description of the embodiments. Obviously, the drawings described below are only some embodiments of the present invention. For ordinary technicians in this field, other drawings can be obtained based on these drawings without creative work.
[0019] Figure 1 This is a flow chart of a specific embodiment of a method for rapid image recognition based on a wide-angle camera in this application; Figure 2 yes Figure 1 A schematic flow chart of a specific embodiment of step 100; Figure 3 yes Figure 2 A schematic flow chart of a specific embodiment of step 110; Figure 4 yes Figure 2 A schematic flow chart of a specific embodiment of step 120; Figure 5 yes Figure 1 A schematic flow chart of a specific embodiment of step 200; Figure 6 yes Figure 5 A schematic flow chart of a specific embodiment after step 220; Figure 7 yes Figure 5 A flow chart of a specific embodiment of step 300; Figure 8 yes Figure 5 Another specific embodiment of step 300 is shown in the flowchart; Figure 9 is a schematic diagram of the image to be recognized; Figure 10 is a schematic diagram of a binary image of the image to be identified; Figure 11 It is a schematic diagram of searching based on offset; Figure 12 It is a schematic diagram of the corner points and boundary points found; Figure 13 This is a schematic diagram of the module structure of a wide-angle camera-based image rapid recognition device in this application. DETAILED DESCRIPTION
[0020] The following will clearly and completely describe the technical solutions of the present invention in conjunction with the accompanying drawings. Obviously, the embodiments described are only part of the embodiments of the present invention, not all of them. Based on the embodiments of the present invention, other embodiments obtained by ordinary technicians in this field without creative work are all within the scope of protection of the present invention.
[0021] Unless otherwise defined, all technical and scientific terms used herein have the same meaning as commonly understood by one skilled in the art to which this invention pertains. The terms used in this specification of the present invention are for the purpose of describing specific embodiments only and are not intended to limit the present invention. The term "and / or" as used herein includes any and all combinations of one or more of the associated listed items.
[0022] It should be noted that when an element is referred to as being “fixed on” or “disposed on” another element, it may be directly on the other element or indirectly on the other element. When an element is referred to as being “connected to” another element, it may be directly connected to the other element or indirectly connected to the other element.
[0023] It should be understood that the terms "length", "width", "up", "down", "front", "back", "left", "right", "vertical", "horizontal", "top", "bottom", "inside", "outside", etc., indicating the orientation or position relationship, are based on the orientation or position relationship shown in the accompanying drawings, and are only for the convenience of describing this application and simplifying the description, and do not indicate or imply that the device or element referred to must have a specific orientation, be constructed and operated in a specific orientation, and therefore cannot be understood as a limitation on this application.
[0024] Furthermore, the terms "first" and "second" are used for descriptive purposes only and should not be construed as indicating or implying relative importance or implicitly specifying the number of the technical features being referred to. Thus, a feature defined as "first" or "second" may explicitly or implicitly include one or more of the features. Throughout the description of this application, "plurality" means two or more, unless otherwise specifically defined.
[0025] In the prior art, when a wide-angle camera is used to perform ROI recognition of an image, the image is subjected to barrel distortion, which not only increases the difficulty of identifying and locating the ROI region of the image, but also reduces the recognition efficiency.
[0026] To solve the above problems, a method and device for rapid image recognition based on a wide-angle camera are proposed.
[0027] In the first aspect, a method for rapid image recognition based on a wide-angle camera is provided. Figure 1 , Figure 1 This is a flow chart of a specific embodiment of a method for rapid image recognition based on a wide-angle camera in this application; it includes: Step 100: Obtain an image to be identified, and perform binarization processing on the image to be identified to obtain a binarized image.
[0028] In a preferred embodiment, Figure 2 , Figure 2 yes Figure 1 A flow chart of a specific embodiment of step 100 is shown in FIG. 1 ; step 100 includes: like Figure 9 , Figure 9 is a schematic diagram of an image to be identified; step 110, read the image to be identified and grayscale the read image to be identified to obtain a grayscale image to be identified; step 120, binarize the grayscale image to be identified according to a specified threshold value to obtain a binary image, such as Figure 10 , Figure 10 It is a schematic diagram of the binary image of the image to be recognized.
[0029] In a preferred embodiment, Figure 3 , Figure 3 yes Figure 2 A flow chart of a specific embodiment of step 110 in FIG. 1 ; step 110 includes: step 111, reading the image to be identified to obtain an image data array of the image to be identified; step 112, converting the RGB value of each pixel in the image data array into a weighted grayscale value to obtain a grayscale image to be identified.
[0030] In a preferred embodiment, Figure 4 , Figure 4 yes Figure 2A flowchart of a specific embodiment of step 120 in FIG. 1 is provided; step 120 includes: step 121, obtaining an empirically specified threshold; step 122, comparing the grayscale value of each pixel in the grayscale image to be identified with the specified threshold; if the grayscale value is greater than the specified threshold, the pixel is processed as a white pixel; if the grayscale value is less than the specified threshold, the pixel is processed as a black pixel to obtain a binary image.
[0031] In this embodiment, it is worth noting that the grayscale value threshold can also be determined adaptively based on the local features of each pixel.
[0032] Step 200: Obtain a first central corner point based on the gradient value of each pixel point in the binary image in a specified direction, perform sub-pixel corner point search on the first central corner point, and obtain a second central corner point ( Figure 11 ).
[0033] In a preferred embodiment, Figure 5 , Figure 5 yes Figure 1 A flowchart of a specific embodiment of step 200 in FIG. 2 is provided; step 200 includes: step 210, calculating a first gradient value in the horizontal direction and a second gradient value in the vertical direction of each pixel; step 220, if both the first gradient value and the second gradient value are less than a specified gradient threshold, determining that the pixel is a first central corner point.
[0034] In this embodiment, the first central corner point is the initially determined central corner point. Figure 9 and Figure 10 , the gradient value of the central corner point is the smallest in both the horizontal and vertical directions. When the first gradient value and the second gradient value of the pixel are both less than the specified gradient threshold, the pixel is determined to be the first central corner point.
[0035] In a preferred embodiment, Figure 6 , Figure 6 yes Figure 5 A flowchart of a specific embodiment after step 220 in the figure; step 200 also includes: step 230, obtaining a search box area for a first central corner point; step 240, performing grayscale interpolation on the search box area using bilinear interpolation to obtain a sub-pixel grayscale value distribution; step 250, performing a secondary search for the central corner point in the search box area according to the gradient value to obtain a second central corner point.
[0036] In this embodiment, after grayscale interpolation is performed, the gradient value is used again to search to obtain the final central corner point, that is, the second central corner point.
[0037] Step 300: Using the second center corner point as a reference, obtain four pixel points with a specified offset, and search based on the four pixel points to obtain four boundary points closest to the four pixel points. The area enclosed by the lines connecting the four boundary points and the second center corner point is the target center area.
[0038] In a preferred embodiment, Figure 7 , Figure 7 yes Figure 5 A flow chart of a specific embodiment of step 300 is shown in FIG. 3 ; step 300 includes: like Figure 11 and Figure 12 , Figure 11 It is a schematic diagram of searching based on offset; Figure 12 is a schematic diagram of the corner points and boundary points that have been searched; Step 310, obtaining a first offset and a second offset in the vertical direction; Step 320, obtaining two pixel points in the vertical direction ( Figure 11 Step 330: Using the two vertical pixel points as a reference, perform a horizontal search to obtain the two boundary points closest to the two vertical pixel points ( Figure 12 ).
[0039] In this embodiment, the two pixel points are located above and below the central corner point respectively. When searching, the search stops when a black-white boundary is encountered, that is, the nearest boundary point.
[0040] In a preferred embodiment, Figure 8 , Figure 8 yes Figure 5 Another specific embodiment of step 300 is shown in the flowchart; step 300 further includes: step 340, obtaining a third offset and a fourth offset in the horizontal direction; step 350, obtaining two pixel points in the horizontal direction ( Figure 11 Step 360: Based on the two horizontal pixel points, perform a vertical search to obtain the two boundary points closest to the two horizontal pixel points ( Figure 12 ).
[0041] In this embodiment, the two pixel points are located in the left and right directions of the central corner point respectively. When searching, the search stops when encountering a black-white boundary, that is, the nearest boundary point.
[0042] In an embodiment of the present application, the center corner point is searched twice by using the gradient value, so that the search accuracy of the center corner point is improved. By taking the second center corner point as the reference, the four nearest boundary points of the four pixel points are obtained with a specified offset to obtain the target center area. The offset can be automatically adjusted according to the FOV based on the wide-angle camera without changing the drawing. Even for areas with relatively large distortion, the target area can be quickly searched, thereby improving the recognition efficiency.
[0043] In the second aspect, a device for rapid image recognition based on a wide-angle camera is provided. Figure 13 , Figure 13 This is a schematic diagram of the module structure of a wide-angle camera-based image rapid recognition device in this application. The wide-angle camera-based image rapid recognition method of the first aspect includes: A binarization module 401 is used to obtain an image to be identified, perform binarization processing on the image to be identified, and obtain a binarized image; A first search module 402 is configured to obtain a first central corner point based on the gradient value of each pixel point in the binary image in a specified direction, and perform sub-pixel corner point search on the first central corner point to obtain a second central corner point; The second search module 403 is used to obtain four pixel points with a specified offset based on the second central corner point, and to search based on the four pixel points to obtain four boundary points closest to the four pixel points. The area enclosed by the lines connecting the four boundary points and the second central corner point is the target center area.
[0044] Furthermore, the second search module 403 includes: a first search unit and a second search unit; the first search unit is used to obtain a first offset and a second offset in the vertical direction, and obtain two pixel points in the vertical direction based on the first offset and the second offset, and perform a horizontal search with the two pixel points in the vertical direction as a reference to obtain two boundary points closest to the two pixel points in the vertical direction; the second search unit is used to obtain a third offset and a fourth offset in the horizontal direction, and obtain two pixel points in the horizontal direction based on the third offset and the fourth offset, and perform a vertical search with the two pixel points in the horizontal direction as a reference to obtain two boundary points closest to the two pixel points in the horizontal direction.
[0045] The present invention implements a method and device for rapid image recognition based on a wide-angle camera. By using gradient values to perform a secondary search for the central corner point, the search accuracy of the central corner point is improved. The target central area is obtained by using the second central corner point as a reference and obtaining the four nearest boundary points of four pixel points with a specified offset. The offset can be automatically adjusted according to the FOV based on the wide-angle camera without changing the drawing. Even for areas with relatively large distortion, the target area can be quickly searched, thereby improving recognition efficiency.
[0046] The above are only preferred embodiments of the present invention and are not intended to limit the present invention. Any modifications, equivalent replacements, improvements, etc. made within the spirit and principles of the present invention should be included in the scope of protection of the present invention.
Claims
1. A method for rapid image recognition based on a wide-angle camera, characterized in that: include: Step 100: Acquire an image to be identified, and perform binarization processing on the image to be identified to obtain a binarized image; Step 200: Obtain a first central corner point based on the gradient value of each pixel point of the binary image in a specified direction, and perform sub-pixel corner point search on the first central corner point to obtain a second central corner point; Step 300: Using the second center corner point as a reference, obtain four pixel points with a specified offset, and perform a search based on the four pixel points to obtain four boundary points closest to the four pixel points. The area enclosed by the lines connecting the four boundary points and the second center corner point is the target center area.
2. The method for rapid image recognition based on a wide-angle camera according to claim 1, characterized in that: The step 100 includes: Step 110: read the image to be identified and perform grayscale processing on the read image to be identified to obtain a grayscale image to be identified; Step 120 : Binarize the grayscale image to be identified according to a specified threshold value to obtain the binarized image.
3. The method for rapid image recognition based on a wide-angle camera according to claim 2, characterized in that: The step 110 includes: Step 111: read the image to be identified and obtain an image data array of the image to be identified; Step 112: Convert the RGB value of each pixel in the image data array into a grayscale value by weight, to obtain the grayscale image to be identified.
4. The method for rapid image recognition based on a wide-angle camera according to claim 3, characterized in that: The step 120 includes: Step 121: Obtain an empirically defined threshold value; Step 122: Compare the grayscale value of each pixel in the grayscale image to be identified with the specified threshold. If the grayscale value is greater than the specified threshold, the pixel is processed as a white pixel. If the grayscale value is less than the specified threshold, the pixel is processed as a black pixel to obtain the binary image.
5. The method for rapid image recognition based on a wide-angle camera according to claim 1, characterized in that: The step 200 includes: Step 210: calculate the first gradient value in the horizontal direction and the second gradient value in the vertical direction of each pixel; Step 220: If both the first gradient value and the second gradient value are smaller than a predetermined gradient threshold, the pixel point is determined to be a first central corner point.
6. The method for rapid image recognition based on a wide-angle camera according to claim 5, characterized in that: The step 200 further includes: Step 230: Obtain a search box area of the first central corner point; Step 240: performing grayscale interpolation on the search frame area using bilinear interpolation to obtain a sub-pixel grayscale value distribution; Step 250: Perform a secondary search for the central corner point in the search box area according to the gradient value to obtain the second central corner point.
7. The method for rapid image recognition based on a wide-angle camera according to claim 1, characterized in that: The step 300 includes: Step 310: Obtain a first offset and a second offset in the vertical direction; Step 320: Acquire two pixel points in a vertical direction according to the first offset and the second offset; Step 330: Perform a horizontal search based on the two pixel points in the vertical direction to obtain two boundary points closest to the two pixel points in the vertical direction.
8. The method for rapid image recognition based on a wide-angle camera according to claim 1, characterized in that: The step 300 further includes: Step 340: Obtain a third offset and a fourth offset in the horizontal direction; Step 350: Acquire two pixel points in the horizontal direction according to the third offset and the fourth offset; Step 360: Perform a vertical search based on the two pixel points in the horizontal direction to obtain two boundary points closest to the two pixel points in the horizontal direction.
9. A device for rapid image recognition based on a wide-angle camera, using the method for rapid image recognition based on a wide-angle camera according to any one of claims 1 to 8, characterized in that: include: A binarization module is used to obtain an image to be identified, and perform binarization processing on the image to be identified to obtain a binarized image; a first search module, configured to obtain a first central corner point according to a gradient value of each pixel point of the binary image in a specified direction, and perform sub-pixel corner point search on the first central corner point to obtain a second central corner point; The second search module is used to obtain four pixel points with a specified offset based on the second central corner point, and to search based on the four pixel points to obtain four boundary points closest to the four pixel points. The area enclosed by the lines connecting the four boundary points and the second central corner point is the target center area.
10. The image rapid recognition device based on a wide-angle camera according to claim 9, characterized in that: The second search module includes: a first search unit and a second search unit; The first search unit is configured to obtain a first offset and a second offset in a vertical direction, obtain two pixel points in the vertical direction based on the first offset and the second offset, and perform a horizontal search based on the two pixel points in the vertical direction to obtain two boundary points closest to the two pixel points in the vertical direction; The second search unit is used to obtain a third offset and a fourth offset in the horizontal direction, and obtain two pixel points in the horizontal direction based on the third offset and the fourth offset, and perform a vertical search based on the two pixel points in the horizontal direction to obtain the two boundary points closest to the two pixel points in the horizontal direction.