An image search method, device, electronic equipment and storage medium

By acquiring image sequences in the image search method and comparing images at preset intervals, the first dissimilar image pair is determined, which solves the problem of low image comparison efficiency in the prior art and realizes efficient image comparison and intelligent image search results.

CN116910286BActive Publication Date: 2025-11-04HANGZHOU HIKVISION SYST TECH CO LTD
View PDF 1 Cites 0 Cited by

Patent Information

Application Number
CN202310708210.5
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2023-06-14
Publication Date
2025-11-04
Estimated Expiration
2043-06-14

AI Technical Summary

Technical Problem

In existing technologies, the time change point of vehicle entry and exit status is determined by comparing every two adjacent images, which is inefficient and leads to frequent cases of missed detection of vehicle entry or exit.

Method used

An image search method is used to obtain the image sequence to be searched and to obtain multiple images as the first comparison images according to a preset image number interval. Each pair of adjacent images is compared, and the first dissimilar image pair is determined based on the similarity of the image sequence to be compared, which is used as the image search result.

Benefits of technology

It improves image comparison efficiency, reduces comparison time, provides intelligent image search results, reduces manual intervention, and improves the work efficiency of staff.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN116910286B_ABST
    Figure CN116910286B_ABST
Patent Text Reader

Abstract

Embodiments of the present application provide an image search method and device, electronic equipment and storage medium, the method comprising: acquiring a to-be-searched image sequence, and acquiring a plurality of images from the to-be-searched image sequence as first comparison images according to a preset image number interval; sequentially comparing each two adjacent images in the first comparison images to obtain a first pair of dissimilar images; determining a first pair of dissimilar images in the to-be-searched image sequence as an image search result based on the similarity of a to-be-compared image sequence, wherein the to-be-compared image sequence is an image sequence in the to-be-searched image sequence, and the two images included in the image sequence are respectively the start position and the end position. The embodiments of the present application can reduce the image comparison time and improve the image comparison efficiency. At the same time, the image search result can provide intelligent reference for the staff, without manual image comparison, thereby improving the work efficiency of the staff.
Need to check novelty before this filing date? Find Prior Art

Description

TECHNICAL FIELD

[0001] The present application relates to the technical field of image search, in particular to an image search method and device, electronic equipment and storage medium. BACKGROUND

[0002] With the integration of new generation information technologies such as Internet, big data and artificial intelligence in various industries, image search is widely used. In many scenarios, a large number of image sequences need to be compared to determine the dissimilar image pairs in the image sequences.

[0003] For example, in a scenario of determining whether the in-out vehicle state of a vehicle in a parking area changes, a trained model is used to detect the captured vehicle image to determine the in-out vehicle state of the vehicle. However, when the trained model is used to determine the in-out vehicle state of the vehicle, the vehicle out or in may still be missed. In order to make up for the missed vehicle out or in, the image acquisition device will capture the scene image as a second image at regular intervals and upload it to the business platform for display. In this way, the staff can compare each two adjacent images in the second image sequence displayed on the business platform in turn to determine the time change point of the missed vehicle out or in, so as to supplement the vehicle out or in.

[0004] However, the staff spends a long time in determining the time change point of the vehicle out or in by comparing each two adjacent images. SUMMARY

[0005] The purpose of the embodiments of the present application is to provide an image search method, device, electronic equipment and storage medium to improve the image comparison efficiency. The specific technical solutions are as follows:

[0006] In a first aspect, the embodiments of the present application provide an image search method, which comprises:

[0007] Obtaining a to-be-searched image sequence, and obtaining a plurality of images from the to-be-searched image sequence according to a preset image number interval as first comparison images;

[0008] Comparing each two adjacent images in the first comparison images in turn to obtain a first dissimilar image pair;

[0009] Determining a first dissimilar adjacent image in the to-be-searched image sequence from a to-be-compared image sequence as an image search result based on the similarity of the to-be-compared image sequence, wherein the to-be-compared image sequence is an image sequence in the to-be-searched image sequence, and the two images included in the image pair are the starting position and the ending position, respectively.

[0010] Optionally, the step of determining the first non-similar adjacent image in the image sequence to be searched from the image sequence to be compared based on the similarity of the image sequence to be compared comprises:

[0011] determining an image number interval according to a preset rule based on the number of the candidate images, wherein the candidate images are image sequences in the image sequence to be searched, and two images included in a last obtained image pair by comparison are a start position and an end position respectively;

[0012] obtaining a plurality of images from the candidate images as second comparison images according to the image number interval;

[0013] sequentially comparing each two adjacent images in the second comparison images to obtain a first non-similar image pair;

[0014] if the image pair is adjacent images in the image sequence to be searched, determining that the image pair is an image search result.

[0015] Optionally, the method further comprises:

[0016] if the image pair is not adjacent images in the image sequence to be searched, returning to the step of determining the image number interval according to the preset rule based on the number of the candidate images until two images included in the obtained image pair are adjacent images in the image sequence to be searched, wherein the image number interval determined each time according to the preset rule is smaller than the image number interval determined last time.

[0017] Optionally, the method further comprises:

[0018] if there is no non-similar image pair in the second comparison images, sequentially comparing each two adjacent images in the first comparison images starting from a latter image included in the first non-similar image pair to obtain a first non-similar image pair;

[0019] returning to the step of determining the first non-similar adjacent image in the image sequence to be searched from the image sequence to be compared based on the similarity of the image sequence to be compared as an image search result.

[0020] Optionally, the way of sequentially comparing each two adjacent images comprises:

[0021] calculating the similarity between the two adjacent images based on image features of the two adjacent images;

[0022] determining a target similarity threshold according to the image number interval corresponding to the current comparison and a preset corresponding relationship between the similarity threshold and the image number interval;

[0023] determine whether the two adjacent images are similar based on a size relationship between the similarity and the target similarity threshold.

[0024] Optionally, the image sequence to be searched is a snapshot vehicle second image sequence of a parking area.

[0025] After the step of determining the first dissimilar adjacent image in the image sequence to be searched from the image sequence to be compared based on the similarity of the image sequence to be compared, as the image search result, the method further comprises:

[0026] determining that the snapshot time point corresponding to the image search result is a time change point of an in-out vehicle state, so that a staff member records an in-out vehicle state based on the time change point of the in-out vehicle state and the image search result.

[0027] In a second aspect, an embodiment of the present application provides an image search device, and the device comprises:

[0028] a first comparison image acquisition module configured to acquire an image sequence to be searched and acquire a plurality of images from the image sequence to be searched as first comparison images according to a preset image quantity interval.

[0029] a first dissimilar image pair acquisition module configured to sequentially compare each two adjacent images in the first comparison images to obtain a first dissimilar image pair.

[0030] an image search result determination module configured to determine the first dissimilar adjacent image in the image sequence to be searched from an image sequence to be compared based on the similarity of the image sequence to be compared, as an image search result, wherein the image sequence to be compared is an image sequence in the image sequence to be searched, with two images included in the image pair being a starting position and a terminal position, respectively.

[0031] Optionally, the image search result determination module comprises

[0032] an image quantity interval determination submodule configured to determine an image quantity interval according to a preset rule based on a quantity of candidate images, wherein the candidate images are images in the image sequence to be searched, with two images included in a last comparison image pair being a starting position and a terminal position, respectively.

[0033] a second comparison image acquisition submodule configured to acquire a plurality of images from the candidate images as second comparison images according to the image quantity interval.

[0034] a dissimilar image pair acquisition submodule configured to sequentially compare each two adjacent images in the second comparison images to obtain a first dissimilar image pair.

[0035] The image search result determining submodule is configured to determine the image pair as the image search result if the image pair is adjacent images in the image sequence to be searched.

