Article identity detection method, device and system and electronic equipment

By using the benchmark image information saved by macro cameras and databases in cultural relics detection, automated image acquisition and feature detection are achieved, and the problems of complex operation, high cost and excessive dependence on labor in the prior art are solved, and the detection efficiency and reliability of the results are improved.

CN119722753APending Publication Date: 2025-03-28NETEASE (HANGZHOU) NETWORK CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202311253224.9
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2023-09-26
Publication Date
2025-03-28

AI Technical Summary

Technical Problem

In the existing cultural relics detection technology, the operation is complex and costly, and it relies on too much labor, resulting in low efficiency and inaccurate results.

Method used

Automatic image acquisition and feature detection are achieved by using a macro camera instead of an optical microscope, combining the reference image and focal length information saved in the database.

Benefits of technology

It reduces the cost of testing equipment, reduces labor costs, improves the detection efficiency and stability and reliability of results, and improves the degree of automation of identity testing.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119722753A_ABST
    Figure CN119722753A_ABST
Patent Text Reader

Abstract

The invention provides an article identity detection method, device and system and electronic equipment, and the method comprises the steps: obtaining image information of a reference article corresponding to identification information from a preset database according to the identification information of a to-be-detected article; wherein the image information comprises reference feature sequences and focal lengths corresponding to a plurality of reference images; setting the focal length of the macro camera as a target focal length according to the focal lengths corresponding to the plurality of reference images; controlling the macro camera to shoot the to-be-detected object under the target focal length to obtain a to-be-detected image; obtaining a to-be-detected feature sequence of the to-be-detected image; and detecting the identity of the to-be-detected article and the reference article according to the to-be-detected feature sequence of the to-be-detected image and the reference feature sequences corresponding to the plurality of reference images. Through the technology, the automation degree of the article detection process can be improved, and the problem that the manual participation degree is too high is solved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present disclosure relates to the technical field of cultural relics detection, and in particular to an object identity detection method, device, system and electronic equipment. Background Art

[0002] Cultural relics are relics and remains with historical, artistic and scientific value left over from human social activities. They are records created by humans or related to human activities and are irreproducible. Therefore, non-destructive testing technology is generally used in the identification and detection of cultural relics.

[0003] In the non-destructive testing technology for cultural relics, optical microscopes are usually used to collect tiny feature points (such as millimeter level) on cultural relics. This collection method is relatively complicated and requires professionals to take microscopic pictures. The cost of the entire process is high. In addition, there are also methods of using ordinary consumer-grade cameras to take pictures of cultural relics, and then using the naked eye to observe the pictures for identification and testing. This method is time-consuming and labor-intensive, and relies on skilled operators.

[0004] In the process of cultural relics identification and detection, whether using the above-mentioned optical microscope method or ordinary camera, it requires excessive human participation and the operation is relatively cumbersome. Summary of the invention

[0005] The purpose of the present disclosure is to provide an object identity detection method, device, system and electronic equipment to improve the automation level of the object detection process and alleviate the problem of excessive manual participation.

[0006] The disclosed embodiment provides a method for detecting the identity of an object, the method comprising: obtaining, from a preset database, image information of a reference object corresponding to the identification information of the object to be inspected; wherein the image information comprises a reference feature sequence and a focal length corresponding to a plurality of reference images; the reference image is obtained by photographing the reference object with a macro camera at a focal length corresponding to the reference image; setting the focal length of the macro camera to a target focal length according to the focal lengths respectively corresponding to the plurality of reference images; controlling the macro camera to photograph the object to be inspected at the target focal length to obtain the image to be inspected; obtaining a reference feature sequence of the image to be inspected; and detecting the identity of the object to be inspected with the reference object according to the reference feature sequence of the image to be inspected and the reference feature sequences corresponding to the plurality of reference images.

[0007] In a second aspect, an embodiment of the present disclosure further provides an object identity detection device, the device comprising: an image information acquisition module, for acquiring, based on the identification information of the object to be inspected, image information of a reference object corresponding to the identification information from a preset database; wherein the image information comprises a reference feature sequence and a focal length corresponding to a plurality of reference images; the reference image is obtained by photographing the reference object with a macro camera at the focal length corresponding to the reference image; a focal length setting module, for setting the focal length of the macro camera to a target focal length according to the focal lengths respectively corresponding to the plurality of reference images; an image shooting module, for controlling the macro camera to photograph the object to be inspected at the target focal length to obtain an image to be inspected; a feature sequence acquisition module, for acquiring a feature sequence to be inspected of the image to be inspected; and an identity detection module, for detecting the identity of the object to be inspected with the reference object based on the feature sequence to be inspected of the image to be inspected and the reference feature sequences corresponding to the plurality of reference images.

[0008] In a third aspect, an embodiment of the present disclosure also provides an object identity detection system, the system comprising a terminal device and a macro camera connected to the terminal device, the terminal device being used to obtain, from a preset database, image information of a reference object corresponding to the identification information of the object to be inspected; wherein the image information comprises a reference feature sequence and a focal length corresponding to a plurality of reference images; the reference image is obtained by photographing the reference object with the macro camera at the focal length corresponding to the reference image; and the focal length of the macro camera is set to a target focal length according to the focal lengths respectively corresponding to the plurality of reference images; the macro camera is used to photograph the object to be inspected at the target focal length under the control of the terminal device to obtain an image to be inspected; and the image to be inspected is sent to the terminal device; the terminal device is also used to obtain a feature sequence to be inspected of the image to be inspected, and detect the identity of the object to be inspected with the reference object according to the feature sequence to be inspected of the image to be inspected and the reference feature sequence corresponding to the plurality of reference images.

[0009] In a fourth aspect, an embodiment of the present disclosure further provides an electronic device, including a processor and a memory, wherein the memory stores computer executable instructions that can be executed by the processor, and the processor executes the computer executable instructions to implement the above-mentioned object identity detection method.

[0010] In a fifth aspect, an embodiment of the present disclosure further provides a computer-readable storage medium, which stores computer-executable instructions. When the computer-executable instructions are called and executed by a processor, the computer-executable instructions prompt the processor to implement the above-mentioned object identity detection method.

