Method, system, device and storage medium for setting identification resolution

By constructing multi-level sub-images and calculating reprojection errors, the 2D picture recognition resolution is automatically set, which solves the problem of inconvenience in manual resolution setting in the prior art, and improves the recognition efficiency and accuracy.

CN112053282BActive Publication Date: 2025-01-14BEIJING JINGDONG SHANGKE INFORMATION TECH CO LTD +1
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN201910492476.4
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2019-06-06
Publication Date
2025-01-14
Estimated Expiration
2039-06-06

AI Technical Summary

Technical Problem

The existing 2D image recognition technology requires manual setting of the recognition resolution, which leads to inconvenient resolution adjustment in different usage scenarios, especially when the user is far away from the image, the recognition effect is reduced.

Method used

By obtaining the current image and original image of the object to be identified, a multi-level sub-image is constructed, the reprojection error between each level sub-image and the current image is calculated, and the sub-image resolution corresponding to the minimum error is selected as the recognition resolution for tracking and recognition.

Benefits of technology

It realizes more accurate recognition resolution settings in image recognition tracking scenarios, improving the efficiency and accuracy of image recognition.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN112053282B_ABST
    Figure CN112053282B_ABST
Patent Text Reader

Abstract

The present invention discloses a method, system, device and storage medium for setting recognition resolution, the setting method comprising: obtaining a current image of an object to be recognized; obtaining an original image; the original image corresponds to the object to be recognized; constructing a multi-level sub-image based on the original image, the physical size of the sub-image is the same as the physical size of the original image, and the resolution of each level of sub-image is different; respectively calculating the reprojection error between each level of sub-image and the current image; using the resolution of the target sub-image corresponding to the minimum reprojection error as the recognition resolution of the current image; the recognition resolution is used to track and recognize the current image. Constructing a multi-level sub-image based on the original image, finding the target sub-image closest to the current image by calculating the reprojection error between the sub-image and the current image, and setting the resolution of the target sub-image to the recognition resolution of the current image, a more accurate recognition resolution setting can ensure higher efficiency and accuracy of image recognition.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention belongs to the field of image recognition, and in particular relates to a method, system, device and storage medium for setting recognition resolution. Background Art

[0002] Tracking and recognition based on 2D (two-dimensional) images is widely used in e-commerce marketing scenarios. This latest marketing method requires users to use their mobile phones to scan relevant natural images (logos, book pages, etc.), and then the relevant APP (application) will start the relevant service to respond to the user's scanned content, and the response content is usually very attractive. At present, the recognition and tracking of 2D images are mainly based on the traditional local feature method, which uses the relevant technology of feature point detection to extract the feature points in the image, and compares the feature points with the feature points of the relevant images in the database to achieve recognition and tracking effects. However, the method based on traditional local features requires the recognition and tracking service provider (B-end) to set the relevant resolution according to the user's (C-end) usage scenario, that is, the B-end user needs to set the response resolution feature on the server in advance. When the image is far away from the mobile phone in the C-end user's scenario, the resolution of the corresponding image area is relatively low, and the B-end service provider needs to provide a low-resolution setting, otherwise, a high-resolution setting is required. Summary of the invention

[0003] The technical problem to be solved by the present invention is to overcome the defect in the prior art that the resolution of 2D image recognition needs to be manually set and adjusted, and to provide a method, system, device and storage medium for setting the recognition resolution.

[0004] The present invention solves the above technical problems through the following technical solutions:

[0005] A method for setting recognition resolution in an image recognition and tracking scenario, the setting method comprising:

[0006] Get the current image of the object to be identified;

[0007] Acquire an original image; the original image corresponds to the object to be identified in the acquired current image;

[0008] Constructing a multi-level sub-image based on the original image, wherein the physical size of the sub-image is the same as the physical size of the original image, and the resolution of each level of the sub-image is different;

[0009] Respectively calculating the reprojection error between each level of sub-image and the current image;

[0010] The resolution of the target sub-image corresponding to the minimum reprojection error is used as the recognition resolution of the current image; the recognition resolution is used to track and recognize the current image.

[0011] Preferably, the step of respectively calculating the reprojection error between each level of sub-image and the current image specifically comprises:

[0012] Extracting feature points from each level of sub-image and the current image respectively, and generating descriptors corresponding to the respective feature points;

[0013] Calculating the similarity between the descriptor of each level of sub-image and the descriptor of the current image based on an approximate neighbor algorithm, and taking the feature point pairs corresponding to the descriptor pairs with a similarity higher than a preset threshold as matching feature points; the matching feature points include the first matching feature points in each level of sub-image and the second matching feature points in the current image in one-to-one correspondence;