[0036] Optionally, the device further comprises:

[0037] The dissimilar adjacent image obtaining module is configured to, if the image pair is not adjacent images in the image sequence to be searched, return the number of alternative images, and determine the image number interval according to the preset rule until the two images included in the obtained image pair are adjacent images in the image sequence to be searched, wherein the image number interval determined each time is less than the image number interval determined last time.

[0038] Optionally, the device further comprises:

[0039] The dissimilar image pair obtaining module is configured to, if there is no dissimilar image pair in the second comparison image, sequentially compare each two adjacent images in the first comparison image from the latter image included in the first dissimilar image pair to obtain the first dissimilar image pair.

[0040] The image search result executing module is configured to return the similarity based on the image sequence to be compared, and determine the first dissimilar adjacent image in the image sequence to be searched from the image sequence to be compared as the step of image search result.

[0041] Optionally, the device further comprises an adjacent image comparison module, and the adjacent image comparison module is configured to sequentially compare each two adjacent images, comprising:

[0042] The similarity calculating submodule is configured to calculate the similarity between the two adjacent images based on the image features of the two adjacent images.

[0043] The target similarity threshold determining submodule is configured to determine the target similarity threshold according to the corresponding relationship between the image number interval corresponding to the current comparison and the preset similarity threshold and the image number interval.

[0044] The similar image determining submodule is configured to determine whether the two adjacent images are similar based on the size relationship between the similarity and the target similarity threshold.

[0045] Optionally, the image sequence to be searched is a snapshot vehicle second image sequence of a parking area.

[0046] The device further comprises:

[0047] The time change point determination module is configured to determine, after the step of determining, based on the similarity of the image sequence to be compared, the first similar adjacent image in the image sequence to be searched from the image sequence to be compared as the image search result, a corresponding snapshot time point of the image search result as an in-out vehicle state time change point, so that a staff member records an in-out vehicle state based on the in-out vehicle state time change point and the image search result.

[0048] In a third aspect, an electronic device is provided, including:

[0049] a memory configured to store a computer program;

[0050] a processor configured to execute the computer program stored in the memory to implement the method of any of the first aspect.

[0051] In a fourth aspect, a computer readable storage medium is provided, and the computer readable storage medium stores a computer program. The computer program is executed by a processor to implement the method of any of the first aspect.

[0052] The embodiments of the present application have the following beneficial effects:

[0053] The embodiments of the present application provide the following scheme. An electronic device can obtain an image sequence to be searched, and obtain a plurality of images from the image sequence to be searched according to a preset image quantity interval, as first comparison images. The electronic device sequentially compares each two adjacent images in the first comparison images to obtain a first pair of non-similar images. The electronic device determines, based on the similarity of an image sequence to be compared, the first similar adjacent image in the image sequence to be searched from the image sequence to be compared as an image search result. The image sequence to be compared is an image sequence in which two images included in an image pair are respectively a starting position and a terminal position. Since the first comparison images are obtained according to the preset image quantity interval, the first pair of non-similar images is obtained from the first comparison images, and then the non-similar adjacent images are obtained from the image sequence in which the two images included in the image pair are respectively the starting position and the terminal position, as the image search result. In this way, the electronic device does not need to compare each two adjacent images in the image sequence to be searched, which can reduce the image comparison time and improve the image comparison efficiency. Meanwhile, the image search result can provide intelligent reference for a staff member, and the staff member does not need to manually compare images, thereby improving the work efficiency of the staff member. Of course, any product or method of the present application does not necessarily need to achieve all the advantages described above at the same time. BRIEF DESCRIPTION OF DRAWINGS

[0054] In order to more clearly illustrate the technical solutions in the embodiments of the present application or the prior art, the accompanying drawings needed to be used in the description of the embodiments or the prior art will be briefly introduced. Obviously, the accompanying drawings in the following description only represent some embodiments of the present application, and other embodiments can be obtained by those of ordinary skill in the art based on these drawings.

[0055] Figure 1 A flow chart of an image search method provided by an embodiment of the present application;

[0056] Figure 2 An embodiment based on Figure 1 A schematic diagram of determining dissimilar adjacent images in the embodiment shown in FIG. 2;

[0057] Figure 3 An embodiment based on Figure 1 A specific flow chart of step S103 in the embodiment shown in FIG. 3;

[0058] Figure 4 An embodiment based on Figure 1 A specific flow chart of determining whether images are similar in the embodiment shown in FIG. 4;

[0059] Figure 5 An embodiment based on Figure 1 A schematic diagram of cropping images in a sequence of images to be searched in the embodiment shown in FIG. 5;

[0060] Figure 6 A specific flow chart of an image search method provided by an embodiment of the present application;

[0061] Figure 7 A schematic diagram of an image search method provided by an embodiment of the present application;

[0062] Figure 8 A structural schematic diagram of an image search device provided by an embodiment of the present application;

[0063] Figure 9 A structural schematic diagram of an electronic device provided by an embodiment of the present application. DETAILED DESCRIPTION

[0064] The technical solutions in the embodiments of the present application will be described clearly and completely below with reference to the accompanying drawings in the embodiments of the present application. Obviously, the described embodiments only represent some embodiments of the present application, rather than all the embodiments. Based on the embodiments in the present application, all other embodiments obtained by those of ordinary skill in the art based on the present application belong to the scope of protection of the present application.

[0065] To improve the image comparison efficiency, an image search method, device, electronic device, computer readable storage medium and computer program product are provided in the embodiments of the present application. First, an image search method provided in the embodiments of the present application is introduced.

[0066] The image search method provided in the embodiments of the present application can be applied to any device that needs to search for dissimilar images, for example, a notebook computer, a server, an image processor, a desktop computer, etc., which are not specifically limited here. For the sake of clarity, the following is referred to as an electronic device.

[0067] As shown in Figure 1 An image search method, the method comprising:

[0068] S101, obtaining a to-be-searched image sequence, and obtaining a plurality of images from the to-be-searched image sequence according to a preset image number interval as first comparison images;

[0069] S102, sequentially comparing each two adjacent images in the first comparison images to obtain a first dissimilar image pair;

[0070] S103, determining a first dissimilar adjacent image in the to-be-searched image sequence as an image search result based on the similarity of a to-be-compared image sequence.

[0071] The to-be-compared image sequence is an image sequence in the to-be-searched image sequence, in which the two images included in the image pair are respectively the starting position and the ending position.

[0072] It can be seen that in the scheme provided in the embodiments of the present application, the electronic device can acquire a to-be-searched image sequence, and acquire a plurality of images from the to-be-searched image sequence as first comparison images according to a preset image number interval. The first comparison images are sequentially compared with each other, and a first pair of dissimilar images is obtained. Based on the similarity of the to-be-compared image sequence, the first pair of dissimilar images in the to-be-searched image sequence is determined from the to-be-compared image sequence as an image search result, wherein the to-be-compared image sequence is an image sequence in which the two images included in the image pair are respectively the starting position and the ending position. Since the first comparison images are acquired according to the preset image number interval, the first pair of dissimilar images is obtained from the first comparison images, and then the dissimilar adjacent images are acquired from the image sequence in which the two images included in the image pair are respectively the starting position and the ending position as the image search result. In this way, it is not necessary to compare each pair of adjacent images in the to-be-searched image sequence, which can reduce the image comparison time and improve the image comparison efficiency. At the same time, the image search result can provide intelligent reference for the staff, and it is not necessary to manually compare the images, thereby improving the work efficiency of the staff.

[0073] In order to find the first pair of dissimilar images in the image sequence, the electronic device can coarsely locate the first pair of dissimilar images based on a certain interval, that is, determine the approximate range of the first pair of dissimilar images in the to-be-searched image sequence, and then gradually narrow the interval to accurately locate the first pair of dissimilar images until the first pair of dissimilar images is found.