[0011] The object identity detection method, device, system, electronic device and storage medium provided by the embodiments of the present disclosure use a macro camera instead of an optical microscope to obtain an image of the object to be inspected, thereby reducing the equipment cost of the inspection; by storing the reference image and the focal length corresponding to the reference image in the database, the focal length corresponding to the reference image can be used in the inspection stage, without the need for multiple manual focusing adjustments, thus saving labor costs and improving the inspection efficiency. At the same time, multiple reference images with different focal lengths provide more features for the inspection, ensuring the stability and reliability of the inspection results; in addition, the object identity detection can be completed by combining the feature sequence of the image to be inspected with the reference feature sequence corresponding to the multiple reference images, thereby improving the automation of the identity detection. BRIEF DESCRIPTION OF THE DRAWINGS

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

[0013] Figure 1 A schematic diagram of a detection system provided in an embodiment of the present disclosure;

[0014] Figure 2 A flowchart of an object identity detection method provided by an embodiment of the present disclosure;

[0015] Figure 3 A schematic diagram of another detection system provided by an embodiment of the present disclosure;

[0016] Figure 4 A schematic diagram of an image obtained by collecting cultural relics provided in an embodiment of the present disclosure;

[0017] Figure 5 A schematic diagram of a contour image provided by an embodiment of the present disclosure;

[0018] Figure 6 A schematic diagram of the structure of an object identity detection device provided in an embodiment of the present disclosure;

[0019] Figure 7 A schematic diagram of the structure of an electronic device provided in an embodiment of the present disclosure. DETAILED DESCRIPTION

[0020] The technical solution of the present disclosure will be clearly and completely described below in conjunction with the embodiments. Obviously, the described embodiments are part of the embodiments of the present disclosure, rather than all of the embodiments. Based on the embodiments in the present disclosure, all other embodiments obtained by ordinary technicians in the field without creative work are within the scope of protection of the present disclosure.

[0021] In the detection of object identity, some objects have more textures, such as calligraphy and painting, porcelain, etc. Such objects usually require staff to conduct careful observation through high-end equipment such as optical microscopes to obtain relatively reliable detection results. Based on this, the embodiments of the present disclosure provide object identity detection methods, devices, systems, electronic devices and storage media. In this technology, a macro camera is controlled by a terminal device to achieve a highly automated image acquisition process, and image detection is automatically completed by the terminal device, which reduces the degree of manual participation, improves work efficiency, and reduces the problem of inaccurate detection results caused by manual fatigue.

[0022] The present disclosure provides a method for detecting the identity of an object. Figure 1 The schematic diagram of a detection system of the present disclosure is shown, and the terminal device 10 is connected to the macro camera 12. Specifically, the terminal device 10 and the macro camera 12 can be connected via a USB cable. The macro camera 12 in this embodiment may include a digital camera (ordinary camera) and a zoom lens, and its focal length range can be 35mm to 100mm. When shooting, it can automatically focus at set values ​​such as every 5mm or 10mm, and take multiple images with different focal lengths. The macro camera 12 can be set on a camera bracket 14, and the object 16 can be placed directly below the macro camera 12, for example, on the stage of the camera bracket 14.

[0023] See also Figure 2 The flowchart of the method for detecting the identity of an item is shown. Under the above system, the method can be applied to the above terminal device, and specifically may include the following steps:

[0024] Step S102, according to the identification information of the object to be inspected, obtain image information of the reference object corresponding to the identification information from a preset database; wherein the image information includes a reference feature sequence and a focal length corresponding to a plurality of reference images; the reference image is obtained by photographing the reference object with a macro camera at a focal length corresponding to the reference image.

[0025] The identification information of the object to be inspected may be the code or name of the object. The database pre-stores the image information of the reference object corresponding to the object to be inspected. To facilitate the search of image information, the database uses the identification information of the object as an index to search for the corresponding image information.

[0026] The above-mentioned reference object represents the object when collecting image information in the database, which is a credible object. Taking cultural relics as an example, in order to facilitate the management of cultural relics, the above-mentioned macro camera will be used to collect image information of cultural relics, so as to perform identity detection on found or returned cultural relics in scenarios such as cultural relics being lost or loaned out. The cultural relics in the image information of such cultural relics in advance can be called reference cultural relics, which serve as the benchmark for subsequent detection.

[0027] For easy distinction, the image corresponding to the image information stored in the database is called a reference image. Each object has multiple reference images stored in the database. Each of the multiple reference images corresponds to a focal length and a reference feature sequence. The reference feature sequence is a feature sequence obtained by extracting features from the reference image.

[0028] Step S104 , setting the focal length of the macro camera as the target focal length according to the focal lengths respectively corresponding to the plurality of reference images.

[0029] The focal lengths corresponding to the multiple reference images are usually different from each other by a set focal length. For example, the same reference object has three reference images in the database, the focal length corresponding to the first reference image is 30 mm, the focal length corresponding to the second reference image is 35 mm, and the focal length corresponding to the third reference image is 40 mm. The minimum focal length among the focal lengths corresponding to the multiple reference images can be used as the target focal length. As a possible implementation, the average focal length corresponding to the multiple reference images can also be used as the target focal length.

[0030] Step S106, controlling the macro camera to photograph the object to be inspected at the target focal length to obtain an image to be inspected.

[0031] The terminal device is connected to the macro camera for communication, and can control the macro camera to set the focal length to the target focal length through instructions, and trigger the macro camera to shoot the object to be inspected at the target focal length.

[0032] Step S108, obtaining a feature sequence to be inspected of the image to be inspected.

[0033] The terminal device may extract features from the image to be inspected to obtain a feature sequence to be inspected. Alternatively, the terminal device may send the image to be inspected to a cloud server or other device, which may extract features from the image to be inspected to obtain a feature sequence to be inspected.

[0034] Step S110 , detecting the identity of the object to be inspected and the reference object according to the feature sequence to be inspected of the image to be inspected and the reference feature sequences corresponding to the plurality of reference images.