[0014] Based on the Perspective-n-Point algorithm (PNP algorithm, an algorithm for solving camera extrinsic parameters), the rotation and translation parameters of the current image coordinate system relative to the sub-image coordinate system of each level are obtained according to the first position data of the first matching feature point in the sub-image of each level and the second position data of the second matching feature point in the current image;

[0015] Obtaining third position data of all first matching feature points converted into the current image coordinate system according to the rotation and translation parameters;

[0016] The reprojection error is calculated based on the second position data and the third position data.

[0017] Preferably, the setting method solves the reprojection error according to the following formula, specifically including:

[0018]

[0019] Among them, Loss i is the reprojection error of the i-th level sub-image, S i is the i-th level sub-image, C is the current image, is the third position data of the kth first matching feature point in the i-th level sub-image, is the second position data of the kth second matching feature point in the current image, K i is the number of matching feature points between the i-th level sub-image and the current image.

[0020] Preferably, the step of using the resolution of the sub-image corresponding to the minimum reprojection error as the recognition resolution of the current image specifically comprises:

[0021] Acquire a projection area of ​​the target sub-image converted to the current image coordinate system according to the rotation and translation parameters of the target sub-image;

[0022] Acquire the intersection area of ​​the current image and the projection area;

[0023] The recognition resolution of the current image is obtained according to the physical area of ​​the intersection area and the number of pixels in the intersection area.

[0024] Preferably, in the step of obtaining the recognition resolution of the current image according to the physical size of the intersection area and the number of pixels in the intersection area, the recognition resolution is solved according to the following formula:

[0025] R {C} =w {C} *h {C}

[0026]

[0027] Among them, R {C} is the recognition resolution of the current image, w {C} is the width of the recognition resolution of the current image, h {C} is the high recognition resolution of the current image, Q S is the physical area of ​​the original image, w is the width of the resolution of the original image, h is the height of the resolution of the original image, Q J is the physical area of ​​the intersection area, and T is the number of pixels in the intersection area.

[0028] Preferably, the step of constructing a multi-level sub-image based on the original image specifically includes:

[0029] Acquire the resolution of the original image;

[0030] By formula Get the resolution of each level of sub-image, where is the resolution of the i-th level sub-image, w is the width of the resolution of the original image, h is the height of the resolution of the original image, w i is the width of the resolution of the i-th level sub-image, h i is the height of the resolution of the i-th level sub-image, w i >m,h i >n, i is a positive integer, m and n are preset constants.

[0031] Preferably, after the step of acquiring the current image of the object to be identified, the setting method further comprises:

[0032] Obtaining device parameters of a shooting device used to shoot the current image;

[0033] Performing dedistortion processing on the current image according to the device parameters;

[0034] In the step of respectively calculating the reprojection errors between each level of sub-image and the current image, the dedistorted current image is calculated.

[0035] An electronic device 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, the method for setting the recognition resolution in the above-mentioned picture recognition and tracking scenario is implemented.

[0036] A computer-readable storage medium stores a computer program, which, when executed by a processor, implements the steps of the method for setting the recognition resolution in the above-mentioned picture recognition and tracking scenario.

[0037] A system for setting recognition resolution in a picture recognition and tracking scenario, the setting system comprising a current image acquisition module, an original image acquisition module, a sub-image construction module, a calculation module, a recognition resolution acquisition module and a tracking and recognition module;

[0038] The current image acquisition module is used to acquire the current image of the object to be identified;

[0039] The original image acquisition module is used to acquire an original image; the original image corresponds to the object to be identified in the acquired current image;

[0040] The sub-image construction module is used to construct a multi-level sub-image based on the original image, the physical size of the sub-image is the same as the physical size of the original image, and the resolution of each level of sub-image is different;

[0041] The calculation module is used to respectively calculate the reprojection error between each level of sub-image and the current image;

[0042] The recognition resolution acquisition module is used to use the resolution of the target sub-image corresponding to the minimum reprojection error as the recognition resolution of the current image; the recognition resolution is used to track and recognize the current image.

[0043] Preferably, the calculation module includes a descriptor generation unit, a matching feature point acquisition unit, a rotation and translation parameter calculation unit and a first conversion unit;

[0044] The descriptor generating unit is used to extract feature points from the sub-images of each level and the current image respectively, and generate descriptors corresponding to the respective feature points;

[0045] The matching feature point acquisition unit is used to calculate the similarity between the descriptor of each level of sub-image and the descriptor of the current image based on an approximate neighbor algorithm, and use the feature point pairs corresponding to the descriptor pairs with similarity higher than a preset threshold as matching feature points; the matching feature points include the first matching feature points in each level of sub-image and the second matching feature points in the current image in a one-to-one correspondence;

[0046] The rotation and translation parameter calculation unit is used to obtain the rotation and translation parameters of the current image coordinate system relative to the sub-image coordinate system of each level based on the first position data of the first matching feature point in the sub-image of each level and the second position data of the second matching feature point in the current image based on the PNP algorithm;