[0074] In step S101, the electronic device can acquire a to-be-searched image sequence, and acquire a plurality of images from the to-be-searched image sequence as first comparison images according to a preset image number interval. The to-be-searched image sequence can be a second image set, and the second image is an image captured and uploaded by an image acquisition device at a fixed time. Generally, the image acquisition device can capture and upload an image every 2 minutes, and of course the capture time can be set according to actual needs, for example, 1 minute, 3 minutes, etc.

[0075] Since the number of images acquired by the electronic device in the first comparison images is related to the size of the preset image number interval, for any to-be-searched image sequence, the larger the preset image number interval, the fewer the number of images acquired by the electronic device, and the smaller the preset image number interval, the more the number of images acquired by the electronic device. Therefore, the preset image number interval can be set according to the number of images in the to-be-searched image sequence and actual experience. For example, if the number of images in the to-be-searched image sequence is greater than 30, the preset image number interval can be set to 30, and if the number of images in the to-be-searched image sequence is in the range of [6, 30], the preset image number interval can be set to 5.

[0076] In one implementation, the electronic device can group the sequence of images to be searched according to a preset image number interval, resulting in multiple image groups. If, during the grouping process, the number of remaining images is less than the preset image number interval, the remaining images can be grouped together, and the first image in each group can be used as the first comparison image. To ensure the temporal integrity of the images in the first comparison image, the first comparison image should include the last image in the sequence of images to be searched.

[0077] In other words, when the electronic device groups the image sequence to be searched according to a preset number of image intervals, if there is one image left at the end, that is, the last image in the image sequence to be searched, then that image is treated as an image group; if there are multiple images left at the end, the last image needs to be treated as a separate image group. In this way, when the electronic device obtains the first image of each group, it can obtain the last image of the image sequence to be searched, which is used as the image in the first comparison image, so that the first comparison image has temporal integrity.

[0078] For example, such as Figure 2 As shown, the image sequence to be searched includes n images, numbered 1, 2, ..., n, with a preset image quantity interval of k. The electronic device groups the image sequence to be searched according to the preset image quantity interval, that is, the images at corresponding positions in each group are separated by a distance of k, resulting in X = [n / k] image groups, where [n / k] represents rounding up, meaning that if the number of remaining images is less than k, the remaining images are also treated as a separate group.

[0079] If only one image remains at the end, i.e., A n , will A n As an image group, the electronic device acquires the first image of each image group, thus obtaining X images, namely A1, A2, A3, A4, A5, A6, A7, A8, A9, A1, A1, A9, A1, A1, A2 ... 1+k A 1+2k ...A 1+(X-1)k (i.e. A) n The first image to be compared is selected. If multiple images remain at the end, the last image (A) needs to be selected. n As an image group, the electronic device acquires the first image of each image group, thus obtaining X+1 images, namely A1, A2, A3, A4, A5, A6, A7, A8, A9, A1, A1, A1, A1, A1, A2 ... 1+k A 1+2k ...A 1+(X-1)k A n .

[0080] After the electronic device acquires the first comparison image, in step S102, the electronic device can sequentially compare every two adjacent images in the first comparison image to obtain the first dissimilar image pair. In one embodiment, the electronic device can calculate the similarity between every two adjacent images, and then determine the first dissimilar image pair from the first comparison image.

[0081] Since the image sequence to be searched is continuous in time (i.e., the images in the sequence are arranged in chronological order), the first comparison image is also continuous in time. Specifically, for any two adjacent images in the first comparison image, the time corresponding to the preceding image is earlier than the time corresponding to the following image. Thus, when the electronic device obtains the first dissimilar image pair, it has completed the rough location of the first dissimilar adjacent image. That is, the first dissimilar adjacent image is located in the image sequence whose starting and ending positions are the two images included in the image pair.

[0082] For example, such as Figure 2 As shown, the electronic device acquires the first comparison images, which are A1 and A2, respectively. 1+k A 1+2k ...A 1+(X-1)k It can be used for A1, A 1+k A 1+2k ...A 1+(X-1)k The electronic device compares each pair of adjacent images sequentially. Specifically, it compares A1 and A... 1+k Perform a comparison, that is, calculate A1 and A 1+k The similarity is used to determine similarity. If the determination result is dissimilar, the first dissimilar image pair A1 and A2 is obtained. 1+k If the determination result is similar, then continue with A. 1+k and A 1+2k Compare and calculate A in the same way. 1+k and A 1+2k The similarity is used to determine similarity.

[0083] If we are targeting A 1+k and A 1+2k If the determination result is dissimilar, then the first dissimilar image pair A is obtained. 1+k and A 1+2k If the comparison result is similar, the process continues to compare the next two adjacent images until the first dissimilar image pair A is obtained. t and A t+k Therefore, the first dissimilar neighboring image is located at A. t and A t+k Within the range. If the first dissimilar image pair is not found, it means that there are no dissimilar image pairs in the image sequence to be searched, that is, there is no state change point of the target corresponding to the image in the actual scene.

[0084] Since the first dissimilar image pair obtained by the electronic device is not an adjacent image, the first dissimilar adjacent image is located in the image sequence with the two images included in the image pair as the start position and the end position, respectively. Therefore, it is necessary to continue searching in the image sequence with the two images included in the image pair as the start position and the end position, respectively, until the first dissimilar adjacent image is found.

[0085] In one implementation, the electronic device can determine the first dissimilar neighboring image in the search image sequence based on the similarity of the image sequences to be compared, and use this as the image search result, i.e., execute step S103. The image sequence to be compared is an image sequence in the search image sequence where each image pair comprises an image sequence with a start position and an end position, respectively. The similarity of the image sequences to be compared can be obtained by calculating the Hamming distance between every two adjacent images, and is not specifically limited here.

[0086] In other words, once the electronic device obtains the first dissimilar image pair, it can determine the image sequence to be searched. The electronic device can then calculate the similarity between each pair of adjacent images, and based on the similarity, determine the first dissimilar adjacent image in the image sequence to be searched, which serves as the image search result, thus completing the precise location of the first dissimilar adjacent image.

[0087] For example, such as Figure 2 As shown, the electronic device obtains the first dissimilar image pair as A. t and A t+k Then, the image sequence to be compared is the image sequence to be searched, which includes two images A in the image pair. t and A t+k These are image sequences with starting and ending positions, respectively. The electronic device can calculate A. t To A t+k The similarity between any two adjacent images within the range is used to determine the first dissimilar adjacent image in the image sequence to be searched from the image sequence to be compared, which is then used as the image search result.

[0088] In this embodiment, since the first comparison image is obtained at a preset image quantity interval, the first dissimilar image pair is obtained from the first comparison image. Then, dissimilar adjacent images are obtained from the image sequence in which the two images included in the image pair are the start position and the end position, respectively, as the image search result. In this way, it is not necessary to compare every two adjacent images in the image sequence to be searched, which can reduce the image comparison time and improve the image comparison efficiency. At the same time, the image search result can provide intelligent reference for the staff without the need for manual image comparison, thereby improving the work efficiency of the staff.

[0089] As an implementation of the embodiment of the present application, as shown in Figure 3 The step of determining the first similar adjacent image in the to-be-searched image sequence from the to-be-compared image sequence based on the similarity of the to-be-compared image sequence can include

[0090] S301, determining an image quantity interval according to a preset rule based on the quantity of the candidate images.

[0091] The candidate images are image sequences in which the two images included in the image pair obtained by the previous comparison are respectively the starting position and the ending position.