[0035] In specific implementation, the feature sequence to be tested of the image to be tested can be compared with one of the reference feature sequences corresponding to multiple reference images, or the feature sequence to be tested of the image to be tested can be compared with each of the reference feature sequences corresponding to multiple reference images to determine the identity of the object.

[0036] The above method reduces the equipment cost of the inspection by using a macro camera instead of an optical microscope to obtain the image of the object to be inspected; by storing the reference image and the focal length corresponding to the reference image in the database, the focal length corresponding to the reference image can be used in the inspection stage, without the need for multiple manual focusing adjustments, saving labor costs and improving the inspection efficiency. At the same time, multiple reference images with different focal lengths provide more features for the inspection, ensuring the stability and reliability of the inspection results; in addition, the identity detection of the object can be completed through the feature sequence of the image to be inspected and the reference feature sequence corresponding to the multiple reference images, thereby improving the automation of the identity detection.

[0037] The focal lengths of the image to be inspected and the reference image correspond to each other, which, to a certain extent, makes the number of features of the two images not too different, which facilitates subsequent feature extraction and feature detection and effectively ensures the detection quality.

[0038] As a possible implementation, the focal length difference between the focal lengths corresponding to the above-mentioned multiple reference images is a value within a preset range, for example: the preset range is 5mm to 25mm; accordingly, setting the focal length of the macro camera as the target focal length according to the focal lengths corresponding to the multiple reference images includes: selecting a focal length from the focal lengths corresponding to the multiple reference images as the target focal length; sending a focus instruction to the macro camera to trigger the macro camera to set the current focal length as the target focal length; wherein the focus instruction includes the above-mentioned target focal length. In this way, when the focal length difference between the reference images is relatively small, one of them can be selected as the target focal length to automatically control the focus of the macro camera, thereby simplifying the camera focusing process and improving the convenience of detection.

[0039] In order to facilitate the guidance of the placement of the objects, the above-mentioned image information also includes the contour information of the reference object; the contour information can be obtained by extracting the boundary features of the reference image. Accordingly, after the above-mentioned step of setting the focal length of the macro camera to the target focal length, the above-mentioned method also includes: (1) displaying the contour information of the reference object through the graphical user interface of the terminal device; (2) displaying the preview image of the object to be inspected obtained by the macro camera at the target focal length at the display position of the contour information of the reference object; (3) adjusting the placement of the object to be inspected according to the preview image and the contour information so that the preview image matches the contour information. By guiding the placement of the object to be inspected by the contour information of the reference image, the shooting angle of the object to be inspected can be made to match the shooting angle of the reference object, so that the feature detection results between the image to be inspected and the reference image are more reliable.

[0040] The terminal device can be connected to the platform of the object to be inspected, and by displaying the preview image in the position of the contour information, the terminal device automatically controls the rotation angle of the platform, and can adjust and display the degree of coincidence between the two until the preview image is basically in the contour corresponding to the contour information. Alternatively, the placement of the object to be inspected can be manually adjusted according to the preview image and the contour information.

[0041] As a possible implementation, see Figure 3 A schematic diagram of another detection system of the present disclosure is shown in the above Figure 1 On the basis of the detection system shown, the terminal device 10 is also connected to the server 20; the above-mentioned database can be set on the server 20. The server 20 can be an ordinary server or a cloud server. Correspondingly, the above-mentioned acquisition of the feature sequence to be tested of the image to be tested includes: uploading the image to be tested to the server; receiving the feature sequence to be tested extracted by the server from the image to be tested. An image feature extraction algorithm can be set on the server 20, such as the SIFT (Scale-Invariant Feature Transform) algorithm, and the features extracted by the SIFT algorithm are float32 type vectors with a length of 128 dimensions. In addition to the above-mentioned SIFT algorithm, in the specific implementation, other feature extraction algorithms can also be used to extract the feature sequence to be tested from the image to be tested, such as: SURF (Speeded Up Robust Features) algorithm or ORB (Oriented FAST and Rotated BRIEF) algorithm. The ORB algorithm extracts feature points based on the FAST algorithm and constructs a descriptor of the feature points based on the BRIEF algorithm.

[0042] This method of extracting features of the image to be inspected through the server reduces the requirements for the terminal device.

[0043] As a possible implementation, the above-mentioned detection of the identity of the object to be inspected and the reference object based on the feature sequence to be inspected of the image to be inspected and the reference feature sequences corresponding to the plurality of reference images may include the following steps (1) to (4):

[0044] (1) Determining a target benchmark feature sequence from benchmark feature sequences corresponding to a plurality of benchmark images; for example, the plurality of benchmark images may be sorted in ascending order according to their corresponding focal lengths, and the benchmark feature sequences corresponding to the benchmark images may be sequentially sorted according to the arrangement order to determine the target benchmark feature sequence.

[0045] (2) detecting whether the object to be inspected matches the reference object based on the feature sequence to be inspected of the image to be inspected and the target reference feature sequence;

[0046] (3) If the object to be inspected does not match the reference object, reselect the target reference feature sequence from the reference feature sequences corresponding to the multiple reference images and continue the inspection, that is, continue to execute the above step (2);

[0047] (4) If the object to be inspected matches the reference object, it is determined that the object to be inspected and the reference object are the same object. If the reference feature sequences corresponding to all reference images are used as target reference feature sequences for detection, and the detection results are that the object to be inspected does not match the reference object, it is determined that the object to be inspected and the reference object are not the same object.

[0048] The above method can make the obtained detection result more accurate by detecting the reference feature sequences and the feature sequences to be detected of multiple reference images.

[0049] As a possible implementation, the above-mentioned detection of whether the object to be inspected matches the reference object based on the feature sequence to be inspected of the image to be inspected and the target reference feature sequence may include the following steps (1) to (3):

[0050] (1) searching for features in the target reference feature sequence that match features in the feature sequence to be tested of the image to be tested, to obtain a first matching feature set; searching for features in the feature sequence to be tested of the image to be tested that match features in the target reference feature sequence, to obtain a second matching feature set.