[0047] The first conversion unit is used to obtain third position data of all first matching feature points converted into the current image coordinate system according to the rotation and translation parameters;

[0048] The calculation module is used to calculate the reprojection error according to the second position data and the third position data.

[0049] Preferably, the setting system solves the reprojection error according to the following formula, specifically including:

[0050]

[0051] Among them, Loss i is the reprojection error of the i-th level sub-image, S i is the i-th level sub-image, C is the current image, is the third position data of the kth first matching feature point in the i-th level sub-image, is the second position data of the kth second matching feature point in the current image, K i is the number of matching feature points between the i-th level sub-image and the current image.

[0052] Preferably, the recognition resolution acquisition module includes a second conversion unit and an intersection area acquisition unit;

[0053] The second conversion unit is used to obtain a projection area of ​​the target sub-image converted to the current image coordinate system according to the rotation and translation parameters of the target sub-image;

[0054] The intersection area acquisition unit is used to acquire the intersection area between the current image and the projection area;

[0055] The recognition resolution acquisition module is used to obtain the recognition resolution of the current image according to the physical area of ​​the intersection area and the number of pixels in the intersection area.

[0056] Preferably, the recognition resolution acquisition module is used to solve the recognition resolution according to the following formula:

[0057] R {C} =w {C} *h {C}

[0058]

[0059] Among them, R {C} is the recognition resolution of the current image, w {C} is the width of the recognition resolution of the current image, h {C} is the high recognition resolution of the current image, Q S is the physical area of ​​the original image, w is the width of the resolution of the original image, h is the height of the resolution of the original image, Q J is the physical area of ​​the intersection area, and T is the number of pixels in the intersection area.

[0060] Preferably, the sub-image construction module includes an original image resolution acquisition unit and a sub-image resolution calculation unit;

[0061] The original image resolution acquisition unit is used to acquire the resolution of the original image;

[0062] The sub-image resolution calculation unit is used to calculate the resolution of the image by the formula Get the resolution of each level of sub-image, where is the resolution of the i-th level sub-image, w is the width of the resolution of the original image, h is the height of the resolution of the original image, w i is the width of the resolution of the i-th level sub-image, h i is the height of the resolution of the i-th level sub-image, w i >m,h i >n, i is a positive integer, m and n are preset constants.

[0063] Preferably, the setting system further includes a device parameter acquisition module and a de-distortion module;

[0064] The device parameter acquisition module is used to acquire the device parameters of the shooting device that shoots the current image;

[0065] The dedistortion module is used to perform dedistortion processing on the current image according to the device parameters;

[0066] The calculation module is used to calculate the dedistorted current image.

[0067] The positive progressive effect of the present invention is that a multi-level sub-image is constructed based on the original image, and the target sub-image closest to the current image is found by calculating the reprojection error between the sub-image and the current image, and then the resolution of the target sub-image is set to the recognition resolution of the current image. In the picture recognition and tracking scenario, a more accurate recognition resolution setting can ensure higher image recognition efficiency and accuracy. BRIEF DESCRIPTION OF THE DRAWINGS

[0068] Figure 1 This is a flowchart of a method for setting recognition resolution in an image recognition and tracking scenario according to Embodiment 1 of the present invention.

[0069] Figure 2 This is a flowchart of step 30 in the method for setting the recognition resolution in the picture recognition and tracking scenario of embodiment 1 of the present invention.

[0070] Figure 3 This is a flowchart of step 40 in the method for setting the recognition resolution in the picture recognition and tracking scenario according to embodiment 2 of the present invention.

[0071] Figure 4 This is a flowchart of step 50 in the method for setting the recognition resolution in the picture recognition and tracking scenario of embodiment 3 of the present invention.

[0072] Figure 5 This is a schematic diagram of the structure of an electronic device according to Embodiment 4 of the present invention.

[0073] Figure 6 This is a module diagram of a system for setting recognition resolution in an image recognition and tracking scenario according to Embodiment 6 of the present invention.

[0074] Figure 7 This is a module diagram of a sub-image construction module in a system for setting recognition resolution in an image recognition and tracking scenario according to Embodiment 6 of the present invention.

[0075] Figure 8 This is a module diagram of a calculation module in a system for setting recognition resolution in an image recognition and tracking scenario according to Embodiment 7 of the present invention.

[0076] Fig. 9 This is a module diagram of a recognition resolution acquisition module in a system for setting recognition resolution in an image recognition and tracking scenario according to Embodiment 8 of the present invention. DETAILED DESCRIPTION

[0077] The present invention is further described below by way of examples, but the present invention is not limited to the scope of the examples.

[0078] Example 1

[0079] A method for setting the recognition resolution in an image recognition tracking scenario, such as Figure 1 As shown, the setting method includes:

[0080] Step 10: Obtain the current image of the object to be identified;

[0081] Step 20, obtaining an original image; the original image corresponds to the object to be identified in the obtained current image;

[0082] Step 30: construct a multi-level sub-image based on the original image; the physical size of the sub-image is the same as that of the original image, and the resolution of each level of sub-image is different; it should be noted that the display content of the constructed sub-image is the same as that of the original image;

[0083] Step 40, respectively calculating the reprojection error between each level of sub-image and the current image;

[0084] Step 50: Using the resolution of the target sub-image corresponding to the minimum reprojection error as the recognition resolution of the current image; the recognition resolution is used to track and recognize the current image.

[0085] Among them, Figure 2 As shown, step 30 specifically includes:

[0086] Step 301, obtaining the resolution of the original image;

[0087] Step 302: Obtain the resolution of each level of sub-images by using formula (1);

[0088]

[0089] in, is the resolution of the i-th level sub-image, w is the width of the resolution of the original image, h is the height of the resolution of the original image, w i is the width of the resolution of the i-th level sub-image, h i is the height of the resolution of the i-th level sub-image, w i >m,h i >n, i is a positive integer, m and n are preset constants.

[0090] It should be noted that the sub-image resolution setting method is only given here as an example. In specific implementation, it can also be set according to other progressive methods or other function calculation methods, as long as it can achieve different resolution settings for different sub-images.

[0091] In this embodiment, before the subsequent image processing, the acquired image is subjected to dedistortion processing by calibrating the parameters of the shooting device, and all subsequent steps are to process the dedistorted image. After step 10, see Figure 1 , the setting method further includes:

[0092] Step 11: Obtain device parameters of the shooting device that shoots the current image;

[0093] Step 12: Dedistort the current image according to the device parameters;

[0094] Furthermore, in step 40, the dedistorted current image is calculated.

[0095] In this embodiment, a multi-level sub-image is constructed based on the original image, and the target sub-image closest to the current image is found by calculating the reprojection error between the sub-image and the current image. Then, the resolution of the target sub-image is set to the recognition resolution of the current image. In the picture recognition and tracking scenario, a more accurate recognition resolution setting can ensure higher image recognition efficiency and accuracy.

[0096] Example 2

[0097] The method for setting the recognition resolution in the picture recognition tracking scenario of this embodiment is further improved on the basis of embodiment 1. Figure 3 As shown, step 40 specifically includes:

[0098] Step 401: extract feature points from each level of sub-image and the current image respectively, and generate descriptors corresponding to the respective feature points;

[0099] Step 402: Calculate the similarity between the descriptor of each level of sub-image and the descriptor of the current image based on an approximate neighbor algorithm, and use the feature point pairs corresponding to the descriptor pairs with a similarity higher than a preset threshold as matching feature points; the matching feature points include a one-to-one corresponding first matching feature point in each level of sub-image and a second matching feature point in the current image; wherein, the similarity calculation of the descriptors can be performed using the Hamming distance, and when there are many descriptors, an approximate method such as FLANN (fast nearest neighbor algorithm for high-dimensional data) can be used for matching calculations.

[0100] Step 403: Obtain rotation and translation parameters of the current image coordinate system relative to the sub-image coordinate system of each level based on the PNP algorithm according to the first position data of the first matching feature point in each level of sub-image and the second position data of the second matching feature point in the current image;

[0101] Step 404: Obtain third position data of all first matching feature points converted into the current image coordinate system according to the rotation and translation parameters;

[0102] Step 405: Calculate a reprojection error based on the second position data and the third position data.

[0103] In this embodiment, the reprojection error is solved according to the following formula (2), which specifically includes:

[0104]

[0105] Among them, Loss i is the reprojection error of the i-th level sub-image, S i is the i-th level sub-image, C is the current image, is the third position data of the kth first matching feature point in the i-th level sub-image, is the second position data of the kth second matching feature point in the current image, K i is the number of matching feature points between the i-th level sub-image and the current image.

[0106] In this embodiment, after calculating the matching of the descriptors, we now obtain the matching results of the two images (including multiple matching feature points). By calculating the rotation and translation parameters, the matching feature points in the sub-image are mapped to the current image coordinate system (i.e., the camera coordinate system), and then the average error of all corresponding feature points is taken as our error term. Different errors can be obtained for different sub-images, and the target sub-image with the smallest error is selected as the image closest to the current image. Then, when the recognition resolution of the current image is set, the resolution of the target sub-image can be set as the recognition resolution.

[0107] Example 3

[0108] The method for setting the recognition resolution in the picture recognition and tracking scenario of this embodiment is further improved on the basis of Embodiment 2. If the spacing between different levels of sub-images is too large, after obtaining the target sub-image through the above algorithm, it is still necessary to accurately calculate and recognize the closer recognition resolution of the current image, such as Figure 4 As shown, step 50 specifically includes:

[0109] Step 501, obtaining the projection area of ​​the target sub-image converted to the current image coordinate system according to the rotation and translation parameters of the target sub-image;

[0110] Step 502: Obtain the intersection area of ​​the current image and the projection area;

[0111] Step 503: Obtain the recognition resolution of the current image according to the physical area of ​​the intersection area and the number of pixels in the intersection area.

[0112] It should be noted that after obtaining the projection area of ​​the target sub-image converted to the current image coordinate system, it is necessary to calculate how many pixels the projection area occupies in the current image. Note that the effective pixels are calculated here, that is, the pixels belonging to the projection area among all the pixels in the current image. Specifically, according to the properties of perspective projection, the quadrilateral of the target sub-image is still a quadrilateral in the plane of the current image. At this time, the pixels in the polygon occupied by the intersection of this quadrilateral and the current image plane are the pixels of interest that we need to calculate. Secondly, we need to calculate the actual physical area of ​​the intersection area of ​​interest. We reproject the intersection area back to the target sub-image plane and use the same method to determine the intersection of the polygons to obtain the actual physical area. Through the above two steps of calculation, we get the actual physical area and the number of pixels of the intersection area. Here we only briefly explain the calculation method. The specific principles and calculation formulas refer to the existing projective geometry algorithms.

[0113] After obtaining the physical area of ​​the intersection area and the number of pixels in the intersection area, the recognition resolution is solved according to the following formula (3):

[0114]

[0115] Among them, R {C} is the recognition resolution of the current image, w {C} is the width of the recognition resolution of the current image, h {C} is the high recognition resolution of the current image, Q S is the physical area of ​​the original image, w is the width of the resolution of the original image, h is the height of the resolution of the original image, Q J is the physical area of ​​the intersection area, and T is the number of pixels in the intersection area.

[0116] In this embodiment, after acquiring the target sub-image, a more accurate recognition resolution can be further obtained after obtaining the physical area of ​​the intersection region and the number of pixels in the intersection region based on projective geometry.

[0117] Example 4

[0118] An electronic device includes a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein when the processor executes the computer program, the method for setting the recognition resolution in the image recognition and tracking scenario described in any one of embodiments 1 to 3 is implemented.

[0119] Figure 5 A schematic diagram of the structure of an electronic device provided in this embodiment. Figure 5 A block diagram of an exemplary electronic device 90 suitable for use in implementing embodiments of the present invention is shown. Figure 5The electronic device 90 shown is only an example and should not bring any limitation to the functions and scope of use of the embodiments of the present invention.

[0120] like Figure 5 As shown, the electronic device 90 may be in the form of a general-purpose computing device, for example, it may be a server device. The components of the electronic device 90 may include, but are not limited to: at least one processor 91, at least one memory 92, and a bus 93 connecting different system components (including the memory 92 and the processor 91).

[0121] The bus 93 includes a data bus, an address bus, and a control bus.

[0122] The memory 92 may include a volatile memory, such as a random access memory (RAM) 921 and / or a cache memory 922 , and may further include a read-only memory (ROM) 923 .

[0123] The memory 92 may also include a program tool 925 having a set (at least one) of program modules 924, such program modules 924 including but not limited to: an operating system, one or more application programs, other program modules and program data, each of which or some combination may include the implementation of a network environment.

[0124] The processor 91 executes various functional applications and data processing by running computer programs stored in the memory 92 .

[0125] The electronic device 90 may also communicate with one or more external devices 94 (e.g., keyboards, pointing devices, etc.). Such communication may be performed via an input / output (I / O) interface 95. Furthermore, the electronic device 90 may also communicate with one or more networks (e.g., a local area network (LAN), a wide area network (WAN), and / or a public network, such as the Internet) via a network adapter 96. The network adapter 96 communicates with other modules of the electronic device 90 via a bus 93. It should be understood that, although not shown in the figure, other hardware and / or software modules may be used in conjunction with the electronic device 90, including but not limited to: microcode, device drivers, redundant processors, external disk drive arrays, RAID (disk array) systems, tape drives, and data backup storage systems, etc.

[0126] It should be noted that although several units / modules or sub-units / modules of the electronic device are mentioned in the above detailed description, this division is merely exemplary and not mandatory. In fact, according to the embodiments of the present application, the features and functions of two or more units / modules described above can be embodied in one unit / module. Conversely, the features and functions of one unit / module described above can be further divided into multiple units / modules to be embodied.

[0127] Example 5

[0128] A computer-readable storage medium stores a computer program, which, when executed by a processor, implements the steps of a method for setting a recognition resolution in an image recognition and tracking scenario as described in any one of embodiments 1-3.

[0129] The readable storage medium may include but is not limited to: a portable disk, a hard disk, a random access memory, a read-only memory, an erasable programmable read-only memory, an optical storage device, a magnetic storage device or any suitable combination of the above.