[0092] If the quantity of images in the to-be-compared image sequence is relatively large, the electronic device can continue to roughly locate the first similar adjacent image, that is, continue to divide the to-be-compared image sequence, and obtain a plurality of images from the to-be-compared image sequence according to an image quantity interval smaller than the preset image quantity interval, to sequentially compare each two adjacent images to obtain the first similar image pair. Further, the to-be-compared image sequence is re-determined until the first similar adjacent image can be finely located in the to-be-compared image sequence.

[0093] In an implementation, the electronic device can determine an image quantity interval according to a preset rule based on the quantity of the candidate images. The candidate images are image sequences in which the two images included in the image pair obtained by the previous comparison are respectively the starting position and the ending position, that is, the to-be-compared image sequence is re-determined. The preset rule can be set based on the quantity of images and actual experience of comparing images. For example, if the quantity of candidate images is greater than 100, the image quantity interval is 50; if the quantity of candidate images is greater than 50, the image quantity interval is 30.

[0094] S302, obtaining a plurality of images from the candidate images as the second comparison images according to the image quantity interval.

[0095] S303, sequentially comparing each two adjacent images in the second comparison images to obtain the first similar image pair.

[0096] S304, if the image pair is adjacent images in the to-be-searched image sequence, determining that the image pair is the image search result.

[0097] After determining the image quantity interval, the electronic device can acquire multiple images from the candidate images according to the image quantity interval, as the second comparison images. Then, it compares every two adjacent images in the second comparison images sequentially to obtain the first dissimilar image pair. If the image pair is an adjacent image in the image sequence to be searched, the electronic device can determine that the image pair is the image search result, that is, find the first dissimilar adjacent image from the image sequence to be searched.

[0098] For example, such as Figure 2 As shown, the electronic device obtains the first dissimilar image pair A in the first comparison image. t and A t+k Then A can be analyzed based on the image. t and A t+k Determine candidate images, that is, in the image sequence to be searched, select image pair A. t and A t+k The included images are image sequences representing the start and end positions, respectively. Therefore, the electronic device can determine the image interval as j based on the number of candidate images and according to a preset rule.

[0099] The electronic device can acquire multiple images from the image sequence to be searched at intervals j, namely A t A t+j A t+2j A t+3j ...A t+k As the second comparison image, i.e., the images are spaced j apart, the electronic device can then compare A. t A t+j A t+2j ...A t+k Each pair of adjacent images is compared sequentially to obtain the first dissimilar image pair A. q and A q+j If the image quantity interval j is 1, then the image pair is an adjacent image in the image sequence to be searched. Thus, the electronic device can determine that the image pair is the image search result, that is, find the first dissimilar adjacent image A from the image sequence to be searched. q and A q+1 .

[0100] It can be seen that, in the embodiment, the electronic device can determine the image quantity interval according to the preset rule based on the quantity of the candidate images, obtain a plurality of images from the candidate images according to the image quantity interval as the second comparison images, sequentially compare each two adjacent images in the second comparison images, obtain the first pair of images that are not similar, and then determine the image pair as the image search result for the adjacent images in the image sequence to be searched. In this way, it is not necessary to compare each two adjacent images in the image sequence to be searched, the image comparison time can be reduced, the image comparison efficiency is improved, the image search result can provide intelligent reference for the staff, it is not necessary to manually compare images, and the work efficiency of the staff is improved.

[0101] As an implementation manner of the embodiment of the present application, the method can further include:

[0102] If the image pair is not adjacent in the image sequence to be searched, the step of determining the image quantity interval according to the preset rule based on the quantity of the candidate images is returned until the obtained image pair includes two images that are adjacent in the image sequence to be searched, wherein the image quantity interval determined each time according to the preset rule is less than the image quantity interval determined last time.

[0103] The electronic device sequentially compares each two adjacent images in the second comparison images, obtains the first pair of images that are not similar, and if the image pair is not adjacent in the image sequence to be searched, the electronic device can determine the candidate images again based on the image pair. The candidate images determined again are the image sequence in the image sequence to be searched, the two images included in the first pair of images that are not similar obtained from the second comparison images are the starting position and the ending position respectively.

[0104] Then, the electronic device can determine the image quantity interval again according to the preset rule based on the quantity of the candidate images determined again, and the image quantity interval determined this time according to the preset rule is less than the image quantity interval determined last time. Further, the electronic device can obtain a plurality of images from the candidate images determined again according to the image quantity interval determined again as the third comparison images, sequentially compare each two adjacent images in the third comparison images, obtain the first pair of images that are not similar, and if the image pair is adjacent in the image sequence to be searched, determine the image pair as the image search result.

[0105] If the image pair is not adjacent in the image sequence to be searched, the electronic device determines the candidate images again based on the first pair of images that are not similar obtained from the third comparison images, and further obtains the first pair of images that are not similar from the candidate images determined again until the two images included in the obtained image pair are adjacent in the image sequence to be searched.

[0106] For example, as shown in FIG. 6, the electronic device can determine the image quantity interval according to the preset rule based on the quantity of the candidate images, obtain a plurality of images from the candidate images according to the image quantity interval as the second comparison images, sequentially compare each two adjacent images in the second comparison images, obtain the first pair of images that are not similar, and then determine the image pair as the image search result for the adjacent images in the image sequence to be searched.Figure 2 As shown in FIG. 3, the electronic device obtains the first dissimilar image pair A q and A q+j If the image number interval j is not 1, the image pair is not adjacent images in the image sequence to be searched, so the electronic device can determine the image number interval based on the number of the alternative image, i.e., the image sequence to be searched, according to a preset rule. q and A q+j , and re-determine the alternative image, i.e., the image sequence to be searched, including the two images of the image pair A q and A q+j as the starting position and the ending position respectively. Then, the electronic device can re-determine the image number interval according to a preset rule based on the number of the re-determined alternative image.

[0107] If the re-determined image number interval is 1, the electronic device can obtain each image according to the interval 1 to obtain A q , A q+1 , A q+2 , A q+3 ……A q+j as the third comparison image, and sequentially compare each two adjacent images in A q , A q+1 , A q+2 ……A q+j , i.e., sequentially determine the similarity of each two adjacent images, until the first dissimilar image pair A q and A q+1 is obtained. The image pair is adjacent images in the image sequence to be searched, and the electronic device can determine the image pair as the image search result, and further output the dissimilar adjacent images A q and A q+1 .

[0108] As can be seen, in the embodiment, if the image pair is not adjacent images in the image sequence to be searched, the electronic device can return to perform the step of determining the image number interval based on the number of the alternative image according to a preset rule until the obtained image pair includes two images that are adjacent images in the image sequence to be searched. In this way, it is not necessary to compare each two adjacent images in the image sequence to be searched, and the image comparison time can be reduced and the image comparison efficiency can be improved.

[0109] As an implementation manner of the embodiment, the above step of determining the image number interval based on the number of the alternative image according to a preset rule can include:

[0110] determining the image number interval based on the number of the alternative image according to a preset rule shown in the following formula:

[0111]

[0112] Wherein, size is the number of the candidate images, k1, k2…kn are the image number intervals.

[0113] If the number in the candidate image sequence is greater than a certain number, the electronic device can determine the corresponding image number interval based on the number of the candidate images and the pre-set relationship between the number of the candidate images and the image number interval, to continue to acquire a plurality of images from the candidate images as the next comparison images. Illustratively, the electronic device can determine the image number interval based on the number of the candidate images and the preset rule shown in the following formula.

[0114]

[0115] It can be seen that in the embodiment, the electronic device can determine the corresponding image number interval based on the number of the candidate images and the pre-set relationship between the number of the candidate images and the image number interval, to acquire a plurality of images from the candidate images according to the image number interval.

[0116] As an implementation of the embodiment of the present application, the above method can further include:

[0117] If there is no similar image pair in the second comparison image, the electronic device starts from the latter image included in the first similar image pair in the first comparison image, and sequentially compares each two adjacent images to obtain the first similar image pair.

[0118] Returning to the step of determining the first similar adjacent image in the to-be-searched image sequence from the to-be-compared image sequence based on the similarity of the to-be-compared image sequence, as the image search result.

[0119] The electronic device sequentially compares each two adjacent images in the second comparison image, and does not necessarily obtain a similar image pair. If there is no similar image pair in the second comparison image, i.e., the electronic device does not obtain a similar image pair, the electronic device can return to the first comparison image to continue searching for a similar adjacent image.

[0120] Since the second comparison image is obtained from the to-be-searched image sequence, and the two images included in the first similar image pair in the first comparison image are the starting position and the ending position of the image sequence, there is no similar image pair before the first similar image pair in the first comparison image. When the electronic device returns to the first comparison image, the electronic device can start from the latter image included in the first similar image pair in the first comparison image, and sequentially compare each two adjacent images to obtain the first similar image pair, to determine the to-be-compared image sequence.

[0121] In other words, if the electronic device does not find a dissimilar image pair in the second comparison image, it can return to the first dissimilar image in the first comparison image and continue to roughly locate the dissimilar adjacent images in order to redetermine the image sequence to be compared.

[0122] The electronic device can then return to the step of performing the similarity of the image sequences to be compared, and determining the first dissimilar neighboring image in the image sequence to be searched as the image search result.

[0123] For example, such as Figure 2 As shown, the first comparison image is A1, A 1+k A 1+2k ...A 1+(X-1)k The electronic device compares every two adjacent images in the first comparison image sequentially, and obtains dissimilar image pairs as A. 1+k and A 1+2k (corresponding to A in the second comparison image) t and A t+k The second comparison image is A. t A t+j A t+2j A t+3j ...A t+k .

[0124] If no dissimilar image pair is found in the second comparison image, the electronic device can return to the first comparison image, in which the first dissimilar image pair A is selected. 1+k and A 1+2k The second image A included 1+2k Initially, each pair of adjacent images is compared sequentially to obtain the first dissimilar image pair A. 1+3k and A 1+4k The sequence of images to be compared is then redefined. In other words, if no result is found, the electronic device can backtrack to the next uncompared similar interval in the previous layer.

[0125] For example, such as Figure 2 As shown, the electronic device compares every two adjacent images in the second comparison image sequentially, obtaining dissimilar image pairs as A. t+j and A t+2j (corresponding to A in the third comparison image) q and A q+j The third comparison image is A. q A q+1 A q+2 A q+3 ...A q+j .

[0126] If there is no dissimilar image pair in the third comparison image, the electronic device can return to the second comparison image, in which the electronic device determines the first dissimilar image pair A t+j and A t+2j including the latter image A t+2j Initially, the electronic device sequentially compares each two adjacent images to obtain the first dissimilar image pair A 1+3j and A 1+4j , and re-determines the image sequence to be compared. That is, when no suitable result is found, the electronic device can backtrack to the next interval of similarity that has not been compared in the upper layer. Then, the electronic device can return to perform the step of determining the first dissimilar adjacent image in the image sequence to be searched based on the similarity of the image sequence to be compared, from the image sequence to be compared, as the image search result.

[0127] As can be seen, in the embodiment, since there is not necessarily a dissimilar image pair in the second comparison image, when there is no dissimilar image pair in the second comparison image, the electronic device can, in the first comparison image, sequentially compare each two adjacent images starting from the latter image included in the first dissimilar image pair to obtain the first dissimilar image pair, and then return to perform the step of determining the first dissimilar adjacent image in the image sequence to be searched based on the similarity of the image sequence to be compared, from the image sequence to be compared, as the image search result. In this way, it is not necessary to compare each two adjacent images in the image sequence to be searched, which can reduce the image comparison time and improve the image comparison efficiency.

[0128] As an implementation manner of the embodiment of the present application, as shown in Figure 4 the above-mentioned manner of sequentially comparing each two adjacent images can include:

[0129] S401, calculating the similarity between the two adjacent images based on the image features of the two adjacent images;

[0130] In an implementation manner, the electronic device can calculate the Hamming distance between the two adjacent images based on the image features of the two adjacent images as the similarity between the two adjacent images.

[0131] Specifically, in order to reduce the amount of calculation for image processing, the electronic device can perform scaling processing on the image based on a scaling ratio, and at the same time, can convert the image into a grayscale image to further simplify the calculation. Wherein, the scaling ratio can be set according to the actual situation, for example, it can be scaled to 32x32 resolution. After obtaining the processed image, the electronic device can perform DCT (Discrete Cosine Transformation) transformation on the image to obtain a 32x32 size DCT coefficient matrix, wherein the 8x8 part in the upper left corner of the DCT coefficient matrix is called the DC (Discrete Cosine) coefficient, which can be used to represent image information.

[0132] Further, the electronic device can calculate the average value of the DC coefficient, and perform hash calculation on the DC coefficient, that is, set the position greater than or equal to the average value to 1, and set the position less than the average value to 0. In this way, the electronic device can obtain a 64-bit digital string composed of 0 and 1, and use the digital string as the fingerprint of the image. The electronic device can compare the fingerprints of two images bit by bit according to the following formula, and then obtain the number of different bits as the Hamming distance.

[0133]

[0134] Wherein, x[i] and y[i] represent the fingerprints of two images respectively, n is 64, and represents the XOR operation.

[0135] S402, determining a target similarity threshold value according to the image quantity interval corresponding to the current comparison and the correspondence relationship between the pre-set similarity threshold value and the image quantity interval;

[0136] Since the image quantity intervals are different, the similarity threshold values obtained by the electronic device by comparing each two adjacent images in the current candidate image are also different.

[0137] In an embodiment, the electronic device can determine a target similarity threshold value according to the image quantity interval corresponding to the current comparison and the correspondence relationship between the pre-set similarity threshold value and the image quantity interval. For example, the correspondence relationship between the pre-set similarity threshold value and the image quantity interval is shown in the following formula,

[0138]

[0139] If the image quantity interval corresponding to the current comparison is 5, the electronic device can determine the target similarity threshold value as 20 according to the similarity threshold value 20 corresponding to the image quantity interval 5.

[0140] S403, determining whether the two adjacent images are similar based on the size relationship between the similarity and the target similarity threshold value.

[0141] After obtaining the similarity between the two adjacent images and the target similarity threshold, the electronic device can determine whether the two adjacent images are similar based on a size relationship between the similarity and the target similarity threshold. That is, if the similarity is not less than the target similarity threshold, the two adjacent images are not similar; if the similarity is less than the target similarity threshold, the two adjacent images are similar.

[0142] For example, the electronic device obtains that the Hamming distance between the two adjacent images is 30, and the target similarity threshold is 20. Since the Hamming distance is greater than the target similarity threshold, it can be determined that the two adjacent images are not similar.

[0143] It can be seen that in this embodiment, the electronic device can calculate the similarity between each two adjacent images based on the image features of the two adjacent images, determine the target similarity threshold according to the image quantity interval corresponding to the current comparison and the correspondence between the pre-set similarity threshold and the image quantity interval, determine whether the two adjacent images are similar based on the size relationship between the similarity and the target similarity threshold, and further take the adjacent images that are not similar as the image search result.

[0144] As an implementation manner of the embodiment of the present application, after the step of obtaining the image sequence to be searched, the method can further include:

[0145] cropping the images in the image sequence to be searched based on the target feature region to obtain a cropped image sequence to be searched.