[0051] The above matching feature set can be implemented by KNN (K-Nearest Neighbor) algorithm, where K is 2. The distance (e.g., Euclidean distance) between each feature in the target reference feature sequence and each feature in the feature sequence to be tested is calculated, and two features with the closest distance to the features in the feature sequence to be tested of the image to be tested are searched from the target reference feature sequence as matching features according to the calculation results, to obtain a first matching feature set; similarly, two features with the closest distance to the features in the target reference feature sequence are searched from the feature sequence to be tested of the image to be tested as matching features according to the calculation results, to obtain a second matching feature set.

[0052] (2) performing abnormal feature elimination operations on the first matching feature set and the second matching feature set respectively to obtain a first optimized feature set corresponding to the first matching feature set and a second optimized feature set corresponding to the second matching feature set.

[0053] The above abnormal feature elimination is used to remove the unstable matching in the above matching feature set. Generally, if a feature is close to two or more features, it means that the feature matching is unstable. In order to reduce the interference of such features, such features can be deleted in advance.

[0054] (3) Determine whether the object to be inspected matches the reference object based on the first optimized feature set and the second optimized feature set.

[0055] Through the above abnormal feature elimination operation, the first matching feature set and the second matching feature set can be optimized to improve the accuracy of the detection result.

[0056] As a possible implementation, the above-mentioned abnormal feature elimination operation for the first matching feature set and the second matching feature set includes: checking the vector distances between the matching features in the first matching feature set and the second matching feature set respectively; for the same feature, if there are at least two other features whose vector distance difference with the same feature is less than a first preset value, the same feature and its matching features are deleted. For example: for a feature in the first matching feature set, if the shortest distance corresponding to the feature is less than the second shortest distance corresponding to the feature multiplied by a set threshold, the feature is removed. By optimizing the first matching feature set and the second matching feature set by vector distance, the accuracy of the detection results can be improved.

[0057] In order to obtain more accurate detection results, the above-mentioned determination of whether the object to be inspected matches the reference object based on the first optimized feature set and the second optimized feature set may include: determining the intersection of the first optimized feature set and the second optimized feature set to obtain an intersection set; determining the minimum number of features in the first optimized feature set and the second optimized feature set; calculating the ratio of the number of features in the intersection set to the minimum number of features; if the ratio is greater than the second preset value, determining that the object to be inspected matches the reference object. Among them, the size of the second preset value can be determined according to the type of the object to be inspected. For objects with clearer textures such as paintings and calligraphy, and ceramics, the second preset value can be slightly larger. For objects with relatively fewer textures such as jade and bottle-shaped objects, the second preset value can be slightly smaller. Through the above calculation method, the number of matching features between the image to be inspected and the reference image can be determined, and then whether the two objects match can be determined. The implementation is simple and the results are reliable.

[0058] In order to make the implementation process of the above method clearer, Figure 3 The detection system shown is described as follows, with the item being a cultural relic:

[0059] 1. Collecting Cultural Relics Images

[0060] 1. Assume that before the cultural relics are loaned out, they are placed in Figure 2 The inspection system shown has a macro camera mounted on the stage with a variable-focus macro lens with a magnification range of 1:1 to 5:1.

[0061] 2. The operator opens the camera control interface on the terminal device, selects the "Add Image" control, enters the number of the cultural relic on the stage, and triggers the macro camera to automatically take pictures.

[0062] The above-mentioned macro camera has an autofocus function. After focusing successfully, the macro camera automatically takes pictures. During the macro camera shooting process, the focal length of the macro camera can be controlled and set by the terminal device. Each time the macro camera completes a photo, the terminal device will receive a current photo completion event fed back by the macro camera, and then update the focal length of the macro camera to the next focal length, triggering the macro camera to continue taking pictures with the next focal length, until the number of photos taken this time reaches the set number, and the terminal device controls the macro camera to stop taking pictures. In this embodiment, taking the images corresponding to three different focal lengths (usually three focal lengths with an interval of 5mm, that is, the database will have three images corresponding to the same cultural relic) as an example, the focal length of the first image is 35mm, the second is automatically adjusted to 40mm, and the third is automatically adjusted to 45mm.

[0063] The above different focal lengths correspond to different magnifications. The purpose of selecting multiple different focal lengths for taking pictures here is to take into account that in the subsequent detection process, it may be difficult to completely reproduce the magnification taken during the data entry process. Through the redundant processing of multiple different focal lengths, taking more images will facilitate the image feature comparison in the subsequent detection process. Generally, the feature comparison algorithm can tolerate small-scale magnification inconsistencies.

[0064] 3. The terminal device obtains the image taken by the macro camera and the focal length information corresponding to the image, and transmits it to the server for feature extraction and contour extraction.

[0065] 4. The server uses the SIFT algorithm to extract features from each image.

[0066] In this embodiment, the maximum number of features extracted from a single image is limited to 5000 to avoid excessively high features that will cause the subsequent detection calculation time to be too long. The server uses the SIFT algorithm to construct a 3-layer Gaussian pyramid to ensure the stability of the feature points. The features extracted by the SIFT algorithm are serialized and stored in the database. Each feature in the feature sequence is a feature vector, and usually an image will have more than 1000 features.

[0067] The server in this embodiment uses the dilation-ablation algorithm to extract the contour of one of the above images, constructs a contour transparent PNG image and stores it in the database. Alternatively, the server can also extract contours of the above multiple images, select the contour with the highest clarity from the extracted contours to construct a PNG image. Figure 4 The image diagram of the collected cultural relics shown in the figure is illustrated by taking calligraphy and painting as an example. Figure 5 The outline image diagram shown in Figure 4 The image in is subjected to the above dilation-ablation algorithm to calculate the contour image.

[0068] PNG images can define 256 transparent levels for the original image, so that the edge of the image can blend smoothly with any background, thus completely eliminating jagged edges. PNG formats are available in 8-bit and 24-bit. PNG images with the outline of cultural relics are used to guide the placement of cultural relics, which is more intuitive and convenient than guiding by cultural relic images.