[0130] In a possible implementation manner, the present invention can also be implemented in the form of a program product, which includes a program code. When the program product is run on a terminal device, the program code is used to enable the terminal device to execute the steps of the method for setting the recognition resolution in the image recognition tracking scenario described in any one of Examples 1-3.

[0131] The program code for executing the present invention may be written in any combination of one or more programming languages, and may be executed entirely on a user device, partially on a user device, as an independent software package, partially on a user device and partially on a remote device, or entirely on a remote device.

[0132] Example 6

[0133] A system for setting the recognition resolution in image recognition and tracking scenarios, such as Figure 6 As shown, the setting system includes a current image acquisition module 1, an original image acquisition module 2, a sub-image construction module 3, a calculation module 4 and an identification resolution acquisition module 5;

[0134] The current image acquisition module 1 is used to acquire the current image of the object to be identified;

[0135] The original image acquisition module 2 is used to acquire an original image; the original image corresponds to the object to be identified in the acquired current image;

[0136] The sub-image construction module 3 is used to construct a multi-level sub-image based on the original image. The physical size of the sub-image is the same as that of the original image, and the resolution of each level of sub-image is different. It should be noted that the display content of the constructed sub-image is the same as that of the original image.

[0137] The calculation module 4 is used to respectively calculate the reprojection error between each level of sub-image and the current image;

[0138] The recognition resolution acquisition module 5 is used to use the resolution of the target sub-image corresponding to the minimum reprojection error as the recognition resolution of the current image; the recognition resolution is used to track and recognize the current image.

[0139] Among them, Figure 7 As shown, the sub-image construction module 3 includes an original image resolution acquisition unit 31 and a sub-image resolution calculation unit 32;

[0140] The original image resolution acquisition unit 31 is used to acquire the resolution of the original image;

[0141] The sub-image resolution calculation unit 32 is used to calculate the resolution of the image by the formula Get the resolution of each level of sub-image, where is the resolution of the i-th level sub-image, w is the width of the resolution of the original image, h is the height of the resolution of the original image, w i is the width of the resolution of the i-th level sub-image, h i is the height of the resolution of the i-th level sub-image, w i >m,h i >n, i is a positive integer, m and n are preset constants.

[0142] It should be noted that the sub-image resolution setting method is only given here as an example. In specific implementation, it can also be set according to other progressive methods or other function calculation methods, as long as it can achieve different resolution settings for different sub-images.

[0143] In this embodiment, before the subsequent image processing, the acquired image is subjected to dedistortion processing by calibrating the parameters of the shooting device, and all subsequent steps process the dedistorted image, see Figure 6 , the setting system also includes a device parameter acquisition module 6 and a de-distortion module 7;

[0144] The device parameter acquisition module 6 is used to acquire the device parameters of the shooting device that shoots the current image;

[0145] The dedistortion module 7 is used to perform dedistortion processing on the current image according to the device parameters;

[0146] Furthermore, the calculation module 4 is used to calculate the dedistorted current image.

[0147] In this embodiment, a multi-level sub-image is constructed based on the original image, and the target sub-image closest to the current image is found by calculating the reprojection error between the sub-image and the current image. Then, the resolution of the target sub-image is set to the recognition resolution of the current image. In the picture recognition and tracking scenario, a more accurate recognition resolution setting can ensure higher image recognition efficiency and accuracy.

[0148] Example 7

[0149] The system for setting the recognition resolution in the picture recognition tracking scenario of this embodiment is further improved on the basis of the embodiment 6. Figure 8 As shown, the calculation module 4 includes a descriptor generating unit 41, a matching feature point acquiring unit 42, a rotation and translation parameter calculating unit 43 and a first conversion unit 44;

[0150] The descriptor generating unit 41 is used to extract feature points from the sub-images of each level and the current image respectively, and generate descriptors corresponding to the respective feature points;

[0151] The matching feature point acquisition unit 42 is used to calculate the similarity between the descriptor of each level of sub-image and the descriptor of the current image based on an approximate neighbor algorithm, and use the feature point pairs corresponding to the descriptor pairs with a similarity higher than a preset threshold as matching feature points; the matching feature points include a one-to-one corresponding first matching feature point in each level of sub-image and a second matching feature point in the current image; wherein, the similarity calculation of the descriptors can be performed using the Hamming distance, and when there are many descriptors, an approximate method such as FLANN (fast nearest neighbor algorithm for high-dimensional data) can be used for matching calculations.

[0152] The rotation and translation parameter calculation unit 43 is used to obtain the rotation and translation parameters of the current image coordinate system relative to the sub-image coordinate system of each level based on the first position data of the first matching feature point in the sub-image of each level and the second position data of the second matching feature point in the current image based on the PNP algorithm;