[0146] In order to determine whether two images are similar, the electronic device can compare based on any region in the image. Therefore, the electronic device can crop the images in the image sequence to be searched based on the target feature region to obtain a cropped image sequence to be searched. The ratio of the cropped image to the original image is the same. The target feature region can be a region of interest of the business, and the change point at which the target feature region changes greatly can be regarded as a change point at which the target state occurs.

[0147] In an implementation manner, the electronic device can crop the images in the image sequence to be searched based on a cropping frame pre-drawn in the target feature region to obtain a cropped image sequence to be searched. For example, the image sequence to be searched is a vehicle second image sequence of a parking area captured, and in an actual scene, the positions of vehicles in the parking area are often inconsistent. Therefore, a cropping frame can be pre-drawn by a person for the target feature region, and then the electronic device crops the vehicle image based on the cropping frame. The target feature region can be a roof area, a front window area, etc.

[0148] For example, as shown in FIG. 6, the electronic device can crop the image in the image sequence to be searched based on the cropping frame pre-drawn in the target feature region to obtain a cropped image sequence to be searched. Figure 5As shown, the parking area includes a plurality of parking spaces, 404158 to 404162. For the vehicle parked in the parking space 404161, a rectangular frame 501 is manually drawn as a cropping frame for the vehicle front window area. The electronic device can crop the images in the to-be-searched image sequence based on the rectangular frame 501 to obtain images of each target feature area as the cropped to-be-searched image sequence.

[0149] As can be seen, in this embodiment, the electronic device can crop the images in the to-be-searched image sequence based on the target feature area to obtain the cropped to-be-searched image sequence, so as to compare the target feature area of each image in the to-be-searched image sequence.

[0150] As an implementation manner of the embodiments of the present application, the to-be-searched image sequence is a snapshot vehicle second image sequence of the parking area;

[0151] After the step of determining the first dissimilar adjacent image in the to-be-searched image sequence from the to-be-compared image sequence as the image search result based on the similarity of the to-be-compared image sequence, the method can further include:

[0152] Determining that the image search result corresponds to a snapshot time point as an entry and exit state time change point, so that the staff records the entry and exit state based on the entry and exit state time change point and the image search result.

[0153] In an implementation manner, the images in the vehicle second image sequence obtained by the electronic device are arranged in chronological order. Therefore, the time point of image snapshot can be obtained from the image search result, and then the electronic device can determine that the image search result corresponds to a snapshot time point as an entry and exit state time change point, so that the staff records the entry and exit state based on the entry and exit state time change point and the image search result. The entry and exit state includes a vehicle exit state and a vehicle entry state.

[0154] For example, the electronic device obtains the time points of image snapshot from the image search result as June 1, 2023, 14:47:32 and June 1, 2023, 14:49:32. At this time, it is a vehicle entry state. Therefore, the electronic device can determine that the vehicle enters the vehicle from June 1, 2023, 14:47:32 to June 1, 2023, 14:49:32. In this way, the staff can record that the vehicle enters the vehicle between June 1, 2023, 14:47:32 and June 1, 2023, 14:49:32.

[0155] It can be seen that in the embodiment, the electronic device can determine that the image search result corresponds to the entry / exit state time change point as the snapshot time point, so that the staff records the entry / exit state based on the entry / exit state time change point and the image search result. The image search result can provide intelligent reference for the staff, without manual image comparison, thereby improving the work efficiency of the staff.

[0156] Figure 6 A specific flowchart of the image search method provided by the embodiment of the application is provided. The following will be described in combination with Figure 6 The image search method provided by the embodiment of the application is exemplarily introduced. As shown in Figure 6 The image search method provided by the embodiment of the application can include the following steps:

[0157] S601, acquiring a second image set;

[0158] The electronic device can acquire a second image set, that is, as a to-be-searched image sequence. For example, as shown in Figure 7 The to-be-searched image sequence is a time-continuous vehicle second image sequence, which is an image of a parking area captured by a camera every 2 min within a certain time, including 16 images. The electronic device can crop the 16 images based on a target feature region to obtain a cropped vehicle second image, as a vehicle second image sequence.

[0159] S602, searching for similar adjacent images;

[0160] The electronic device can search for similar adjacent images by using a comparison strategy unit 601. The comparison strategy unit can include a feature region cropping unit 602, a feature region cropping unit 602, a feature region cropping unit 602, and a feature region cropping unit 602. The comparison strategy unit 601 can perform the following steps:

[0161] As shown in Figure 7 The electronic device acquires a plurality of vehicle second images from the vehicle second image sequence according to a preset image number interval 5, as the first comparison image, that is, four second images, the first second image, the sixth second image, the eleventh second image and the sixteenth second image. Since the vehicle second images in the vehicle second image sequence have time continuity, the plurality of vehicle second images still have time continuity.

[0162] The electronic device can compare each two adjacent second images in turn, that is, each second image is hashed, and the calculation result is used as the fingerprint of each second image. Then, the Hamming distance between the two adjacent second images is calculated in turn, and then the electronic device can determine whether the two adjacent second images are similar according to the size relationship between the Hamming distance and the distance threshold.

[0163] The electronic device performs a first comparison between the first and sixth second images, which results in a similarity between the two. The second comparison involves the sixth and eleventh second images, again showing similarity. The third comparison compares the eleventh and sixteenth second images, which concludes that the two images are dissimilar.

[0164] Since the 11th and 16th second images are adjacent, the electronic device acquires the first dissimilar pair of second images in the first comparison image, which only completes the rough location of the dissimilar adjacent second image pair, that is, the adjacent second image pair is located between the 11th and 16th second images. Therefore, the electronic device can perform fine location of the dissimilar adjacent second image pair between the 11th and 16th second images.

[0165] The electronic device acquires each vehicle's second-image from the vehicle second-image sequence at preset image intervals of 1, using them as the second comparison images, thus obtaining 6 second-images, namely the 11th to 16th second-images. The electronic device can sequentially compare every two adjacent second-images within these 6 images, i.e., comparing the 11th and 12th second-images, the 12th and 13th second-images, the 13th and 14th second-images, the 14th and 15th second-images, and the 15th and 16th second-images (e.g.,...). Figure 7 As shown in Figures 3-1, 3-2, 3-3, 3-4, and 3-5, each pair of adjacent images is compared sequentially to perform fine-grained localization.

[0166] S603, the first time a change has occurred in the adjacent second chart.

[0167] like Figure 7 As shown, during the fine-grained localization process, if the 11th and 12th second images are dissimilar image pairs, the electronic device can determine the first dissimilar adjacent second image from the vehicle second image sequence—that is, the adjacent second image where the change first occurs—as the image search result. In this way, the electronic device performs a total of four comparisons. Compared to comparing every two adjacent images in the vehicle second image sequence, this reduces the number of comparisons and improves comparison efficiency.

[0168] It can be seen that in the scheme provided in the embodiments of the present application, the electronic device can acquire a to-be-searched image sequence, acquire a plurality of images from the to-be-searched image sequence as first comparison images according to a preset image quantity interval, sequentially compare every two adjacent images in the first comparison images to obtain a first pair of dissimilar images, determine a first pair of dissimilar images in the to-be-searched image sequence as an image search result based on the similarity of a to-be-compared image sequence, wherein the to-be-compared image sequence is an image sequence in the to-be-searched image sequence with two images included in the image pair as a starting position and a terminal position respectively. Since the first comparison images are acquired according to the preset image quantity interval, the first pair of dissimilar images is obtained from the first comparison images, and then the dissimilar adjacent images are acquired from the image sequence with two images included in the image pair as a starting position and a terminal position respectively to serve as the image search result, so that it is not necessary to compare every two adjacent images in the to-be-searched image sequence, the image comparison time can be reduced, the image comparison efficiency is improved, the image search result can provide intelligent reference for the staff, it is not necessary to manually compare images, and the work efficiency of the staff is further improved.