[0069] 2. Detecting Cultural Relics Images

[0070] 1. After the cultural relic is returned, the operator enters the number of the returned cultural relic (i.e. the cultural relic to be inspected) on the terminal device, retrieves the reference cultural relic corresponding to the number from the database, i.e. the image information entered into the database during the cultural relic image acquisition process, and places the returned cultural relic in the Figure 2 On the stage shown.

[0071] 2. The terminal device displays the PNG image corresponding to the number in the database on the graphical user interface, and the operator places the returned cultural relics according to the outline image so that they are basically consistent with the original position (a certain offset and rotation are allowed). During the placement of the cultural relics, the terminal device can align the preview image of the returned cultural relics with this outline and fill it in, and adjust the cultural relics so that the two are basically consistent.

[0072] 3. The terminal device automatically obtains the focal length information of the image corresponding to the above number, sets the focal length of the above macro camera to take pictures of the returned cultural relics.

[0073] 4. The terminal device uploads the image of the returned cultural relic taken by the macro camera to the server, triggering the server to extract features and obtain the feature sequence of the returned cultural relic. The server then performs feature comparison and gives the comparison result.

[0074] In this embodiment, the cultural relics feature comparison process is as follows:

[0075] (1) The feature sequence of the pre-collected image (i.e., the reference image corresponding to the reference cultural relic) is recorded as FSa, and the feature sequence of the image corresponding to the returned cultural relic is recorded as FSb. The KNN matching algorithm is used with K=2 to calculate the matching set Ma of FSa and the matching set Mb of FSb respectively.

[0076] KNN is a K-nearest neighbor algorithm that does not require training. The features extracted from an image are composed of multiple 128-dimensional float32 vectors. Here, the distance (such as the Euclidean distance) between each vector in image A (such as the above-mentioned benchmark image) and each vector in image B (such as the image corresponding to the returned cultural relics) is calculated. And the two closest (K=2) vectors between each vector in image A and image B are returned, which is Ma. The same operation is performed on image B, which is Mb. Among them, the vector obtained by finding the closest vector of image A from image B is usually different from the vector obtained by finding the closest vector of image B from image A, so the above sets Ma and Mb are also usually different.

[0077] In order to improve the subsequent feature comparison effect, the image of the returned cultural relic should be as clear as possible than the corresponding image in the database or as clear as the image, and the number of features in FSb will be greater than the number of features in FSa (for example, it may be greater than 30%).

[0078] (2) Remove the feature vectors whose shortest distance in Ma is less than the second shortest distance multiplied by a threshold t (e.g., 0.7) to obtain Ma′, and remove the feature vectors whose shortest distance in Mb is less than the second shortest distance multiplied by a threshold t to obtain Mb′.

[0079] (3) Take the intersection Mc of the features in Ma′ and Mb′, which is the intersection feature set.

[0080] (4) Calculate Score = Len(Mc) / Min(Len(Ma), Len(Mb). If Score > the second preset value, it can be determined that the returned cultural relic matches the reference cultural relic and belongs to the same item.

[0081] Among them, the above Len function represents the size of the obtained set), and the Min function is to get the minimum value; for example: the number of features in Mc is 20, the number of features in Ma' is 30, and the number of features in Mb' is 40, then Score = 20 / 30 = 2 / 3. The above Score is used to represent the percentage of matching feature points, which can more intuitively show how many feature points in the two images match.

[0082] (5) If the above score indicates that the returned cultural relic does not match the reference cultural relic, the next image corresponding to the code is obtained from the database, and the above process (1) to (4) is continued. If all images corresponding to the code in the database are not matched successfully, it is considered that the returned cultural relic does not match the reference cultural relic and the two are not the same item.

[0083] The above method can realize the micro-trace photography of objects by using a macro camera composed of an ordinary consumer-grade digital camera and a consumer-grade macro lens, thereby reducing the equipment cost for object identity detection. The terminal device or server automatically extracts and compares features, and no manual visual observation is required during the comparison process, which reduces labor costs and improves detection efficiency. At the same time, the terminal device controls the macro camera to automatically shoot, which reduces the professional requirements for the operator and makes it easier to implement.

[0084] Corresponding to the above method, this embodiment also provides an object identity detection device, which can be applied to a terminal device, the terminal device is connected to a macro camera, and the macro camera includes a digital camera and a variable-focus lens; see Figure 6 , the device includes the following modules:

[0085] The image information acquisition module 61 is used to acquire the image information of the reference object corresponding to the identification information from a preset database according to the identification information of the object to be inspected; wherein the image information includes a reference feature sequence and a focal length corresponding to a plurality of reference images; wherein the reference image is obtained by photographing the reference object with a macro camera at a focal length corresponding to the reference image;

[0086] A focal length setting module 62, configured to set the focal length of the macro camera to a target focal length according to the focal lengths respectively corresponding to the plurality of reference images;

[0087] An image shooting module 63 is used to control the macro camera to shoot the object to be inspected at a target focal length to obtain an image to be inspected;

[0088] The feature sequence acquisition module 64 is used to acquire the feature sequence to be inspected of the image to be inspected;

[0089] The identity detection module 65 is used to detect the identity of the object to be inspected and the reference object according to the feature sequence to be inspected of the image to be inspected and the reference feature sequences corresponding to the multiple reference images.

[0090] The above device uses a macro camera instead of an optical microscope to obtain an image of the object to be inspected, thereby reducing the equipment cost of the inspection; by storing the reference image and the focal length corresponding to the reference image in the database, the focal length corresponding to the reference image can be used in the inspection stage, without the need for multiple manual focusing adjustments, thus saving labor costs and improving the inspection efficiency. At the same time, multiple reference images with different focal lengths provide more features for the inspection, ensuring the stability and reliability of the inspection results; in addition, the identity detection of the object can be completed through the feature sequence of the image to be inspected and the reference feature sequence corresponding to the multiple reference images, thereby improving the automation of the identity detection.