[0153] The first conversion unit 44 is used to obtain the third position data of all the first matching feature points converted into the current image coordinate system according to the rotation and translation parameters;

[0154] The calculation module 4 is used to calculate the reprojection error according to the second position data and the third position data.

[0155] In this embodiment, the setting system solves the reprojection error according to the following formula, specifically including:

[0156]

[0157] Among them, Loss i is the reprojection error of the i-th level sub-image, S i is the i-th level sub-image, C is the current image, is the third position data of the kth first matching feature point in the i-th level sub-image, is the second position data of the kth second matching feature point in the current image, K i is the number of matching feature points between the i-th level sub-image and the current image.

[0158] In this embodiment, after calculating the matching of the descriptors, we now obtain the matching results of the two images (including multiple matching feature points). By calculating the rotation and translation parameters, the matching feature points in the sub-image are mapped to the current image coordinate system (i.e., the camera coordinate system), and then the average error of all corresponding feature points is taken as our error term. Different errors can be obtained for different sub-images, and the target sub-image with the smallest error is selected as the image closest to the current image. Then, when the recognition resolution of the current image is set, the resolution of the target sub-image can be set as the recognition resolution.

[0159] Example 8

[0160] The method for setting the recognition resolution in the picture recognition and tracking scenario of this embodiment is further improved on the basis of Embodiment 2. If the spacing between different levels of sub-images is too large, after obtaining the target sub-image through the above system, it is still necessary to accurately calculate and recognize the closer recognition resolution of the current image, such as Fig. 9 As shown, the recognition resolution acquisition module 5 includes a second conversion unit 51 and an intersection area acquisition unit 52;

[0161] The second conversion unit 51 is used to obtain the projection area of ​​the target sub-image converted to the current image coordinate system according to the rotation and translation parameters of the target sub-image;

[0162] The intersection area acquisition unit 52 is used to acquire the intersection area between the current image and the projection area;

[0163] The recognition resolution acquisition module 5 is used to obtain the recognition resolution of the current image according to the physical area of ​​the intersection area and the number of pixels in the intersection area.

[0164] It should be noted that after obtaining the projection area of ​​the target sub-image converted to the current image coordinate system, it is necessary to calculate how many pixels the projection area occupies in the current image. Note that the effective pixels are calculated here, that is, the pixels belonging to the projection area among all the pixels in the current image. Specifically, according to the properties of perspective projection, the quadrilateral of the target sub-image is still a quadrilateral in the plane of the current image. At this time, the pixels in the polygon occupied by the intersection of this quadrilateral and the current image plane are the pixels of interest that we need to calculate. Secondly, we need to calculate the actual physical area of ​​the intersection area of ​​interest. We reproject the intersection area back to the target sub-image plane and use the same method to determine the intersection of the polygons to obtain the actual physical area. Through the above two steps of calculation, we get the actual physical area and the number of pixels of the intersection area. Here we only briefly explain the calculation method. The specific principles and calculation formulas refer to the existing projective geometry algorithms.

[0165] After obtaining the physical area of ​​the intersection area and the number of pixels in the intersection area, the recognition resolution acquisition module 5 is used to solve the recognition resolution according to the following formula:

[0166] R {C} =w {C} *h {C}

[0167]

[0168] Among them, R {C} is the recognition resolution of the current image, w {C} is the width of the recognition resolution of the current image, h {C} is the high recognition resolution of the current image, Q S is the physical area of ​​the original image, w is the width of the resolution of the original image, h is the height of the resolution of the original image, Q J is the physical area of ​​the intersection area, and T is the number of pixels in the intersection area.

[0169] In this embodiment, after acquiring the target sub-image, a more accurate recognition resolution can be further obtained after obtaining the physical area of ​​the intersection region and the number of pixels in the intersection region based on projective geometry.

[0170] Although the specific embodiments of the present invention are described above, it should be understood by those skilled in the art that this is only for illustration and the protection scope of the present invention is defined by the appended claims. Those skilled in the art may make various changes or modifications to these embodiments without departing from the principles and essence of the present invention, but these changes and modifications all fall within the protection scope of the present invention.

Claims

1. A method for setting recognition resolution in an image recognition and tracking scenario, characterized in that: The setting method comprises: Get the current image of the object to be identified; Acquire an original image; the original image corresponds to the object to be identified in the acquired current image; Constructing a multi-level sub-image based on the original image, wherein the physical size of the sub-image is the same as the physical size of the original image, and the resolution of each level of the sub-image is different; Respectively calculating the reprojection error between each level of sub-image and the current image; The resolution of the target sub-image corresponding to the minimum reprojection error is used as the recognition resolution of the current image; the recognition resolution is used to track and recognize the current image.