[0169] Corresponding to the above-mentioned image search method, the embodiments of the present application further provide an image search device. The image search device provided in the embodiments of the present application is introduced below.

[0170] As shown in Figure 8 An image search device, the device comprises:

[0171] A first comparison image acquisition module 810 is configured to acquire a to-be-searched image sequence, and acquire a plurality of images from the to-be-searched image sequence as first comparison images according to a preset image quantity interval;

[0172] A first pair of dissimilar images acquisition module 820 is configured to sequentially compare every two adjacent images in the first comparison images to obtain a first pair of dissimilar images.

[0173] An image search result determination module 830 is configured to determine a first pair of dissimilar images in the to-be-searched image sequence as an image search result based on the similarity of a to-be-compared image sequence, wherein the to-be-compared image sequence is an image sequence in the to-be-searched image sequence with two images included in the image pair as a starting position and a terminal position respectively.

[0174] It can be seen that in the scheme provided in the embodiment of the present application, the electronic device can acquire a to-be-searched image sequence, acquire a plurality of images from the to-be-searched image sequence as first comparison images according to a preset image quantity interval, sequentially compare every two adjacent images in the first comparison images to obtain a first pair of dissimilar images, determine a first pair of dissimilar images in the to-be-searched image sequence as an image search result based on the similarity of a to-be-compared image sequence, and the to-be-compared image sequence is an image sequence in which two images included in an image pair are respectively a starting position and a terminal position. Since the first comparison images are acquired according to the preset image quantity interval, the first pair of dissimilar images is obtained from the first comparison images, and then the dissimilar adjacent images are acquired from the image sequence in which the two images included in the image pair are respectively the starting position and the terminal position to serve as the image search result. In this way, it is not necessary to compare every two adjacent images in the to-be-searched image sequence, the image comparison time can be reduced, the image comparison efficiency is improved, the image search result can provide intelligent reference for the staff, it is not necessary to manually compare images, and the work efficiency of the staff is further improved.

[0175] As an implementation manner of the embodiment of the present application, the image search result determination module 830 can include

[0176] an image quantity interval determination sub-module configured to determine an image quantity interval according to a preset rule based on the number of candidate images, wherein the candidate images are image sequences in which two images included in a last comparison image pair are respectively a starting position and a terminal position in the to-be-searched image sequence;

[0177] a second comparison image acquisition sub-module configured to acquire a plurality of images from the candidate images as second comparison images according to the image quantity interval;

[0178] a dissimilar image pair acquisition sub-module configured to sequentially compare every two adjacent images in the second comparison images to obtain a first pair of dissimilar images;

[0179] an image search result determination sub-module configured to determine the image pair as an image search result if the image pair is adjacent images in the to-be-searched image sequence.

[0180] As an implementation manner of the embodiment of the present application, the apparatus can further include

[0181] the similar image pair obtaining module is configured to, if there is no similar image pair in the second comparison image, sequentially compare each two adjacent images in the first comparison image from a latter image included in the first similar image pair, to obtain the first similar image pair;

[0182] As an implementation of the embodiment of the present application, the device can further include:

[0183] the similar image pair obtaining module is configured to, if there is no similar image pair in the second comparison image, sequentially compare each two adjacent images in the first comparison image from a latter image included in the first similar image pair, to obtain the first similar image pair;

[0184] the image search result executing module is configured to return the similarity based on the image sequence to be compared, and determine the first similar adjacent image in the image sequence to be searched from the image sequence to be compared as the image search result.

[0185] As an implementation of the embodiment of the present application, the device can further include an adjacent image comparison module configured to sequentially compare each two adjacent images, which can include:

[0186] the similarity calculation submodule is configured to calculate the similarity between the two adjacent images based on the image features of the two adjacent images;

[0187] the target similarity threshold determining submodule is configured to determine the target similarity threshold according to the corresponding relationship between the image number interval corresponding to the current comparison and the pre-set similarity threshold and the image number interval;

[0188] the similar image determining submodule is configured to determine whether the two adjacent images are similar based on the size relationship between the similarity and the target similarity threshold.

[0189] As an implementation of the embodiment of the present application, the image sequence to be searched is a snapshot vehicle second image sequence of a parking area;

[0190] The device can further include:

[0191] The time change point determination module is configured to determine the first similar adjacent image in the image sequence to be searched from the image sequence to be compared as the image search result based on the similarity of the image sequence to be compared after the step of determining the first similar adjacent image in the image sequence to be searched from the image sequence to be compared as the image search result.

[0192] The embodiments of the present application further provide an electronic device, such as Figure 9 as shown in the drawings, comprising:

[0193] The memory 901 is configured to store a computer program.

[0194] The processor 902 is configured to execute the program stored in the memory 901, and implement the image search method steps of any of the above embodiments.

[0195] The electronic device can further comprise a communication bus and / or a communication interface, and the processor 902, the communication interface, and the memory 901 can communicate with each other through the communication bus.

[0196] It can be seen that, in the scheme provided by the embodiments of the present application, the electronic device can acquire an image sequence to be searched, and acquire a plurality of images from the image sequence to be searched according to a preset image quantity interval, as first comparison images. The first comparison images are compared with each other in pairs to obtain a first pair of non-similar images. The first similar adjacent image in the image sequence to be searched is determined from the image sequence to be compared based on the similarity of the image sequence to be compared, as the image search result. The image sequence to be compared is an image sequence in which the two images included in the image pair are respectively the starting position and the ending position. Since the first comparison images are acquired according to the preset image quantity interval, the first pair of non-similar images is obtained from the first comparison images, and then the non-similar adjacent images are acquired from the image sequence in which the two images included in the image pair are respectively the starting position and the ending position, as the image search result. In this way, it is not necessary to compare each pair of adjacent images in the image sequence to be searched, which can reduce the image comparison time and improve the image comparison efficiency. Meanwhile, the image search result can provide intelligent reference for the staff, and it is not necessary to manually compare the images, thereby improving the work efficiency of the staff.

[0197] The communication bus mentioned in the above electronic device can be a Peripheral Component Interconnect (PCI) bus or an Extended Industry Standard Architecture (EISA) bus, etc. The communication bus can be divided into an address bus, a data bus, a control bus, etc. For the convenience of representation, only one thick line is used in the figure, but it does not mean that there is only one bus or one type of bus.

[0198] The communication interface is used for communication between the above electronic device and other devices.

[0199] The memory can include a Random Access Memory (RAM) and can also include a Non-Volatile Memory (NVM), such as at least one disk memory. Optionally, the memory can also be at least one storage device located away from the above processor.

[0200] The above processor can be a general-purpose processor, including a Central Processing Unit (CPU), a Network Processor (NP), etc.; can also be a Digital Signal Processor (DSP), an Application Specific Integrated Circuit (ASIC), a Field-Programmable Gate Array (FPGA) or other programmable logic device, a discrete gate or transistor logic device, a discrete hardware component.

[0201] In another embodiment provided in the present application, a computer readable storage medium is also provided, and the computer readable storage medium stores a computer program. The computer program is executed by a processor to implement the steps of any of the above image search methods.

[0202] In another embodiment provided in the present application, a computer program product containing instructions is also provided, and when the computer program product is run on a computer, the computer is caused to execute any of the image search methods in the above embodiments.