[0091] The focal length difference between the focal lengths corresponding to the above-mentioned multiple reference images is a value within a preset range; accordingly, the above-mentioned focal length setting module 62 is also used to select a focal length from the focal lengths corresponding to the multiple reference images as the target focal length; send a focus instruction to the macro camera to trigger the macro camera to set the current focal length to the target focal length; wherein the focus instruction includes the target focal length. When the focal length difference between the reference images is relatively small, one of them can be selected as the target focal length, and the macro camera focus can be automatically controlled, which simplifies the camera focus process and improves the convenience of detection.

[0092] The image information also includes the outline information of the reference object; accordingly, the focal length setting module 62 is also used to display the outline information of the reference object through the graphical user interface of the terminal device after setting the focal length of the macro camera to the target focal length; display the preview image of the object to be inspected acquired by the macro camera at the target focal length at the display position of the outline information of the reference object; adjust the placement of the object to be inspected according to the preview image and the outline information so that the preview image matches the outline information. By guiding the placement of the object to be inspected by the outline information of the reference image, the shooting angle of the object to be inspected can be consistent with the shooting angle of the reference object, so that the feature detection result between the image to be inspected and the reference image is more reliable.

[0093] When the above device is applied to a terminal device, the terminal device can also be connected to a server; accordingly, the feature sequence acquisition module 64 is also used to upload the image to be inspected to the server; and receive the feature sequence to be inspected extracted by the server from the image to be inspected. Extracting the features of the image to be inspected through the server reduces the requirements of the terminal device.

[0094] As a possible implementation, the identity detection module 65 is also used to determine a target reference feature sequence from reference feature sequences corresponding to a plurality of reference images; detect whether the object to be detected matches the reference object based on the reference feature sequence of the image to be detected and the target reference feature sequence; if the object to be detected does not match the reference object, reselect a target reference feature sequence from the reference feature sequences corresponding to the plurality of reference images and continue detection; if the object to be detected matches the reference object, determine that the object to be detected and the reference object are the same object. By detecting the reference feature sequences of a plurality of reference images and the reference feature sequences to be detected, the detection result can be made more accurate.

[0095] As a possible implementation, the identity detection module 65 is also used to search for features that match features in the feature sequence to be detected of the image to be detected from the target reference feature sequence to obtain a first matching feature set; search for features that match features in the feature sequence to be detected of the image to be detected from the feature sequence to be detected of the target reference feature sequence to obtain a second matching feature set; perform abnormal feature elimination operations on the first matching feature set and the second matching feature set, respectively, to obtain a first optimized feature set corresponding to the first matching feature set and a second optimized feature set corresponding to the second matching feature set; determine whether the object to be detected matches the reference object based on the first optimized feature set and the second optimized feature set. Through the abnormal feature elimination operation, the first matching feature set and the second matching feature set can be optimized to improve the accuracy of the detection result.

[0096] As a possible implementation, the identity detection module 65 is further used to check the vector distances between the matching features in the first matching feature set and the second matching feature set respectively; for the same feature, if there are at least two other features whose vector distance difference with the same feature is less than a first preset value, the same feature and its matching features are deleted. By optimizing the first matching feature set and the second matching feature set by vector distance, the accuracy of the detection result can be improved.

[0097] As a possible implementation, the identity detection module 65 is also used to determine the intersection of the first optimized feature set and the second optimized feature set to obtain an intersection set; determine the minimum number of features in the first optimized feature set and the second optimized feature set; calculate the ratio of the number of features in the intersection set to the minimum number of features; if the ratio is greater than a second preset value, determine that the object to be inspected matches the reference object. Through this calculation method, the number of features that match between the image to be inspected and the reference image can be determined, and then whether the two objects match, which is simple to implement and reliable.

[0098] This embodiment also provides an article identity detection system, which includes a terminal device, a macro camera connected to the terminal device, and the macro camera includes a digital camera and a variable-focus lens; Figure 1 As shown, the terminal device is used to obtain image information of a reference object corresponding to the identification information from a preset database according to the identification information of the object to be inspected; wherein the image information includes a reference feature sequence and a focal length corresponding to a plurality of reference images; wherein the reference image is obtained by photographing the reference object with a macro camera at a focal length corresponding to the reference image; and the focal length of the macro camera is set to a target focal length according to the focal lengths respectively corresponding to the plurality of reference images; the macro camera is used to photograph the object to be inspected at the target focal length under the control of the terminal device to obtain an image to be inspected; and the image to be inspected is sent to the terminal device; accordingly, the terminal device is also used to obtain a feature sequence to be inspected of the image to be inspected, and detect the identity of the object to be inspected with the reference object according to the feature sequence to be inspected of the image to be inspected and the reference feature sequences corresponding to the plurality of reference images.

[0099] The system uses a macro camera with a digital camera and a zoom lens to obtain images of the objects to be inspected, replacing the optical microscope in this way, reducing the equipment cost of the inspection; by saving the reference image and the focal length corresponding to the reference image in the database, the focal length corresponding to the reference image can be used in the inspection stage, without the need for multiple manual focusing adjustments, saving labor costs and improving inspection efficiency. At the same time, multiple reference images with different focal lengths provide more features for inspection, ensuring the stability and reliability of the inspection results; in addition, the identity detection of the objects can be completed through the feature sequence of the image to be inspected and the reference feature sequence corresponding to multiple reference images, improving the automation of the identity detection.

[0100] Furthermore, the terminal device may include Figure 6 The device shown and the functions of the device will not be described in detail here.

[0101] As a possible implementation, the system further includes a server connected to the terminal device, which may include the database. The operations of obtaining the feature sequence to be inspected of the image to be inspected and detecting the identity of the object to be inspected with the reference object based on the feature sequence to be inspected of the image to be inspected and the reference feature sequence corresponding to multiple reference images performed by the terminal device may be performed by the server. This may reduce the requirements on the terminal device and improve the detection efficiency of the terminal device.