2. The method for setting the recognition resolution in the image recognition and tracking scenario according to claim 1, characterized in that: The step of respectively calculating the reprojection errors between each level of sub-image and the current image specifically includes: Extracting feature points from each level of sub-image and the current image respectively, and generating descriptors corresponding to the respective feature points; Calculating the similarity between the descriptor of each level of sub-image and the descriptor of the current image based on an approximate neighbor algorithm, and taking the feature point pairs corresponding to the descriptor pairs with a similarity higher than a preset threshold as matching feature points; the matching feature points include the first matching feature points in each level of sub-image and the second matching feature points in the current image in one-to-one correspondence; Obtaining rotation and translation parameters of the current image coordinate system relative to the sub-image coordinate system of each level based on the first position data of the first matching feature point in the sub-image of each level and the second position data of the second matching feature point in the current image based on the PNP algorithm; Obtaining third position data of all first matching feature points converted into the current image coordinate system according to the rotation and translation parameters; The reprojection error is calculated based on the second position data and the third position data.

3. The method for setting the recognition resolution in the image recognition and tracking scenario according to claim 2, characterized in that: The setting method solves the reprojection error according to the following formula, specifically including: Among them, Loss i is the reprojection error of the i-th level sub-image, S i is the i-th level sub-image, C is the current image, is the third position data of the kth first matching feature point in the i-th level sub-image, is the second position data of the kth second matching feature point in the current image, K i is the number of matching feature points between the i-th level sub-image and the current image.

4. The method for setting the recognition resolution in the image recognition and tracking scenario according to claim 2, characterized in that: The step of using the resolution of the sub-image corresponding to the minimum reprojection error as the recognition resolution of the current image specifically includes: Acquire a projection area of ​​the target sub-image converted to the current image coordinate system according to the rotation and translation parameters of the target sub-image; Acquire the intersection area of ​​the current image and the projection area; The recognition resolution of the current image is obtained according to the physical area of ​​the intersection area and the number of pixels in the intersection area.

5. The method for setting the recognition resolution in the image recognition and tracking scenario according to claim 4, characterized in that: In the step of obtaining the recognition resolution of the current image according to the physical size of the intersection area and the number of pixels in the intersection area, the recognition resolution is solved according to the following formula: R {C} =w {C} *h {C} Among them, R {C} is the recognition resolution of the current image, w {C} is the width of the recognition resolution of the current image, h {C} is the high recognition resolution of the current image, Q S is the physical area of ​​the original image, w is the width of the resolution of the original image, h is the height of the resolution of the original image, Q J is the physical area of ​​the intersection area, and T is the number of pixels in the intersection area.

6. The method for setting the recognition resolution in the image recognition and tracking scenario according to claim 1, characterized in that: The step of constructing a multi-level sub-image based on the original image specifically includes: Acquire the resolution of the original image; By formula Get the resolution of each level of sub-image, where is the resolution of the i-th level sub-image, w is the width of the resolution of the original image, h is the height of the resolution of the original image, w i is the width of the resolution of the i-th level sub-image, h i is the height of the resolution of the i-th level sub-image, w i >m,h i >n, i is a positive integer, m and n are preset constants.

7. The method for setting the recognition resolution in the image recognition and tracking scenario according to claim 1, characterized in that: After the step of acquiring the current image of the object to be identified, the setting method further includes: Obtaining device parameters of a shooting device used to shoot the current image; Performing dedistortion processing on the current image according to the device parameters; In the step of respectively calculating the reprojection errors between each level of sub-image and the current image, the dedistorted current image is calculated.

8. An electronic device 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 setting the recognition resolution in the image recognition and tracking scenario according to any one of claims 1 to 7 is implemented.

9. A computer-readable storage medium having a computer program stored thereon, characterized in that: When the program is executed by a processor, the steps of the method for setting the recognition resolution in the image recognition and tracking scenario described in any one of claims 1 to 7 are implemented.

10. A system for setting recognition resolution in an image recognition and tracking scenario, characterized in that: The setting system includes a current image acquisition module, an original image acquisition module, a sub-image construction module, a calculation module, an identification resolution acquisition module and a tracking and identification module; The current image acquisition module is used to acquire the current image of the object to be identified; The original image acquisition module is used to acquire an original image; the original image corresponds to the object to be identified in the acquired current image; The sub-image construction module is used to construct a multi-level sub-image based on the original image, the physical size of the sub-image is the same as the physical size of the original image, and the resolution of each level of sub-image is different; The calculation module is used to respectively calculate the reprojection error between each level of sub-image and the current image; The recognition resolution acquisition module is used to use the resolution of the target sub-image corresponding to the minimum reprojection error as the recognition resolution of the current image; the recognition resolution is used to track and recognize the current image.

Citation Information

Patent Citations

  • Super-resolution image restoration method in gait recognition

    CN101551903A

  • Super-resolution processing method for face image

    CN108320267A