[0203] In the embodiments described above, all or some of the steps can be implemented by using software, hardware, firmware or any combination thereof. When implemented by using software, all or some of the steps can be implemented in the form of one or more computer programs. The computer program is stored in a computer readable storage medium, and includes all the procedures described in the embodiments of the present application. The computer readable storage medium includes any tangible storage device or medium that stores the computer program including, but not limited to, floppy disks, hard disks, ROM, RAM, flash memories, optical storage (e.g., DVD), and the like. The computer readable storage medium is accessed by one or more computers or one or more computer processors. The computer program is loaded into and executed by the one or more computers or the one or more computer processors to perform the procedures described in the embodiments of the present application.

[0204] It should be noted that, in the present document, the terms such as first and second are used only to differentiate one entity or operation from another entity or operation, and do not necessarily require or imply any such actual relationship or order between these entities or operations. Also, the terms "comprising", "containing", or any other variant thereof are intended to cover a non-exclusive inclusion, such that a process, method, article, or apparatus that comprises a list of elements does not include those elements only, but can also include other elements not expressly listed, or other elements inherent in such process, method, article, or apparatus. Without more limitations, an element defined by the phrase "comprising a" does not exclude the existence of additional identical elements in the process, method, article, or apparatus that includes the element.

[0205] Each of the embodiments in the present specification is described in a related manner, and the same or similar parts between the embodiments can be referred to each other. Each embodiment focuses on the difference from other embodiments. In particular, for the device, electronic device, computer readable storage medium, and computer program product embodiments, since they are basically similar to the method embodiments, the description is relatively simple, and the relevant parts can be referred to the part of the method embodiment.

[0206] The above only describes the preferred embodiments of the present application, and is not intended to limit the protection scope of the present application. Any modification, equivalent replacement, improvement, etc. made within the spirit and principle of the present application shall be included in the protection scope of the present application.

Claims

1. An image search method, characterized in that, The method includes: Obtain the image sequence to be searched, and according to a preset image number interval, obtain multiple images from the image sequence to be searched as the first comparison images; The first pair of dissimilar images is obtained by sequentially comparing every two adjacent images in the first comparison image; Based on the similarity between every two adjacent images in the image sequence to be compared, the first dissimilar adjacent image in the image sequence to be searched is determined from the image sequence to be compared and used as the image search result. The image sequence to be compared is: the image sequence in the image sequence to be searched, in which the two images included in the image pair are the start position and the end position, respectively.

2. The method according to claim 1, characterized in that, The step of determining the first dissimilar neighboring image in the image sequence to be searched based on the similarity between every two adjacent images in the image sequence to be compared includes: Based on the number of candidate images, the image number interval is determined according to a preset rule. The candidate images are the image sequences in the image sequence to be searched, in which the two images included in the image pair obtained in the previous comparison are the start position and the end position, respectively. Multiple images are obtained from the candidate images at specified image number intervals as the second comparison images; The second comparison image is compared sequentially with every two adjacent images to obtain the first dissimilar image pair; If the image pair is an adjacent image in the sequence of images to be searched, the image pair is determined to be the image search result.

3. The method according to claim 2, characterized in that, The method further includes: If the image pair is not adjacent in the image sequence to be searched, return to the step of determining the image number interval based on the number of candidate images according to a preset rule, until the two images in the obtained image pair are adjacent in the image sequence to be searched, wherein the image number interval determined each time according to the preset rule is less than the image number interval determined in the previous time.

4. The method according to claim 2, characterized in that, The method further includes: If there are no dissimilar image pairs in the second comparison image, in the first comparison image, starting from the image following the first dissimilar image pair, each pair of adjacent images is compared sequentially to obtain the first dissimilar image pair. The step of returning the similarity based on the image sequence to be compared, and determining the first dissimilar neighboring image in the image sequence to be searched as the image search result.

5. The method according to any one of claims 2-4, characterized in that, The method of comparing each pair of adjacent images sequentially includes: Calculate the similarity between two adjacent images based on their image features. Based on the image number interval corresponding to this comparison and the correspondence between the pre-set similarity threshold and the image number interval, the target similarity threshold is determined; Based on the relationship between the similarity and the target similarity threshold, it is determined whether the two adjacent images are similar.

6. The method according to any one of claims 1-4, characterized in that, The image sequence to be searched is a sequence of second-by-second images of vehicles in the parking area captured by camera. After the step of determining the first dissimilar neighboring image in the search image sequence based on the similarity of the image sequences to be compared, as the image search result, the method further includes: The capture time point corresponding to the image search result is determined as the vehicle entry / exit status time change point, so that staff can record the vehicle entry / exit status based on the vehicle entry / exit status time change point and the image search result.

7. An image search device, characterized in that, The device includes: The first comparison image acquisition module is used to acquire a sequence of images to be searched, and to acquire multiple images from the sequence of images to be searched at preset image number intervals as the first comparison images; The first dissimilar image pair acquisition module is used to compare every two adjacent images in the first comparison image in turn to obtain the first dissimilar image pair; The image search result determination module is used to determine the first dissimilar adjacent image in the image sequence to be searched based on the similarity between every two adjacent images in the image sequence to be compared, and use it as the image search result. The image sequence to be compared is an image sequence in the image sequence to be searched, in which the two images included in the image pair are the start position and the end position, respectively.

8. The apparatus according to claim 7, characterized in that, The image search result determination module includes The image number interval determination submodule is used to determine the image number interval based on the number of candidate images according to a preset rule. The candidate images are the image sequences in the image sequence to be searched, in which the two images included in the image pair obtained in the previous comparison are the start position and the end position, respectively. The second comparison image acquisition submodule is used to acquire multiple images from the candidate images at intervals according to the number of images, as the second comparison images; The dissimilar image pair acquisition submodule is used to compare every two adjacent images in the second comparison image in turn to obtain the first dissimilar image pair; The image search result determination submodule is used to determine the image pair as an image search result if the image pair is an adjacent image in the image sequence to be searched. The device further includes: The dissimilar adjacent image acquisition module is used to return the step of determining the image number interval according to a preset rule based on the number of candidate images if the image pair is not adjacent in the image sequence to be searched, until the two images included in the obtained image pair are adjacent in the image sequence to be searched, wherein the image number interval determined according to the preset rule each time is less than the image number interval determined in the previous time. The device further includes: The dissimilar image pair acquisition module is used to compare every two adjacent images in the first comparison image, starting from the image following the first dissimilar image pair, if there is no dissimilar image pair in the second comparison image, to obtain the first dissimilar image pair. The image search result execution module is used to return the similarity based on the image sequence to be compared, and to determine the first dissimilar adjacent image in the image sequence to be searched from the image sequence to be compared, as the image search result step; The device further includes an adjacent image comparison module, which is used to compare every two adjacent images sequentially, including: The similarity calculation submodule is used to calculate the similarity between two adjacent images based on the image features of each pair of adjacent images; The target similarity threshold determination submodule is used to determine the target similarity threshold based on the image number interval corresponding to this comparison and the correspondence between the pre-set similarity threshold and the image number interval. The similar image determination submodule is used to determine whether two adjacent images are similar based on the relationship between the similarity and the target similarity threshold. The image sequence to be searched is a sequence of second-by-second images of vehicles in the parking area captured by camera. The device further includes: The time change point determination module is used to determine the first dissimilar adjacent image in the image sequence to be searched based on the similarity of the image sequence to be compared, and use it as the image search result, and then determine the capture time point corresponding to the image search result as the vehicle entry / exit status time change point, so that the staff can record the vehicle entry / exit status based on the vehicle entry / exit status time change point and the image search result.

9. An electronic device, characterized in that, include: Memory, used to store computer programs; A processor, when executing a program stored in memory, implements the method of any one of claims 1-6.

10. A computer-readable storage medium, characterized in that, The computer-readable storage medium stores a computer program that, when executed by a processor, implements the method described in any one of claims 1-6.

Citation Information

Patent Citations

  • Parking management method and device, equipment and storage medium

    CN114387560A