[0102] The object identity detection device or system provided in the embodiments of the present disclosure has the same implementation principle and technical effects as those of the aforementioned method embodiments. For the sake of brief description, for matters not mentioned in the embodiments of the object identity detection device or system, reference may be made to the corresponding contents in the aforementioned object identity detection method embodiments.

[0103] The term "and / or" herein is only a description of the association relationship of the associated objects, indicating that there may be three relationships. For example, A and / or B can represent: A exists alone, A and B exist at the same time, and B exists alone. In addition, the term "at least one" herein represents any combination of at least two of any one or more of a plurality of. For example, including at least one of A, B, and C can represent including any one or more elements selected from the set consisting of A, B, and C.

[0104] The present disclosure also provides an electronic device, such as Figure 7 As shown, it is a schematic diagram of the structure of the electronic device, wherein the electronic device includes a processor 71 and a memory 70, the memory 70 stores computer executable instructions that can be executed by the processor 71, and the processor 71 executes the computer executable instructions to implement the above-mentioned object identity detection method.

[0105] exist Figure 7 In the illustrated embodiment, the electronic device further includes a bus 72 and a communication interface 73 , wherein the processor 71 , the communication interface 73 and the memory 70 are connected via the bus 72 .

[0106] Among them, the memory 70 may include a high-speed random access memory (RAM), and may also include a non-volatile memory (non-volatile memory), such as at least one disk storage. The communication connection between the system network element and at least one other network element is realized through at least one communication interface 73 (which can be wired or wireless), and the Internet, wide area network, local area network, metropolitan area network, etc. can be used. The bus 72 can be an ISA (Industry Standard Architecture) bus, a PCI (Peripheral Component Interconnect) bus or an EISA (Extended Industry Standard Architecture) bus, etc. The bus 72 can be divided into an address bus, a data bus, a control bus, etc. For ease of representation, Figure 7 Only one bidirectional arrow is used in the diagram, but this does not mean that there is only one bus or only one type of bus.

[0107] The processor 71 may be an integrated circuit chip with signal processing capabilities. In the implementation process, each step of the above method can be completed by the hardware integrated logic circuit in the processor 71 or the instruction in the form of software. The above processor 71 can be a general-purpose processor, including a central processing unit (CPU), a network processor (NP), etc.; it can also be a digital signal processor (DSP), an application-specific integrated circuit (ASIC), a field-programmable gate array (FPGA), or other programmable logic devices, discrete gates or transistor logic devices, discrete hardware components. The general-purpose processor can be a microprocessor or the processor can also be any conventional processor. The steps of the method disclosed in conjunction with the embodiment of the present disclosure can be directly embodied as a hardware decoding processor to be executed, or a combination of hardware and software modules in the decoding processor can be executed. The software module can be located in a mature storage medium in the field such as a random access memory, a flash memory, a read-only memory, a programmable read-only memory, or an electrically erasable programmable memory, a register, etc. The storage medium is located in the memory, and the processor 71 reads the information in the memory and completes the steps of the object identity detection method of the above-mentioned embodiment in combination with its hardware.

[0108] The embodiments of the present disclosure also provide a computer-readable storage medium, which stores computer-executable instructions. When the computer-executable instructions are called and executed by a processor, the computer-executable instructions prompt the processor to implement the above-mentioned object identity detection method. The specific implementation can be found in the above-mentioned method embodiment, which will not be repeated here.

[0109] The computer program products of the object identity detection method, device and electronic device provided in the embodiments of the present disclosure include a computer-readable storage medium storing program code. The instructions included in the program code can be used to execute the methods described in the previous method embodiments. The specific implementation can be found in the method embodiments, which will not be repeated here.

[0110] Unless otherwise specifically stated, the relative steps, numerical expressions and numerical values ​​of the components and steps set forth in these embodiments do not limit the scope of the present disclosure.

[0111] If the functions are implemented in the form of software functional units and sold or used as independent products, they can be stored in a non-volatile computer-readable storage medium that can be executed by a processor. Based on this understanding, the technical solution of the present disclosure, or the part that contributes to the prior art or the part of the technical solution, can be embodied in the form of a software product, which is stored in a storage medium and includes several instructions for a computer device (which can be a personal computer, a server, or a network device, etc.) to perform all or part of the steps of the method described in each embodiment of the present disclosure. The aforementioned storage medium includes: various media that can store program codes, such as a USB flash drive, a mobile hard disk, a read-only memory (ROM), a random access memory (RAM), a magnetic disk or an optical disk.

[0112] In the description of the present disclosure, it should be noted that the terms "center", "upper", "lower", "left", "right", "vertical", "horizontal", "inner", "outer", etc., indicating the orientation or positional relationship, are based on the orientation or positional relationship shown in the drawings, and are only for the convenience of describing the present disclosure and simplifying the description, rather than indicating or implying that the device or element referred to must have a specific orientation, be constructed and operated in a specific orientation, and therefore cannot be understood as a limitation of the present disclosure. In addition, the terms "first", "second", and "third" are used for descriptive purposes only, and cannot be understood as indicating or implying relative importance.

[0113] Finally, it should be noted that the above-described embodiments are only specific implementation methods of the present disclosure, which are used to illustrate the technical solutions of the present disclosure, rather than to limit them. The protection scope of the present disclosure is not limited thereto. Although the present disclosure is described in detail with reference to the above-described embodiments, ordinary technicians in the field should understand that any technician familiar with the technical field can still modify the technical solutions recorded in the above-described embodiments within the technical scope disclosed in the present disclosure, or can easily think of changes, or make equivalent replacements for some of the technical features therein; and these modifications, changes or replacements do not make the essence of the corresponding technical solutions deviate from the spirit and scope of the technical solutions of the embodiments of the present disclosure, and should be included in the protection scope of the present disclosure. Therefore, the protection scope of the present disclosure should be based on the protection scope of the claims.

Claims

