Method and device for object recognition based on image processing
By ensuring that the scale of the object to be identified and the comparison object is the same in image recognition technology and using a correction function to correct the eigenvalues, the problem of misjudgment caused by changes in focal length and shooting distance is solved, and higher object recognition accuracy is achieved.
Patent Information
- Application Number
- CN201811010868.4
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2018-08-31
- Publication Date
- 2025-09-05
- Estimated Expiration
- 2038-08-31
AI Technical Summary
In existing image recognition technology, the image size changes caused by the non-fixed focal length and shooting distance result in low object recognition accuracy and high misjudgment rate.
By obtaining images of the object to be identified and the comparison object, ensuring that their scaling ratios are the same, and using a convolutional neural network to detect eigenvalues, a correction function is used to correct the eigenvalues to standard eigenvalues for comparison and identification.
The accuracy of object recognition is improved, and the shape and size of objects can be accurately matched, reducing misjudgments.
Smart Images

Figure CN109508623B_ABST
Abstract
Description
Technical Field
[0001] The embodiments of the present invention relate to the field of image recognition technology, and in particular to an object recognition method and device based on image processing. Background Art
[0002] In existing image recognition technology, the analysis of the input image during the image recognition process usually only involves feature extraction and feature comparison, such as extracting image features from the input image and then comparing the image features with the features of known objects for recognition.
[0003] Text recognition, face recognition, and object recognition are all typical and widely used examples of image recognition technology. Taking object recognition as an example, this technology extracts the object's feature values and compares them with those in a database to identify the object. For example, you can use an image of an object to search for similar items on an online platform.
[0004] However, existing technologies often result in misjudgments and inaccurate results. For example, the inventors discovered that a major cause of misjudgment is the inconsistency of the focal length and / or shooting distance used to capture the object to be identified. This can result in images of the same object of varying sizes at different focal lengths and / or shooting distances. This can lead to two problems: First, the same object can be misjudged as different objects due to different image sizes due to different shooting focal lengths or distances. Second, two or more objects with similar surface features but significantly different actual sizes may appear to have similar sizes at different focal lengths or shooting distances, leading to misjudgment as identical or similar objects.
[0005] Existing object recognition technology results in low recognition accuracy. Summary of the Invention
[0006] The purpose of the embodiments of the present invention is to provide an object recognition method and device based on image processing, which can improve the accuracy of object recognition.
[0007] The technical solutions adopted in the embodiments of the present invention are as follows:
[0008] An embodiment of the present invention provides an object recognition method based on image processing, comprising:
[0009] Acquire images of the object to be identified and the comparison object, wherein the scaling ratio of the image of the object to be identified and the actual object to be identified is the same as the scaling ratio of the image of the comparison object and the actual object to be identified, and the size of the comparison object can be known; detect the comparison object and the object to be identified from the image, and extract the first eigenvalue of the comparison object, and extract the second eigenvalue of the object to be identified; correct the first eigenvalue to a first standard eigenvalue, the first standard eigenvalue is obtainable, and determine a first correction function for correcting the first eigenvalue to the first standard eigenvalue; correct the second eigenvalue of the object to be identified according to the first correction function to obtain a third eigenvalue; compare the third eigenvalue with the fourth eigenvalue of each object image in the database, identify the object to be identified according to the comparison result, and the fourth eigenvalue is obtained after pre-correction.
[0010] Another embodiment of the present invention provides an object recognition method based on image processing, wherein obtaining a first standard feature value includes:
[0011] Acquire an image of the comparison object; scale the comparison object image and the comparison object at a first preset scaling ratio; and acquire a corrected image feature value as a first standard feature value of the comparison object.
[0012] Another embodiment of the present invention provides an object recognition method based on image processing, wherein the fourth eigenvalue of the object image in the database obtained through pre-correction includes:
[0013] Detecting an object and a comparison object from an image in a database, extracting a fifth eigenvalue of the comparison object, and extracting a sixth eigenvalue of the object; correcting the fifth eigenvalue until the image of the comparison object and the actual comparison object have a second preset scaling ratio after correction, and determining a second correction function for correcting the image corresponding to the fifth eigenvalue to the second preset scaling ratio; and correcting the sixth eigenvalue according to the second correction function to obtain a fourth eigenvalue.
[0014] Another embodiment of the present invention provides an object recognition method based on image processing, wherein detecting a comparison object and an object to be recognized from an image includes:
[0015] The image is divided into regions, and the features of the object to be identified and the comparison items extracted by the convolutional neural network are used to classify and score each region. Based on the classification and scoring of each region, the scores, location information and sizes of the object to be identified and the comparison items are obtained respectively.
[0016] Another embodiment of the present invention provides an object recognition method based on image processing, which compares a third feature value with a fourth feature value of each object image stored in a database, and identifies the object to be recognized based on the comparison result, including:
[0017] Determining the similarity between the object to be identified and the images of each object stored in the database based on the comparison results of the third eigenvalue and the fourth eigenvalue;
[0018] Sort the items in the database in descending order according to their similarity to the items to be identified.
[0019] In this embodiment, the similarity between the object to be identified and the objects stored in the database is calculated by comparing the third feature value and the third feature value. The objects in the database are then sorted in descending order of similarity to the object to be identified. The images of the objects with the highest similarity to the object to be identified are placed first, allowing the user to clearly identify the objects in the database with the highest similarity to the object to be identified. Images of other objects with high similarity can also be obtained, facilitating further screening and judgment by the user.
[0020] Another embodiment of the present invention provides an object recognition device based on image processing, comprising:
[0021] An image acquisition module is used to acquire images of the object to be identified and the comparison object, wherein the image acquisition module is used to acquire images of the object to be identified and the comparison object, wherein the scaling ratio of the image of the object to be identified and the actual object to be identified is the same as the scaling ratio of the image of the comparison object and the actual object to be identified, and the size of the comparison object can be known; a detection module is used to detect the comparison object and the object to be identified from the image; a feature extraction module is used to extract the first feature value of the comparison object and the second feature value of the object to be identified; a correction module is used to correct the first feature value to a first standard feature value; and, correct the second feature value to a third feature value; a comparison and identification module is used to compare the third feature value with the fourth feature value of each object image in the database, and identify the object to be identified based on the comparison result, and the fourth feature value of the object image in the database is pre-corrected by the correction module.
[0022] Another embodiment of the present invention provides an object identification device based on image processing, wherein the correction module is further used to scale the comparison object image obtained by the image acquisition module at a first preset ratio; the feature extraction module is further used to obtain the feature value of the comparison object image scaled by the correction module at the first preset ratio as the first standard feature value of the comparison object.
[0023] Another embodiment of the present invention provides an object identification device based on image processing, wherein the detection module is also used to detect objects and compare objects from each image in the database; the feature extraction module is also used to extract the fifth feature value of the comparison object and the sixth feature value of the object; the correction module is also used to correct the fifth feature value so that after correction, the comparison object image and the comparison object are at a second preset scaling ratio; and the sixth feature value is corrected by a second correction function to obtain a fourth feature value.
[0024] Another embodiment of the present invention provides an object recognition device based on image processing, wherein the comparison and recognition module includes:
[0025] a similarity determination unit, configured to determine the similarity between the object to be identified and each object image stored in the database based on a comparison result of the third eigenvalue and the fourth eigenvalue;
[0026] The sorting unit is used to sort the items in the database in descending order according to their similarity to the items to be identified.
[0027] The technical solution of the embodiment of the present invention has the following advantages:
[0028] In an embodiment of the present application, the image of the comparison object is corrected to a standard characteristic value, and then the object to be identified is corrected using the same correction method. The corrected characteristic value of the object to be identified is compared with the characteristic value of the object in the database. Since the image of the object to be identified and the comparison object have the same scaling ratio, and the size of the comparison object can be known, the size of the object to be identified can be determined through the embodiment of the present invention. When compared with the characteristic values of each object in the database, not only the shape of the object can be matched, but also the size of the object can be accurately matched, thereby greatly improving the accuracy of identifying the object. BRIEF DESCRIPTION OF THE DRAWINGS
[0029] In order to more clearly illustrate the embodiments of the present invention or the technical solutions in the prior art, the following is a brief introduction to the drawings required for use in the embodiments or the description of the prior art. 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 any creative work.
[0030] Figure 1 This is a flow chart of an embodiment of an object recognition method based on image processing according to the present invention;
[0031] Figure 2 This is a flow chart of another embodiment of the object recognition method based on image processing according to the present invention;
[0032] Figure 3 This is a flow chart of another embodiment of the object recognition method based on image processing according to the present invention;
[0033] Figure 4 This is a schematic structural diagram of an embodiment of an object recognition device based on image processing according to the present invention;
[0034] Figure 5 This is a schematic structural diagram of another embodiment of an object recognition device based on image processing according to the present invention;
[0035] Figure 6This is a specific example flow chart of the object recognition method based on image processing in this application. DETAILED DESCRIPTION
[0036] To make the objectives, technical solutions, and advantages of the embodiments of the present invention more clear, the technical solutions in the embodiments of the present invention will be clearly and completely described below in conjunction with the accompanying drawings of the embodiments of the present invention. Obviously, the described embodiments are only part of the embodiments of the present invention, not all of the embodiments. All other embodiments obtained by ordinary technicians in this field based on the embodiments of the present invention without making any creative efforts shall fall within the scope of protection of the present invention.
[0037] During their research and development, the inventors discovered that existing object recognition systems using photography or video often result in misjudgments. This is because the same object appears different in size in images or videos at different focal lengths or shooting distances. Existing technology can only detect objects but cannot measure their actual size, leading to misjudgments.
[0038] To solve the above problems, the inventors of this application have adopted a variety of methods. For example, a convolutional neural network model is used to detect the objects to be identified, and the detected objects are enlarged or reduced by multiples to generate several sets of objects of different sizes. The sets of objects of different sizes are substituted into a computer deep learning model to convert them into feature codes. By comparing the feature codes, the similarity of different objects is calculated.
[0039] However, when these object sets are substituted into the computer deep learning model, a large amount of calculation will be generated, which wastes a huge amount of computing power. At the same time, if there are objects with large differences in actual size but similar surface features, the above calculation results will still consider the objects to be highly similar, reducing the accuracy of the judgment.
[0040] Figure 1 This is a flow chart of an embodiment of the object recognition method based on image processing of the present invention. Figure 1 As shown, the object recognition method based on image processing of the present invention includes:
[0041] Step 110: Acquire images of the object to be identified and the comparison object, wherein the scale ratio of the image of the object to be identified and the actual object to be identified is the same as the scale ratio of the image of the comparison object and the actual object to be compared, and the size of the comparison object can be known;
[0042] In this step, images of the object to be identified and the comparison object are obtained, wherein the scaling ratio of the image of the object to be identified and the actual object to be identified is the same as the scaling ratio of the image of the comparison object and the actual object to be compared.
[0043] It is understood that in this application, the scaling ratio between an image and an object refers to the proportional relationship between the image size and the actual size of the object. Whether zoomed in or out, the image is zoomed in or out in the same ratio in length and width, that is, only the image size is changed, and the ratio of the original image is maintained in terms of the aspect ratio of the image. Among them, the image size is the size of the image. According to the prior art, the length and width of the image size can be in pixels or in length units, such as centimeters. When the image size is in pixels, it is necessary to determine the image size in combination with the resolution, where the resolution is related to the distance between pixels.
[0044] It is worth noting that it is not necessary to have the same scaling ratio, as long as the scaling ratios of the two are known, when the scaling ratios of the two are inconsistent, the ratios can be adjusted to be the same by scaling to facilitate comparison. In the embodiments of the present application, for convenience of explanation, the same scaling ratio is used as an example.
[0045] It's understandable that for the same object, different subject distances and focal lengths will result in different image scaling. For example, for the same object, at the same focal length, the size of the object image will vary with the shooting distance. The farther the shooting distance, the smaller the object image; the closer the shooting distance, the larger the object image. Even for the same subject distance, different focal lengths also affect the size of the object image: a smaller focal length results in a smaller object image, while a larger focal length results in a larger object image.
[0046] To obtain images of the object to be identified and the comparison object with the same zoom ratio, various methods of the prior art can be used, and the embodiments of the present invention do not impose specific restrictions. For example, the images can be taken at the same object distance and focal length; the object distance and focal length can be different, but the same zoom ratio can be formed; the images can be taken at the same time; or the images can be taken twice under the same shooting conditions. The specific shooting conditions can be defined by the prior art, and can include but are not limited to: shooting distance and shooting focal length. In addition, the shooting conditions can further include shooting angle, light reflection and shadow, etc. Among them, the shooting distance and shooting focal length can affect the imaging zoom ratio, while the shooting angle, light reflection and shadow do not affect the imaging zoom ratio. Different shooting angles will cause different trapezoidal distortions, and reflections will cause uneven brightness and darkness. The same shooting conditions here can include being exactly the same, or being within the allowable error range.
[0047] In this step, the images of the object to be identified and the comparison object can be obtained from different images or from the same image, and this application does not impose any restrictions on this.
[0048] Step 120: Detecting the comparison object and the object to be identified from the image, extracting a first feature value of the comparison object, and extracting a second feature value of the object to be identified;
[0049] In this step, the comparison object and the object to be identified are detected in the image acquired in step 110. This detection can be performed using existing methods, such as a convolutional neural network, or a convolutional neural network combined with a fully connected neural network. Specifically, the two objects are detected using existing techniques, and feature values of the two object images are extracted, respectively: a first feature value of the comparison object, and a second feature value of the object to be identified. It is understood that the feature values here can specifically be feature codes. For example, an image can be input into a convolutional neural network to generate a feature map, which in turn generates a feature code. The specific method for extracting the feature values of the objects can also be based on existing techniques and is not limited in this application.
[0050] Step 130: Correct the first eigenvalue to a first standard eigenvalue, the first standard eigenvalue being available, and determine a first correction function for correcting the first eigenvalue to the first standard eigenvalue;
[0051] The first characteristic value of the comparison item extracted in step 120 is calibrated to a preset first standard characteristic value, which is a preset known quantity. Since the first characteristic value of the comparison item is extracted in step 120, the preset first standard characteristic value is a known quantity. The first calibration function can be determined using the known first characteristic value and the preset known first standard characteristic value.
[0052] In an embodiment of the present invention, the first standard feature value is pre-set and corresponds to an image of the comparison object at a preset scale. Specifically, the first standard feature value may be a feature value of an image of the comparison object captured at a specific shooting distance and focal length; alternatively, the first standard feature value may be a feature value of an image of the comparison object captured at a non-specific shooting distance and focal length, scaling the image so that the scaled image and the actual size of the object meet a preset scale ratio. This invention is not limited to this.
[0053] In the embodiment of the present application, the preset scaling ratio can be 1:1, i.e., the size of the comparison object in the image is the same as the actual size of the comparison object. Alternatively, it can be another specific ratio, such as 2:1, where the size of the comparison object in the image is twice the actual size of the comparison object. In the embodiment of the present application, the scaling ratio is only required to be known, and there is no specific limitation on the scaling ratio, such as being pre-set. It is understood that the first standard feature value can be pre-stored or obtained when needed.
[0054] In this step, the first characteristic value of the comparison item in step 120 is corrected by a first correction function to obtain a pre-set first standard characteristic value, wherein, since the first characteristic value of the comparison item and the first standard characteristic value of the comparison item are both known, the first correction function can be obtained by comparing the above-mentioned first standard characteristic value and the first characteristic value.
[0055] Step 140: Correct the second eigenvalue of the object to be identified according to the first correction function to obtain a third eigenvalue;
[0056] In this step, the image of the object to be identified is corrected using the same correction function as the image of the reference object. The image is scaled to the same scale as the reference object image, ensuring that the image has the same scale as the reference object image. Specifically, the second eigenvalue of the object to be identified is corrected using the first correction function to obtain a third eigenvalue. The scale of the image corresponding to this third eigenvalue is consistent with the scale of the first standard eigenvalue and the scale of the image generated by the first eigenvalue.
[0057] For example, when the first correction function corrects the first characteristic value of the comparison object to the first standard characteristic value, so that the image size after correction is the same as the actual size of the comparison object, then after the first correction function corrects the second characteristic value of the object to be identified, the size of the image of the object to be identified corresponding to the third characteristic value obtained is also consistent with the actual size of the object to be identified.
[0058] Step 150 , comparing the third eigenvalue with the fourth eigenvalue of each object image in the database, and identifying the object to be identified based on the comparison result, wherein the fourth eigenvalue is obtained through pre-calibration.
[0059] In this step, the third feature value of the object to be identified, corrected in step 140, is compared with the fourth feature value of each object image in the database. It should be understood that if the database contains at least one object image, this step may involve comparing the third feature value with the fourth feature value of each object image in the database until the object to be identified is found in the database, or until all objects in the database have been compared. For ease of explanation, this embodiment of the present invention will only illustrate the comparison between the third feature value of the object to be identified and the fourth feature value of an object image in the database.
[0060] In this embodiment of the present invention, the image of the object to be identified corresponding to the third eigenvalue has a known scale relationship with the actual object to be identified. Furthermore, the object image in the database has been pre-calibrated, and the calibrated image also has a known scale relationship with the actual object. By comparing the eigenvalues of these two calibrated images, which have a known scale relationship with the actual object, it is possible to determine whether the shape and pattern of the object to be identified and the object in the database are consistent, and accurately determine whether their sizes are consistent, without scaling or other adjustments. This allows the object to be identified to be accurately located in the database based on its shape, pattern, and size.
[0061] For example, when the size of the object to be identified in the image corresponding to the corrected third eigenvalue is the same as the actual object to be identified, and the size of the image corresponding to the fourth eigenvalue of the object image in the database is also the same as the actual size of the object, since the image sizes corresponding to the two eigenvalues are the same size as their respective real objects, the misjudgment caused by the different scaling ratios between the image and the real object is reduced.
[0062] Furthermore, there's no need to process the eigenvalues to ensure that the object being identified and the items in the database are scaled to the same scale as their respective physical counterparts. For example, the first eigenvalue of the object being identified might need to be scaled up or down by multiple times before being compared with the fourth eigenvalue of the object in the database. Alternatively, the first eigenvalue of the object being identified might need to be scaled up or down by multiple times, and the fourth eigenvalue of the object in the database might need to be scaled up or down before being compared. These approaches increase the amount of computation and complexity, and reduce the accuracy of the judgment.
[0063] Of course, in the embodiments of the present application, the third and fourth eigenvalues are not limited to ensuring that the size of the object in the corrected image is the same as the actual object, and can also be other preset ratios. For example, the scaling ratio of the third eigenvalue for the object to be identified is consistent with the scaling ratio of the fourth eigenvalue for the object in the database, but the scaling ratio is not 1:1. In this case, since the scaling ratios of the two eigenvalues are consistent, the size of the object to be identified can still be accurately determined when comparing the images.
[0064] Furthermore, the scaling ratio of the third eigenvalue for the item to be identified may be inconsistent with the scaling ratio of the fourth eigenvalue for the item in the database. Since the scaling ratios of the two are known in this application, when the scaling ratios of the two are inconsistent, in actual applications, the image can be scaled so that the scaling ratio of the image size of the item to be identified corresponding to the third eigenvalue and the actual size of the item to be identified is consistent with the scaling ratio of the image size of the item in the database corresponding to the fourth eigenvalue and the actual size of the item; or, before comparison, the eigenvalues can be corrected according to different pre-set ratios so that the scaling ratios of the two are consistent before comparison. There are many ways to select specific values that can achieve the same effect, and no application or limitation is made in this regard.
[0065] In this embodiment, by introducing a comparison object, the image feature value of the comparison object is corrected to the first standard feature value so that there is a certain scaling relationship between the image of the comparison object and the actual size of the comparison object after correction. The same correction function is used to correct the image of the object to be identified so that there is also the same scaling relationship between the image of the object to be identified and the actual object. The corrected feature value is compared with the fourth feature value of the object in the database. Since the fourth feature value is also corrected and has a certain scaling ratio relationship with the object, by comparing the third feature value and the fourth feature value, not only the pattern shape of the object to be identified can be identified, but also the size of the identified object can be obtained. Combined with the comparison of the size of the object to be identified and the object in the database image, the object to be identified can be identified more accurately.
[0066] Furthermore, in an embodiment of the present invention, the comparison items are items with standard shapes, patterns and sizes.
[0067] In embodiments of the present application, a standard object can be used as a comparison object for the object to be identified. Since the scale ratio is the same, as long as the dimensions of the standard object are known in advance, the dimensions of the object to be identified can be determined through comparison. When the standard object is an object with standard dimensions, its dimensions, and even its shape and pattern, can be more easily determined. For example, the standard object can be a coin. Since the size, shape, and pattern of coins of a specific denomination are always fixed, accurate information about the standard object can be obtained in practical applications. The standard object can also be a bottle cap, credit card, ID card, or various models of mobile phones. For example, bank cards or credit cards have uniform dimensions. For another example, the dimensions and shape of a certain model of mobile phone are also uniform and readily available. When selecting a standard object, one can choose a single, regular shape, such as a standard circle, square, rectangle, or triangle; another can choose a combination of single, regular shapes; or an irregularly shaped object.
[0068] It is worth noting that having fixed standards for shape, pattern and size of the comparison objects is only an optional embodiment of the present application. In actual applications, the standard object can be any object as long as its size and shape can be known and determined. The standard object is only to ensure that the scaling ratio between the third characteristic value and the actual size of the object to be identified can be known.
[0069] In the embodiments of the present application, the items to be identified can be various items, for example, flat items or three-dimensional objects. When the item to be identified is a flat object and only one side needs to be identified, then this side is identified. When both sides of the flat object need to be identified, then both sides can be identified separately. When the item to be identified is a three-dimensional object, each side of the three-dimensional object can be identified separately. For example, the six sides of the object can be identified separately, or only the required sides can be identified as needed. Any item to be identified can be identified using the identification method of the present application. For specific identification methods, please refer to the identification methods in the embodiments of the present application.
[0070] Since the objects to be identified may come from various data platforms or from different users, in this embodiment, standard objects with fixed standards in shape, pattern and size are easier to obtain, which can make the implementation of the present application method more convenient.
[0071] Figure 2 This is a flow chart of another embodiment of the object recognition method based on image processing of the present invention. Figure 2 As shown, the object recognition method based on image processing of the present invention includes:
[0072] Step 210, obtaining a comparison object image;
[0073] In this step, images of the comparison objects may be obtained using existing methods.
[0074] Step 220, correcting the image so that the comparison object image and the comparison object are scaled at a first preset scaling ratio;
[0075] In this step, the image of the comparison object obtained in step 210 is scaled so that the comparison object image and the actual comparison object are scaled at a first preset scaling ratio. The first preset scaling ratio can be set arbitrarily, for example, 1:1, 2:1, 1:2, or other non-integer ratios, and is not limited to the embodiments of the present application, and can achieve the purpose of the invention. In the following embodiments, for the sake of simplicity, a scaling ratio of 1:1 will be used as an example. As for other scaling ratios, the corresponding operations on the image feature values can be performed, and no further details will be given here.
[0076] Specifically, when a 1:1 scaling ratio is used, the size of the comparison object image obtained after scaling is the same as the actual size of the comparison object. For example, if the comparison object is a square standard object with a side length of 0.5 cm, and if the comparison object image obtained in step 210 is 100 pixels and each pixel represents 0.1 cm, the image size is 1*1 cm. 2 , to reduce the image to the same size as the real object, that is, 0.5*0.5cm 2 Size can be reduced in two ways: Method 1: Reduce the size of the image by reducing the number of pixels. For example, reduce the comparison object image to 25 pixels, each pixel represents 0.1cm, and the comparison object image obtained after reduction is 0.5*0.5cm 2 Size; Method 2: Keep the number of pixels of the image unchanged, still 100 pixels, each pixel represents 0.05cm, and reduce the image size to 0.5*0.5cm 2 Both reduction methods can obtain an image size that is the same as the actual size. The resolution of the image using different scaling methods will be different. The specific method used for reduction or enlargement can be determined according to actual needs and will not be elaborated in this application.
[0077] Step 230: Obtain the corrected image feature value as the first standard feature value of the comparison object.
[0078] Extracting feature values from the corrected image in step 220. The specific method for extracting feature values can be performed using existing techniques and is not limited in this application. In step 220, the image is scaled to a 1:1 ratio between the image and the actual object size. The size of the comparison object image corresponding to the first standard feature value is the actual size of the comparison object.
[0079] Step 240: Acquire images of the object to be identified and the comparison object, wherein the scale ratio of the image of the object to be identified and the actual object to be identified is the same as the scale ratio of the image of the comparison object and the actual object to be compared, and the size of the comparison object can be known;
[0080] The specific steps of obtaining the images of the object to be identified and the comparison object in this step can be found in Figure 1 This corresponds to step 110 of the embodiment.
[0081] Step 250: Detecting the comparison object and the object to be identified from the image, extracting a first feature value of the comparison object, and extracting a second feature value of the object to be identified;
[0082] In this step, the comparison object and the object to be identified are detected from the image, and the first feature value of the comparison object and the second feature value of the object to be identified are extracted. Figure 1 This corresponds to step 120 of the embodiment.
[0083] Step 260: Correct the first eigenvalue to a first standard eigenvalue, the first standard eigenvalue being known, and determine a first correction function for correcting the first eigenvalue to the first standard eigenvalue;
[0084] The specific steps of correcting the extracted first characteristic value of the comparison object to the first standard characteristic value that can be known by using the first correction function in this step can be found in Figure 1 The corresponding embodiment is step 130. It can be understood that, in this embodiment, the size of the comparison object image corresponding to the first standard feature value is the actual size of the comparison object.
[0085] Step 270: Correct the second eigenvalue of the object to be identified according to the first correction function to obtain a third eigenvalue;
[0086] The specific steps of correcting the second eigenvalue of the object to be identified by the first correction function to obtain the third eigenvalue can be found in Figure 1 Corresponding to step 140 of the embodiment. Since the comparison object image obtained through correction in step 260 is an image of the same size as the actual comparison object, the image of the object to be identified obtained in step 240 and having the same scale as the comparison object is corrected by the first correction function, and the image corresponding to the obtained characteristic value is also an image of the same size as the actual object to be identified.
[0087] Step 280 , comparing the third eigenvalue with the fourth eigenvalue of each object image in the database, and identifying the object to be identified based on the comparison result, wherein the fourth eigenvalue is obtained through pre-calibration.
[0088] In this step, the third eigenvalue is compared with the fourth eigenvalue of the object image in the database, and the object to be identified is identified based on the comparison result. The fourth eigenvalue of the object image in the database is obtained after pre-calibration. For specific steps, please refer to Figure 1 In step 150 of the corresponding embodiment, taking the case where the image corresponding to the third eigenvalue is the same size as the actual size of the object to be identified, i.e., the scale ratio is 1:1, as an example, since the fourth eigenvalue is also obtained through pre-calibration, assuming that the size of the object image in the database corresponding to the fourth eigenvalue is the same as the actual size of the object in the database, and the scale ratio is also 1:1, by comparing the third eigenvalue and the fourth eigenvalue, it is possible to accurately determine whether the two are the same object.
[0089] As another implementation, the image corresponding to the fourth eigenvalue may have a scaling ratio other than 1:1. In this case, the image may be rescaled to 1:1, or the image of the object to be identified may be scaled and the scaling ratio adjusted to be consistent with the scaling ratio of the object images in the database. This application is not limited to this. Scaling correction of the image may be implemented in accordance with existing methods. For simplicity, this embodiment of the application uses a 1:1 scaling ratio for illustration.
[0090] In the embodiments of the present application, by presetting a first standard feature value for comparing an object and determining the image-to-object scaling ratio corresponding to that feature value, it is easier to determine the size of the object to be identified. Furthermore, presetting the first standard feature allows for immediate comparison when an image needs to be identified, thereby improving the efficiency of the device.
[0091] Figure 3 This is a flow chart of another embodiment of the object recognition method based on image processing of the present invention. Figure 3 As shown, the object recognition method based on image processing of the present invention includes:
[0092] Step 310: Detecting the object and the comparison object from the image in the database, and extracting the fifth feature value of the comparison object and the sixth feature value of the object;
[0093] In this step, objects are detected and compared from the images in the database. The specific implementation can adopt existing detection methods. At the same time, the fifth characteristic value of the compared object and the sixth characteristic value of the extracted object can also be extracted using existing methods.
[0094] In this embodiment, the same original image stored in the database includes an image of an object in the database and an image of a comparison object. Alternatively, the object in the database and the comparison object may be images of separate images, as long as the image and the object have the same scaling ratio. It is worth noting that having the same scaling ratio is not essential; as long as the scaling ratio of the two is known, it is sufficient. If the scaling ratios of the two are inconsistent, they can be adjusted to the same ratio through scaling to facilitate comparison. In the embodiments of this application, for ease of explanation, the same scaling ratio is used as an example.
[0095] Step 320: Correct the fifth eigenvalue until the corrected image of the object and the actual size of the object are at a second preset scale ratio, and determine a second correction function for correcting the image corresponding to the fifth eigenvalue to the second preset scale ratio.
[0096] In this step, the fifth characteristic value is corrected until the image of the object to be compared and the object to be compared are at a second preset scaling ratio. Figure 2The corresponding step 220 is performed. In this embodiment, since the second preset scaling ratio is known, the second correction function can be determined.
[0097] Step 330: Correct the sixth eigenvalue according to the second correction function to obtain a fourth eigenvalue.
[0098] The sixth eigenvalue is corrected by the second correction function to obtain the fourth eigenvalue, so that the object image in the database image is corrected to the same scaling ratio as the comparison object in the database image.
[0099] In this embodiment, steps 310 to 330 may be similar to Figure 1 Steps 110 to 140 in the corresponding embodiment are similar in that a standard object is used for comparison and a similar method is adopted. The difference is that the characteristic values of the objects in the database are corrected here.
[0100] For example, if the scaling ratio of the object in the database image is 1:1 in step 320, the scaling ratio of the object in the database image is also 1:1 in step 330. In this case, the size of the object image in the database corresponding to the fourth eigenvalue is the actual size of the object. When the corrected third eigenvalue of the object to be identified is subsequently compared with the fourth eigenvalue, assuming the third eigenvalue is obtained by scaling the image of the object to be identified to match its actual size, the third and fourth eigenvalues are theoretically identical or within the allowable error range, thus enabling accurate identification of the object to be identified.
[0101] Step 340, obtaining a comparison object image;
[0102] The specific steps for obtaining the comparison object image in this step can be found in Figure 2 This corresponds to step 210 of the embodiment.
[0103] Step 350 , correcting the image so that the comparison object image and the comparison object are scaled at a first preset scaling ratio;
[0104] In this step, the image is scaled so that the image of the comparison object and the actual comparison object are scaled at a first preset scaling ratio. For specific steps, see Figure 2 This corresponds to step 220 of the embodiment.
[0105] Step 360: Obtain the corrected image feature value as the first standard feature value of the comparison object.
[0106] The specific steps of obtaining the corrected image feature value as the first standard feature value of the comparison object in this step can be found in Figure 2 This corresponds to step 230 of the embodiment.
[0107] Step 370: Acquire images of the object to be identified and the comparison object, wherein the scale ratio of the image of the object to be identified and the actual object to be identified is the same as the scale ratio of the image of the comparison object and the actual object to be identified, and the size of the comparison object can be known;
[0108] The specific steps of obtaining the images of the object to be identified and the comparison object in this step can be found in Figure 1 This corresponds to step 110 of the embodiment.
[0109] Step 380: Detect the comparison object and the object to be identified from the image, extract the first feature value of the comparison object, and extract the second feature value of the object to be identified;
[0110] In this step, the comparison object and the object to be identified are detected from the image, and the first feature value of the comparison object and the second feature value of the object to be identified are extracted. Figure 1 This corresponds to step 120 of the embodiment.
[0111] Step 390: Correct the first eigenvalue to a first standard eigenvalue, the first standard eigenvalue being known, and determine a first correction function for correcting the first eigenvalue to the first standard eigenvalue;
[0112] The specific steps of correcting the extracted first characteristic value of the comparison object to the preset first standard characteristic value by using the first correction function in this step can be found in Figure 1 This corresponds to step 130 of the embodiment.
[0113] Step 400: Correcting the second eigenvalue of the object to be identified according to the first correction function to obtain a third eigenvalue;
[0114] The specific steps of correcting the second eigenvalue of the object to be identified by the first correction function to obtain the third eigenvalue can be found in Figure 1 This corresponds to step 140 of the embodiment.
[0115] Step 410 , comparing the third eigenvalue with the fourth eigenvalue of each object image in the database, and identifying the object to be identified based on the comparison result, wherein the fourth eigenvalue is obtained through pre-calibration.
[0116] In this step, the third eigenvalue is compared with the fourth eigenvalue of the object image in the database, and the object to be identified is identified based on the comparison result. The fourth eigenvalue of the object image in the database is obtained by pre-calibration. For the specific steps, please refer to Figure 1 This corresponds to step 150 of the embodiment.
[0117] In this embodiment, the image of the object in the database is also corrected to the preset size by the same scaling ratio as the comparison object image, and is compared with the object to be identified using the same comparison object. Since both the object to be identified and the object in the database are compared with the same comparison object, and the comparison object has a specific size, shape and pattern, the error caused by collecting different feature values of the comparison object is reduced, and the recognition accuracy is further improved.
[0118] Furthermore, in this embodiment, the second preset scaling ratio is the same as the first preset scaling ratio.
[0119] When the second preset scaling ratio is the same as the first preset scaling ratio, the size of the compared object in the images obtained after the two corrections are identical. Because the images of the object to be identified and the database items are each corrected at the same scaling ratio as the compared object, the images of the object to be identified and the database items are scaled at the same ratio. This reduces errors in the images of the object to be identified and the database items caused by different scaling ratios, thereby improving recognition accuracy.
[0120] Furthermore, in this embodiment, the image is corrected so that the comparison object is scaled to a first preset scaling ratio, specifically, restorative correction is performed on the comparison object.
[0121] The fifth eigenvalue is corrected by a second correction function to adjust the image of the object to a second preset scaling ratio, specifically including performing a restoration correction on the object.
[0122] It can be understood that in the embodiment of the present application, the restoration correction can be to scale the image size so that the size of the object in the image is the same as the actual size of the photographed object, eliminate the trapezoidal distortion of the image, eliminate reflections and shadows, etc.
[0123] In the embodiment of the present invention, in addition to performing the scaling process at the same ratio, other corrections may also be performed, for example, eliminating trapezoidal distortion, light and dark, and reflection of the image.
[0124] It is understandable that, in addition to the scaling ratio, shooting factors such as trapezoidal distortion and light and dark reflections can also affect imaging and thus image feature values. In this application, the scaling ratio is a necessary correction parameter when correcting the image, and trapezoidal distortion correction and light and dark and reflections can be used as further correction parameters. This also reduces the errors caused by different trapezoidal distortions and different lighting conditions in different images. Specific restoration correction can be performed using existing technologies, and the embodiments of the present invention are not limited to this.
[0125] Performing restoration correction on the image can eliminate or reduce trapezoidal distortion caused by different shooting angles, and / or eliminate or reduce uneven brightness of the image caused by lighting problems. This can make the corrected image as close to the real object as possible, improve the accuracy of image comparison, and further improve the speed and accuracy of recognition.
[0126] Furthermore, in this embodiment, detecting the comparison object and the object to be identified from the image includes:
[0127] The image is divided into regions, and the features of the object to be identified and the features of the comparison objects extracted by the convolutional neural network are used to classify and score each region;
[0128] For example, the input image is divided into regions to generate multiple candidate regions, and the feature values extracted by the convolutional neural network are used to compare the multiple candidate regions. Each candidate region is classified and scored, and the data is a feature vector of fixed length.
[0129] Based on the classification and scoring of each region, the scores, location information, and dimensions of the object to be identified and the comparison object are obtained. It is understood that the scores here refer to the scores of each category calculated by using the scoring function commonly used in convolutional neural networks. They are defined by the prior art and are not limited in this application.
[0130] Specifically, the category judgment and position and size calculation can be performed on the areas with high scores to find the comparison objects and the positions of the comparison objects.
[0131] Detecting an object from an image can be performed according to existing technologies, which are not limited in the present invention. For example, the following steps may be included:
[0132] Multiple candidate boxes are identified in the image; the entire image is input into a convolutional neural network to obtain a feature map; the mapping weight (patch) of each candidate box on the feature map is found. This mapping weight is obtained through training, randomly initialized, and adjusted during training. This mapping weight is used as the convolutional feature of each candidate box and input into the spatial pyramid pooling layer (SPP layer, full name spatial pyramid pooling layer) and subsequent layers; for the features extracted from the candidate box, a classifier is used to determine whether it belongs to a specific class; for candidate boxes belonging to a certain feature, a regressor is used to further adjust their position.
[0133] In this embodiment, the input image is divided into regions to specifically determine the position of the comparison object, and calculations can be performed in parallel on each region to improve calculation efficiency.
[0134] Furthermore, in this embodiment, the scaling ratio of the image of the object to be identified and the physical object to be identified is the same as the scaling ratio of the image of the comparison object and the physical object to be compared, which can be specifically:
[0135] The two zoom ratios can be 1:1, or 2:1, or 1:2, or any other ratio, as long as the two zoom ratios are the same.
[0136] In the embodiment of the present application, when the scaling ratios are the same, no additional correction is required and the graphics and sizes can be directly compared.
[0137] Furthermore, in the embodiment of the present application, the third feature value is compared with the fourth feature value of each object image stored in the database, and the object to be identified is identified according to the comparison result, including
[0138] Determining the similarity between the object to be identified and the images of each object stored in the database based on the comparison results of the third eigenvalue and the fourth eigenvalue;
[0139] Determining the similarity between the object to be identified and the images of each object stored in the database by comparing the third eigenvalue and the fourth eigenvalue can be achieved by any existing technology.
[0140] Sort the similarity between the database items and the images of the items to be identified from high to low.
[0141] In this embodiment, the similarity determination unit compares the third and fourth feature values to determine the similarity between the object to be identified and the objects stored in the database. The sorting unit then sorts the objects in the database in descending order of similarity to the object to be identified. This embodiment prioritizes images of objects with the greatest similarity to the object to be identified, allowing users to easily identify the objects in the database that are most similar to the object to be identified. Images of other highly similar objects can also be retrieved, facilitating further screening and judgment.
[0142] Figure 4 This is a schematic diagram of the structure of an embodiment of an object recognition device based on image processing according to the present invention. Figure 4 As shown, the object recognition device based on image processing of the present invention includes: an image acquisition module 510, a detection module 520, a feature extraction module 530, a correction module 540, and a comparison and recognition module 550, wherein:
[0143] An image acquisition module 510 is configured to acquire images of the object to be identified and the comparison object, wherein the scale ratio of the image of the object to be identified and the actual object to be identified is the same as the scale ratio of the image of the comparison object and the actual object to be compared, and the size of the comparison object can be known;
[0144] The operations performed by the image acquisition module 510 can be found in Figure 1 In step 110 of the corresponding method embodiment, the acquisition module 510 can be an image acquisition module known in the prior art. It is worth noting that the scale ratio of the acquired image of the object to be identified and the actual object can be the same as or different from the scale ratio of the comparison image and the actual object. If the scale ratios are different, the correction module 540 can adjust the scale ratios to the same before continuing processing. For ease of explanation, the present embodiment uses the example of the same scale ratio for the two, which is not intended to be limiting.
[0145] Detection module 520, used to detect comparison objects and objects to be identified from the image;
[0146] The detection module 520 detects the comparison object and the object to be identified from the image acquired by the image acquisition module 510. The device or module used for the detection can be implemented with existing technology.
[0147] A feature extraction module 530 is used to extract a first feature value of the comparison object and a second feature value of the object to be identified;
[0148] Detection module 520 can use existing technologies to detect two objects in the image. Feature extraction module 530 can extract feature values from the two object images, extract a first feature value for the object being compared, and extract a second feature value for the object to be identified. It is understood that the feature value here can specifically be a feature code. The specific extraction of the object feature values can also be done using existing technologies and is not limited in this application.
[0149] A correction module 540 is configured to correct the first eigenvalue to a first standard eigenvalue; and correct the second eigenvalue to a third eigenvalue;
[0150] Correction module 540 corrects the first feature value of the comparison item extracted by feature extraction module 530 to a preset first standard feature value. The preset first standard feature value is obtainable, for example, a preset known quantity. It is understood that because the preset first standard feature value is obtainable, for example, a known quantity, the first correction function can be determined using the known first feature value and the preset known first standard feature value.
[0151] In addition, the correction module 540 corrects the second feature value extracted by the feature extraction module 530 into a third feature value. Specifically, the correction module 540 corrects the second feature value of the object to be identified into the third feature value using the first correction function.
[0152] The comparison and identification module 550 is used to compare the third eigenvalue with the fourth eigenvalue of each object image in the database, and identify the object to be identified based on the comparison result. The fourth eigenvalue of the object image in the database is pre-corrected by the correction module.
[0153] The comparison and identification module 550 compares the third eigenvalue corrected by the correction module 540 with the fourth eigenvalue of each object image in the database, and determines whether the object to be identified corresponding to the third eigenvalue and the object in the database corresponding to the fourth eigenvalue are the same object based on the comparison result.
[0154] It is understood that the database contains at least one object image. When performing the comparison and identification, the comparison and identification module 550 may compare the third feature value with the fourth feature value of each object image in the database until the object to be identified is identified among the objects in the database, or until all objects in the database have been compared. For ease of explanation, in this embodiment of the present invention, only the third feature value of the object to be identified is compared with the fourth feature value of an object image in the database.
[0155] In this embodiment, by introducing a comparison object, the image characteristic value of the standard object is corrected to the first standard characteristic value so that there is a certain scaling relationship between the corrected image of the comparison object and the actual size of the comparison object. The same correction function is used to correct the image of the object to be identified so that there is also the same scaling relationship between the image of the object to be identified and the actual object. The corrected characteristic value is compared with the characteristic value of the object in the database. Since the fourth characteristic value is also corrected, there is also a certain scaling relationship between the corrected database object image and the object. Therefore, by comparing the third characteristic value and the fourth characteristic value, not only the pattern shape of the object to be identified can be identified, but also the size of the identified object can be obtained. Combined with the comparison of the size of the object to be identified and the object in the database image, the object to be identified can be identified more accurately.
[0156] In another embodiment of the object recognition device based on image processing of the present invention, the object recognition device based on image processing of the present invention includes: an image acquisition module 510, a detection module 520, a feature extraction module 530, a correction module 540, and a comparison and recognition module 550, wherein, except for Figure 4 In addition to the corresponding modules performing the corresponding operations in the corresponding embodiments, the correction module 540 and the feature extraction module 430 also perform the following operations:
[0157] The correction module 540 is further configured to scale the comparison object graphic image acquired by the image acquisition module 510 by a first preset ratio;
[0158] The correction module 540 scales the image of the comparison object acquired by the image acquisition module 510 so that the comparison object image and the actual comparison object are scaled at a first preset scaling ratio. The first preset scaling ratio can be set arbitrarily, for example, 1:1, 2:1, 1:2, or other non-integer ratios, and is not limited to the embodiments of the present application, and can achieve the objectives of the invention. In the following embodiments, for simplicity of explanation, a scaling ratio of 1:1 will be used as an example. For other scaling ratios, the corresponding operations on the image feature values can be performed, and no further description is given here.
[0159] The feature extraction module 530 is further configured to obtain a feature value of the comparison object image scaled by the correction module 540 at a first preset ratio as a first standard feature value of the comparison object.
[0160] Feature extraction module 530 extracts feature values of the image corrected by correction module 540. The specific method for extracting feature values can be implemented using existing techniques and is not limited in this application. For example, if the image is scaled to a 1:1 ratio between the image and the actual object, the size of the object being compared in the image corresponding to the first standard feature value is the actual size of the object being compared.
[0161] In the embodiments of the present application, by presetting a first standard feature value for comparing an object and determining the image-to-object scaling ratio corresponding to that feature value, it is easier to determine the size of the object to be identified. Furthermore, presetting the first standard feature allows for immediate comparison when an image needs to be identified, thereby improving the efficiency of the device.
[0162] Furthermore, in another embodiment of the object recognition device based on image processing of the present invention, the object recognition device based on image processing of the present invention comprises: an image acquisition module 510, a detection module 520, a feature extraction module 530, a correction module 540, and a comparison and recognition module 550, wherein, except for Figure 4 In addition to the corresponding modules in the corresponding embodiments performing the same operations, the feature extraction module 530 and the correction module 540 further perform the following operations:
[0163] The feature extraction module 530 is further configured to extract a fifth feature value of the comparison item and a sixth feature value of the item;
[0164] The correction module 540 is further used to correct the fifth eigenvalue so that after correction, the image size of the comparison object and the actual size of the comparison object are in a second preset scaling ratio; and to correct the sixth eigenvalue using a second correction function to obtain a fourth eigenvalue.
[0165] In this embodiment, the object images in the database are also corrected in the same way as the comparison object images to achieve preset size and shape, and are compared with the object to be identified using the same comparison object. Since the comparison object has a specific size, shape and pattern, the error caused by collecting different comparison object feature values is reduced, further improving the recognition accuracy.
[0166] It can be understood that, in the above device embodiment, the second preset scaling ratio may be the same as or different from the first preset scaling ratio.
[0167] Furthermore, in the embodiment of the present invention, in addition to performing the same-ratio scaling process, other corrections may also be performed, for example, eliminating trapezoidal distortion, light brightness, and reflections of the image.
[0168] For example, the correction module 540 can perform restoration correction on the image, eliminate or reduce the trapezoidal distortion caused by different shooting angles, and / or eliminate or reduce the problem of uneven brightness of the image caused by lighting problems, so that the corrected image is as close to the real object as possible, improve the accuracy of image comparison, and further improve the speed and accuracy of recognition.
[0169] Furthermore, in another embodiment of the object recognition device based on image processing of the present invention, the object recognition device based on image processing of the present invention includes: an image acquisition module 510, a detection module 520, a feature extraction module 530, a correction module 540, and a comparison and recognition module 550, wherein the comparison and recognition module 550 includes:
[0170] A similarity determination unit 551 is configured to determine the similarity between the object to be identified and each object image stored in the database based on a comparison result of the third eigenvalue and the fourth eigenvalue;
[0171] The sorting unit 552 is configured to sort the items in the database in descending order according to their similarity to the item to be identified.
[0172] In this embodiment, the similarity determination unit compares the third and fourth feature values to determine the similarity between the object to be identified and the objects stored in the database. The sorting unit then sorts the objects in the database in descending order of similarity to the object to be identified. This embodiment prioritizes images of objects with the greatest similarity to the object to be identified, allowing users to easily identify the objects in the database that are most similar to the object to be identified. Images of other highly similar objects can also be retrieved, facilitating further screening and judgment.
[0173] Figure 6 This is a specific example flow chart of the method for identifying an object based on image processing in this application. In this specific example, according to Figure 6As shown, the method for object recognition based on image processing includes the following steps:
[0174] 610, detecting an object and a comparison object from images stored in a database, wherein the image of the object in the database and the comparison object have the same scaling ratio as the corresponding real object, extracting a fifth feature value of the comparison object, and extracting a sixth feature value of the object;
[0175] 620, correcting the fifth eigenvalue until the image of the comparison object and the actual object are the same size after correction, and determining a second correction function for correcting the image corresponding to the fifth eigenvalue to the same size;
[0176] 630, correcting the sixth eigenvalue according to the second correction function to obtain a fourth eigenvalue;
[0177] Because the objects stored in the database and the comparison objects have the same scale, the comparison objects are corrected to the same size as the actual objects. The same correction function is then used to correct the image of the object stored in the database to the same size as the actual objects. This fourth eigenvalue corresponds to the eigenvalue of the equal-size image of the actual object stored in the database.
[0178] In steps 610 - 630 , the image of the real object stored in the database is corrected to an image of the same size as the real object through scaling correction, and the corresponding eigenvalues are obtained.
[0179] 640, obtaining a comparison object image and correcting the image so that the comparison object image is the same size as the actual comparison object;
[0180] Since the size of the object being compared is known, the image of the object can be corrected to a 1:1 scale ratio between the image and the actual object.
[0181] 650, obtaining the corrected image feature value as a first standard feature value of the comparison object;
[0182] Since the scale ratio of the corrected comparison object image to the actual object is 1:1, the first standard eigenvalue corresponds to the eigenvalue of the image when the comparison object is scaled at 1:1, that is, the eigenvalue of the image that is the same size as the object.
[0183] 660, obtaining images of the object to be identified and the comparison object, wherein the scaling ratio of the image of the object to be identified and the actual object to be identified is the same as the scaling ratio of the image of the comparison object and the actual object to be compared;
[0184] The images here can be formed by the same shooting, so that images of two objects with the same zoom ratio can be obtained, or they can be formed by separate shooting, as long as the zoom ratio is the same.
[0185] 670, detecting the comparison object and the object to be identified from the image, extracting a first feature value of the comparison object, and extracting a second feature value of the object to be identified;
[0186] 680, correcting the first eigenvalue to a first standard eigenvalue, where the first standard eigenvalue is known, and determining a first correction function for correcting the first eigenvalue to the first standard eigenvalue;
[0187] Correcting the first characteristic value of the comparison object to the first standard characteristic value corresponds to correcting the image to have a scaling ratio of 1:1 with the real object, thereby obtaining the first correction function.
[0188] 690, correcting the second eigenvalue of the object to be identified according to the first correction function to obtain a third eigenvalue;
[0189] The first correction function corrects the comparison object from the same scale as the object to be identified to the same size as the actual object. The second eigenvalue of the object to be identified is corrected by the first correction function, and the obtained third eigenvalue corresponds to the eigenvalue of the image of the same size as the object to be identified.
[0190] 700, comparing the third eigenvalue with the fourth eigenvalue of each object image in the database, and determining the similarity between the object to be identified and each object image stored in the database based on the comparison result of the third eigenvalue and the fourth eigenvalue;
[0191] 710 , sort the items in the database in descending order according to their similarity to the item to be identified.
[0192] It is understandable that after sorting, only the items in the top N databases with the highest similarity rankings may be displayed.
[0193] The specific method for identifying and judging by feature values can be implemented using existing technologies. During the comparison, since the database contains multiple object images, the object to be identified is compared with each of them. If the result is that the two are the same object, the comparison can be stopped. If the object to be identified is determined to be different from an object in the database, the object to be identified is compared with other object images in the database until the object to be identified is found in the database, and the result is output. Alternatively, even if no matching feature value is found in the entire database, the result can still be output.
[0194] From the above, it can be seen that the scaling ratio of the image corresponding to the third eigenvalue and the actual object to be identified is 1:1, and the scaling ratio of the image corresponding to the fourth eigenvalue and the actual object is also 1:1. Therefore, when comparing the image eigenvalues to determine whether the object to be identified and the object corresponding to the image in the database are the same, the shape, pattern and size can be compared at the same time, thereby reducing the misjudgment caused by different scaling ratios and improving the efficiency and accuracy of recognition.
[0195] The device embodiments described above are merely illustrative. The units described as separate components may or may not be physically separate, and the components shown as units may or may not be physical units, i.e., they may be located in one location or distributed across multiple network units. Some or all of the modules may be selected based on actual needs to achieve the objectives of the present embodiment. Persons of ordinary skill in the art will be able to understand and implement the present invention without inventive effort.
[0196] Through the description of the above embodiments, those skilled in the art can clearly understand that each embodiment can be implemented by means of software plus a necessary general hardware platform, or of course, by hardware. Based on this understanding, the essence of the above technical solution or the part that contributes to the existing technology can be embodied in the form of a software product. The computer software product can be stored in a computer-readable storage medium, such as ROM / RAM, a magnetic disk, an optical disk, etc., and includes a number of instructions for enabling a computer device (which can be a personal computer, a server, or a network device, etc.) to execute the methods described in each embodiment or certain parts of the embodiments.
[0197] Finally, it should be noted that the above embodiments are only used to illustrate the technical solutions of the present invention, rather than to limit it. Although the present invention has been described in detail with reference to the aforementioned embodiments, those skilled in the art should understand that they can still modify the technical solutions described in the aforementioned embodiments, or make equivalent replacements for some of the technical features therein. However, these modifications or replacements do not deviate the essence of the corresponding technical solutions from the spirit and scope of the technical solutions of the various embodiments of the present invention.
Claims
1. An object recognition method based on image processing, characterized in that: include: Acquire images of the object to be identified and a comparison object, wherein the scale ratio of the image of the object to be identified and the actual object to be identified is the same as the scale ratio of the image of the comparison object and the actual object to be identified, and the size of the comparison object can be known; Detecting the comparison object and the object to be identified from the image, and extracting a first feature value of the comparison object and a second feature value of the object to be identified; Correcting the first characteristic value to a first standard characteristic value, wherein a scaling ratio between the first standard characteristic value and the comparison object can be obtained in advance, and determining a first correction function for correcting the first characteristic value to the first standard characteristic value; Correcting the second eigenvalue of the object to be identified according to the first correction function to obtain a third eigenvalue; The third characteristic value is compared with the fourth characteristic value of each object image stored in the database to determine whether the shape, pattern and size of the object to be identified and the database object are consistent, and the object to be identified is identified based on the comparison result. The fourth characteristic value is obtained through pre-calibration, and there is a predetermined scaling relationship between the fourth characteristic value and the corresponding object.
2. The method according to claim 1, characterized in that The comparison objects are objects with standard shapes, patterns and sizes.
3. The method according to claim 1, characterized in that Obtaining the first standard characteristic value includes: Acquiring an image of the comparison object; Correcting the image so that the comparison object image and the comparison object are scaled at a first preset scaling ratio; The corrected image feature value is obtained as the first standard feature value of the comparison object.
4. The method according to claim 3, characterized in that The fourth eigenvalue of the object image in the database obtained through pre-correction includes: Detecting the object and the comparison object from the image in the database, and extracting a fifth feature value of the comparison object and a sixth feature value of the object, wherein the image of the object in the database and the comparison object have the same scaling ratio; Correcting the fifth eigenvalue until the image of the comparison object corresponding to the correction and the actual comparison object have a second preset scaling ratio, and determining a second correction function for correcting the image corresponding to the fifth eigenvalue to the second preset scaling ratio; The sixth eigenvalue is corrected according to the second correction function to obtain the fourth eigenvalue.
5. The method according to claim 4, characterized in that The second preset zoom ratio is the same as the first preset zoom ratio.
6. The method according to claim 4, characterized in that Correcting the image so that the comparison object is scaled to a first preset scaling ratio includes: Performing restoration correction on the comparison object image; and / or Correcting the fifth characteristic value until the image of the comparison object and the actual comparison object have a second preset scaling ratio after correction includes: Performing restoration correction on the comparison object image.
7. The method according to claim 1, characterized in that The detecting the comparison object and the to-be-identified object from the image includes: Dividing the image into regions, and classifying and scoring each region using the features of the object to be identified and the features of the comparison object extracted by a convolutional neural network; The scores, location information and sizes of the to-be-identified object and the comparison object are obtained respectively according to the classification and scoring of the respective areas.
8. The method according to any one of claims 1 to 7, characterized in that The step of comparing the third feature value with the fourth feature value of each object image stored in the database to determine whether the shape, pattern, and size of the object to be identified are consistent with those of the objects in the database, and identifying the object to be identified based on the comparison result includes: Determining the similarity between the object to be identified and each object image stored in the database based on a comparison result of the third eigenvalue and the fourth eigenvalue; The objects in the database are sorted in descending order according to their similarity to the object to be identified.
9. An object recognition device based on image processing, characterized in that: include: An image acquisition module is configured to acquire images of the object to be identified and the comparison object, wherein the scale ratio of the image of the object to be identified and the actual object to be identified is the same as the scale ratio of the image of the comparison object and the actual object to be identified, and the size of the comparison object can be known; a detection module, configured to detect the comparison object and the object to be identified from the image; A feature extraction module, configured to extract a first feature value of the comparison object and a second feature value of the object to be identified; a correction module, configured to correct the first eigenvalue to a first standard eigenvalue, wherein a scaling ratio between the first standard eigenvalue and the comparison object can be obtained in advance, determine a first correction function for correcting the first eigenvalue to the first standard eigenvalue; and correct the second eigenvalue to a third eigenvalue according to the first correction function; a comparison and identification module, configured to compare the third eigenvalue with the fourth eigenvalue of each object image in a database, determine whether the shape, pattern, and size of the object to be identified are consistent with those of the objects in the database, and identify the object to be identified based on the comparison result, wherein the fourth eigenvalue of the object image in the database is pre-corrected by the correction module, and the fourth eigenvalue has a predetermined scaling relationship with the corresponding object.
10. The device according to claim 9, characterized in that The correction module is further configured to scale the comparison object image acquired by the image acquisition module at a first preset ratio; The feature extraction module is further configured to obtain a feature value of the comparison object image scaled by the correction module at the first preset ratio as a first standard feature value of the comparison object.
11. The device according to claim 10, characterized in that The detection module is further configured to detect the object and the comparison object from each image in the database; The feature extraction module is further configured to extract a fifth feature value of the compared object and a sixth feature value of the object; The correction module is also used to correct the fifth eigenvalue so that after correction, the comparison object image and the comparison object are in a second preset scaling ratio; and to correct the sixth eigenvalue using a second correction function to obtain the fourth eigenvalue, wherein the second correction function is determined by the fifth eigenvalue and the second preset scaling ratio.
12. The device according to any one of claims 9 to 11, characterized in that The comparison and identification module includes: a similarity determination unit, configured to determine a similarity between the object to be identified and each object image stored in a database based on a comparison result of the third feature value and the fourth feature value; The sorting unit is used to sort the objects in the database in descending order according to their similarity with the object to be identified.
Citation Information
Patent Citations
Fingerprint elastic deformation correction method and device
CN101122950A
Data correction apparatus, control method thereof and image discriminating apparatus
CN102110285A
Object image correcting device and method for identification
CN102136069A
Method and device for adjusting target scale in pan-tilt-zoom (PTZ) tracking process
CN103426185A
Image processing method and terminal equipment
CN103971111A