1. A method for detecting the identity of an object, characterized in that: The method comprises: According to the identification information of the object to be inspected, image information of the reference object corresponding to the identification information is obtained from a preset database; wherein the image information includes a reference feature sequence and a focal length corresponding to a plurality of reference images; the reference image is obtained by photographing the reference object with a macro camera at a focal length corresponding to the reference image; Setting the focal length of the macro camera as a target focal length according to the focal lengths respectively corresponding to the plurality of reference images; Controlling the macro camera to photograph the object to be inspected at the target focal length to obtain an image to be inspected; Acquire a feature sequence to be inspected of the image to be inspected; The identity of the object to be inspected and the reference object is detected according to the feature sequence to be inspected of the image to be inspected and the reference feature sequences corresponding to the plurality of reference images.

2. The method according to claim 1, characterized in that The focal length difference between the focal lengths respectively corresponding to the plurality of reference images is a value within a preset range; and setting the focal length of the macro camera as a target focal length according to the focal lengths respectively corresponding to the plurality of reference images comprises: Selecting a focal length from the focal lengths respectively corresponding to the plurality of reference images as a target focal length; A focus instruction is sent to the macro camera to trigger the macro camera to set the current focal length to the target focal length; wherein the focus instruction includes the target focal length.

3. The method according to claim 1, characterized in that The image information also includes the outline information of the reference object; after the step of setting the focal length of the macro camera to the target focal length, the method further includes: Displaying the contour information of the reference object through a graphical user interface of a terminal device; Displaying a preview image of the object to be inspected acquired by the macro camera at the target focal length at a display position of the outline information of the reference object; The placement of the object to be inspected is adjusted according to the preview image and the contour information so that the preview image matches the contour information.

4. The method according to claim 1, characterized in that: The feature sequence to be inspected for obtaining the image to be inspected includes: Uploading the image to be inspected to a server; Receive the feature sequence to be detected extracted by the server from the image to be detected.

5. The method according to claim 1, characterized in that Detecting the identity of the object to be inspected and the reference object according to the feature sequence to be inspected of the image to be inspected and the reference feature sequences corresponding to the plurality of reference images includes: Determine a target reference feature sequence from reference feature sequences corresponding to a plurality of the reference images; Detecting whether the object to be inspected matches the reference object according to the feature sequence to be inspected of the image to be inspected and the target reference feature sequence; If the object to be inspected does not match the reference object, reselecting a target reference feature sequence from the reference feature sequences corresponding to the plurality of reference images and continuing the inspection; If the object to be inspected matches the reference object, it is determined that the object to be inspected and the reference object are the same object.

6. The method according to claim 5, characterized in that Detecting whether the object to be inspected matches the reference object according to the feature sequence to be inspected of the image to be inspected and the target reference feature sequence includes: Searching for features in the target reference feature sequence that match features in the feature sequence to be inspected of the image to be inspected to obtain a first matching feature set; searching for features in the feature sequence to be inspected of the image to be inspected that match features in the target reference feature sequence to obtain a second matching feature set; Performing abnormal feature elimination operations on the first matching feature set and the second matching feature set respectively to obtain a first optimized feature set corresponding to the first matching feature set and a second optimized feature set corresponding to the second matching feature set; Determine whether the object to be inspected matches the reference object according to the first optimized feature set and the second optimized feature set.

7. The method according to claim 6, characterized in that Performing abnormal feature elimination operations on the first matching feature set and the second matching feature set respectively includes: respectively checking vector distances between matching features in the first matching feature set and the second matching feature set; For the same feature, if there are at least two other features whose vector distance difference with the same feature is less than a first preset value, the same feature and its matching features are deleted.

8. The method according to claim 6, characterized in that Determining whether the object to be inspected matches the reference object according to the first optimized feature set and the second optimized feature set includes: Determine the intersection of the first optimization feature set and the second optimization feature set to obtain an intersection set; Determining a minimum number of features in the first optimized feature set and the second optimized feature set; Calculating the ratio of the number of features in the intersection set to the minimum number of features; If the ratio is greater than a second preset value, it is determined that the object to be inspected matches the reference object.

9. An article identity detection device, characterized in that: The device comprises: An image information acquisition module is used to acquire image information of a reference object corresponding to the identification information from a preset database according to the identification information of the object to be inspected; wherein the image information includes a reference feature sequence and a focal length corresponding to a plurality of reference images; the reference image is obtained by photographing the reference object with a macro camera at a focal length corresponding to the reference image; A focal length setting module, used to set the focal length of the macro camera to a target focal length according to the focal lengths respectively corresponding to the plurality of reference images; An image shooting module, used for controlling the macro camera to shoot the object to be inspected at the target focal length to obtain an image to be inspected; A feature sequence acquisition module is used to acquire a feature sequence to be inspected of an image to be inspected; The identity detection module is used to detect the identity of the object to be inspected and the reference object according to the feature sequence to be inspected of the image to be inspected and the reference feature sequences corresponding to the plurality of reference images.

10. An article identity detection system, characterized in that: The system includes a terminal device, and a macro camera connected to the terminal device; The terminal device is used to obtain image information of a reference object corresponding to the identification information from a preset database according to the identification information of the object to be inspected; wherein the image information includes a reference feature sequence and a focal length corresponding to a plurality of reference images; wherein the reference image is obtained by photographing the reference object with the macro camera at a focal length corresponding to the reference image; and the focal length of the macro camera is set as a target focal length according to the focal lengths respectively corresponding to the plurality of reference images; The macro camera is used to photograph the object to be inspected at the target focal length under the control of the terminal device to obtain an image to be inspected; and send the image to be inspected to the terminal device; The terminal device is also used to obtain the feature sequence to be inspected of the image to be inspected, and detect the identity of the object to be inspected and the reference object according to the feature sequence to be inspected of the image to be inspected and the reference feature sequences corresponding to the multiple reference images.

11. An electronic device, characterized in that: The invention comprises a processor and a memory, wherein the memory stores computer executable instructions that can be executed by the processor, and the processor executes the computer executable instructions to implement the method according to any one of claims 1 to 8.

12. A computer-readable storage medium, characterized in that: The computer-readable storage medium stores computer-executable instructions, and when the computer-executable instructions are called and executed by a processor, the computer-executable instructions prompt the processor to implement the method according to any one of claims 1 to 8.