Image retrieval method and electronic device

Through hierarchical retrieval and matching technology, the problem of low image retrieval efficiency in large-scale databases is solved, and efficient image positioning in visual positioning and augmented reality navigation scenarios is achieved.

CN117708357BActive Publication Date: 2024-08-23HONOR DEVICE CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202310724742.8
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2023-06-16
Publication Date
2024-08-23
Estimated Expiration
2043-06-16

AI Technical Summary

Technical Problem

In visual positioning and augmented reality navigation scenarios, image retrieval methods based on image content have problems such as excessive retrieval time, high cost and low efficiency in large-scale databases.

Method used

By matching the query image and the map image for hierarchical retrieval, the number of images to be retrieved is reduced. The target image area is first determined based on the first matching degree, and then the secondary retrieval is performed, which reduces the time consuming of image retrieval and improves efficiency.

Benefits of technology

It effectively reduces the time consuming of image retrieval, improves retrieval efficiency, and ensures that the effect of image retrieval is not reduced.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN117708357B
    Figure CN117708357B
Patent Text Reader

Abstract

The present application discloses an image retrieval method and an electronic device, which relate to the field of artificial intelligence technology, including: the map image to be retrieved and matched by the query image is divided into multiple image areas, each image area includes one or more map point images, and the first image is a part of the map point images in the image area. The electronic device retrieves and matches the query image with the first image to reduce the number of images that are first-level retrieved and matched with the query image. After obtaining the first matching degree between the query image and each first image, the target image area is determined according to the first matching degree and the image area to which each first image belongs, and the query image is secondarily retrieved and matched with the second image in the target image area, and the second image is an image in the target image area other than the first image. By hierarchically retrieving and matching the query image with the first image and the second image, the number of images retrieved with the query image is reduced, the retrieval time is reduced, and the retrieval efficiency is improved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The embodiments of the present application relate to the field of artificial intelligence technology, and in particular to an image retrieval method and electronic device. Background Art

[0002] In the scenarios of visual positioning system (VPS) and augmented reality (AR) navigation, image positioning can be achieved through image retrieval. For example, VPS obtains the location information of the current device in the environment through image retrieval based on the query image. As an important module of VPS, image retrieval is used to retrieve images related to or similar to the query image from a large-scale image database, and sort them according to the retrieval distance for use by downstream modules, such as further image positioning operations.

[0003] Commonly used image retrieval methods include retrieval based on image content, which includes: extracting image features of the query image and measuring the similarity with the image features of all images in the image database; and determining the retrieval result image corresponding to the query image from the image database based on the similarity measurement result.

[0004] When this method is applied to a large database, the retrieval time will be too high and the retrieval efficiency will be low. Summary of the invention

[0005] The embodiments of the present application provide an image retrieval method and an electronic device, which reduce the number of images that match the query image retrieval, reduce the image retrieval time, and improve the image retrieval efficiency by hierarchically retrieving and matching the query image with the first image and the second image in the map image.

[0006] In order to achieve the above-mentioned purpose, the embodiments of the present application adopt the following technical solutions.

[0007] In a first aspect, an image retrieval method is provided, the method comprising:

[0008] The query image is searched and matched with the first images in the map image to obtain a first matching degree between the query image and each first image.

[0009] The map image is divided into a plurality of image regions, each of which includes one or more map point images, and the first image is a portion of the map point images in the image region.

[0010] According to the first matching degree and the image area to which each first image belongs, a target image area is determined from multiple image areas. The query image is retrieved and matched with the second image in the target image area to obtain a second matching degree between the query image and each second image; the second image is a map point image in the target image area except the first image.

[0011] A map point image matching the query image is determined according to the first matching degree and the second matching degree.

[0012] In the present application, the map image to be retrieved and matched by the query image is divided into multiple image areas, each image area includes multiple map point images, and the first image is a part of the image in the image area. The electronic device first retrieves and matches the query image with the first image of the map image, which can reduce the number of map images that are retrieved and matched with the query image at the first level. After obtaining the first matching degree between the query image and each first image, the target image area is determined from the image area according to the first matching degree and the image area to which each first image belongs. The query image is retrieved and matched with the second image in the target image area at the second level to obtain the second matching degree between the query image and each second image. The second image is an image in the target image area other than the first image. After the query image is retrieved and matched twice with the first image and the second image, the number of map images that are retrieved and matched with the query image is greatly reduced, the time consumption of image retrieval can be reduced, and the efficiency of image retrieval can be improved. Finally, based on the first matching degree and the second matching degree, the image retrieval result of the query image is determined to avoid the loss of retrieval matching of the image content in the image area, thereby ensuring that the effect of image retrieval is not reduced.

[0013] In a possible implementation manner of the first aspect, the method further includes:

[0014] The map image is processed by dividing the map regions to obtain a plurality of image regions of the map image.

[0015] In the present application, the map image is divided into image areas, wherein the image area means the classification of the map image. The classification is not dependent on the image content (features) of the map image, and the distribution of features of the classification results is relatively uniform, which can ensure the effect of image retrieval in the subsequent image retrieval process.

[0016] In another possible implementation manner of the first aspect, performing map region division processing on a map image to obtain multiple image regions of the map image includes:

[0017] According to the posture of the map point images in the map image, the map outline of the map image is obtained; the posture information is the coordinates of the image acquisition device in the world coordinate system when acquiring the map point images; the map outline is the map points corresponding to all the map point images in the map image and the channels in the map image.

[0018] The target point is determined based on the map outline, and an image coordinate system is constructed in the map image with the target point as the coordinate origin. Starting from the origin of the image coordinate system, the map area in the map image is divided along the horizontal and vertical axes of the image coordinate system with a preset step size to obtain multiple image areas of the map image.

[0019] In the present application, in some embodiments, the map outline of the map image is determined based on the position and posture of the map point image in the map image. The origin of the image coordinate system is determined based on the map outline, and the image coordinate system of the map image is constructed. The image area is divided based on the image coordinate system, which can reduce the influence of redundant image areas (areas with little or no map positioning images) in the map image, so that the feature distribution of the divided image area is more uniform, and the effect of image retrieval can be guaranteed in the subsequent image retrieval process.

[0020] In another possible implementation manner of the first aspect, determining a target vertex based on a map outline, taking the target vertex as a coordinate origin, and constructing an image coordinate system in a map image includes:

[0021] Based on all map points included in the map outline, the circumscribed polygon corresponding to the map outline is obtained; any vertex of the circumscribed polygon is used as the target point, and the two adjacent sides of the target point are respectively the horizontal axis and the vertical axis, and an image coordinate system is constructed in the map image.

[0022] In the present application, the electronic device determines the map outline of the map image based on the position and posture of the map point image in the map image. Based on the map outline and the convex hull algorithm, the circumscribed polygon of the map outline is determined; based on the circumscribed polygon, the origin and the horizontal and vertical axes of the image coordinate system are determined, so that the map image is divided into several image areas (categories) along the horizontal and vertical axes with a preset step length, starting from the origin. This area division method does not depend on the image content (features) of the map image, and the number of divided areas (categories) of the obtained map image is relatively balanced. In the subsequent image retrieval and matching process based on the divided image areas, the effect of image retrieval and matching can be guaranteed, avoiding the problem that the number of features in the category is uneven due to the large image content (features) of some categories and the small image content (features) of some categories, thereby affecting the image retrieval and matching (classification) effect.

[0023] In another possible implementation manner of the first aspect, the multiple image areas further include an intersection area, and the method further includes:

[0024] Identify the intersection image in the map image and determine the intersection point of the intersection image; and determine a regular area of ​​a preset range as the intersection area based on the intersection point.

[0025] In the present application, considering that the intersection image in the map image has the characteristics of intersection, the intersection area is determined based on the intersection image, and the intersection area is used as the first image or the second image for retrieval and matching of the query image, so that the retrieval result is more accurate.

[0026] In another possible implementation manner of the first aspect, positions of the first image and the second image in the image area are evenly distributed.

[0027] In the present application, ensuring that the distribution of the first image and the second image in the regional image is uniform and balanced can make the image retrieval effect more accurate in the image retrieval process based on the first image and the second image.

[0028] In another possible implementation manner of the first aspect, the target image region is an image region among multiple image regions where the number of target images is greater than a threshold, and the target image is a first image with a first matching degree greater than the matching degree threshold.

[0029] In the present application, based on the first image whose first matching degree is greater than the matching degree threshold, the target image area is obtained to determine the second image corresponding to the secondary retrieval. The second image of the secondary retrieval is more effective, making the hierarchical retrieval results more accurate.

[0030] In another possible implementation manner of the first aspect, the map point image that matches the query image includes a first image whose first matching degree is greater than a matching degree threshold and a second image whose second matching degree is greater than the matching degree threshold.

[0031] In the present application, the image retrieval result of the query image is determined based on the first matching degree and the second matching degree of the first image in the target image area, thereby avoiding the loss of retrieval matching of the image content in the image area and ensuring that the effect of the image retrieval is not reduced.

[0032] In another possible implementation of the first aspect, the map point images matching the query image include the K images with the highest matching degrees in the second target image, and the second target image includes a first image whose first matching degree is greater than a matching degree threshold and / or a second image whose second matching degree is greater than the matching degree threshold.

[0033] In the present application, only the K images with the highest matching degree in the second target image are obtained, and more effective map point images with higher matching degree can be further extracted, thereby ensuring the effect of image retrieval.

[0034] In a second aspect, an electronic device is provided, which includes a memory, a communication module and one or more processors; the memory and the communication module are coupled to the processor; the memory stores computer program code, and the computer program code includes computer instructions, and when the computer instructions are executed by the processor, the electronic device executes a method as described in any one of the above-mentioned first aspects.

[0035] According to a third aspect, a computer-readable storage medium is provided, wherein instructions are stored in the computer-readable storage medium, and when the computer-readable storage medium is executed on an electronic device, the electronic device can execute any one of the methods according to the first aspect.

[0036] According to a fourth aspect, a computer program product comprising instructions is provided, which, when executed on an electronic device, enables the electronic device to execute any one of the methods according to the first aspect.

[0037] In a fifth aspect, an embodiment of the present application provides a chip, the chip including a processor, the processor being used to call a computer program in a memory to execute the method of the first aspect.

[0038] It can be understood that the beneficial effects that can be achieved by the electronic device described in the second aspect, the computer-readable storage medium described in the third aspect, the computer program product described in the fourth aspect, and the chip described in the fifth aspect provided above can refer to the beneficial effects in the first aspect and any possible design method thereof, and will not be repeated here. BRIEF DESCRIPTION OF THE DRAWINGS

[0039] Figure 1 A schematic diagram of an image retrieval process provided in an embodiment of the present application;

[0040] Figure 2 A schematic diagram of the structure of an electronic device provided in an embodiment of the present application;

[0041] Figure 3 A flowchart of map image preprocessing in an image retrieval method provided in an embodiment of the present application;

[0042] Figure 4 A schematic diagram of a map image in an image retrieval method provided in an embodiment of the present application;

[0043] Figure 5 A schematic diagram of the minimum circumscribed rectangle of a map image in an image retrieval method provided in an embodiment of the present application;

[0044] Figure 6 A schematic diagram of an image coordinate system in a map image in an image retrieval method provided in an embodiment of the present application;

[0045] Figure 7 A schematic diagram of a map image area division in an image retrieval method provided in an embodiment of the present application;

[0046] Figure 8 A schematic diagram of dividing a map image region in another image retrieval method provided in an embodiment of the present application;

[0047] Fig. 9 A schematic diagram of dividing a map image region in another image retrieval method provided in an embodiment of the present application;

[0048] Fig.10 A flowchart of an image retrieval method provided in an embodiment of the present application;

[0049] Fig.11 A schematic diagram of a module structure of an electronic device provided in an embodiment of the present application;

[0050] Fig.12 A schematic diagram of the structure of a chip system provided in an embodiment of the present application. DETAILED DESCRIPTION

[0051] In the description of the embodiments of the present application, the terms used in the following embodiments are only for the purpose of describing specific embodiments, and are not intended to be used as limitations to the present application. As used in the specification and the appended claims of the present application, the singular expressions "a", "said", "above", "the" and "this" are intended to also include such expressions as "one or more", unless there is a clear contrary indication in the context. It should also be understood that in the following embodiments of the present application, "at least one", "one or more" refer to one or more (including two). The term "and / or" is used to describe the association relationship of associated objects, indicating that three relationships can exist; for example, A and / or B can represent: A exists alone, A and B exist at the same time, and B exists alone, where A and B can be singular or plural. The character " / " generally indicates that the associated objects before and after are a kind of "or" relationship.

[0052] References to "one embodiment" or "some embodiments" etc. described in this specification mean that one or more embodiments of the present application include specific features, structures or characteristics described in conjunction with the embodiment. Thus, the statements "in one embodiment", "in some embodiments", "in some other embodiments", "in some other embodiments", etc. that appear in different places in this specification do not necessarily refer to the same embodiment, but mean "one or more but not all embodiments", unless otherwise specifically emphasized in other ways. The terms "including", "comprising", "having" and their variations all mean "including but not limited to", unless otherwise specifically emphasized in other ways. The term "connection" includes direct connection and indirect connection, unless otherwise specified. "First" and "second" are used for descriptive purposes only and cannot be understood as indicating or implying relative importance or implicitly indicating the number of technical features indicated.

[0053] In the embodiments of the present application, words such as "exemplary" or "for example" are used to indicate examples, illustrations or descriptions. Any embodiment or design described as "exemplary" or "for example" in the embodiments of the present application should not be interpreted as being more preferred or more advantageous than other embodiments or designs. Specifically, the use of words such as "exemplary" or "for example" is intended to present related concepts in a specific way.

[0054] In the scenarios of visual positioning system (VPS) and augmented reality (AR) navigation, image positioning can be achieved through image retrieval.

[0055] Exemplarily, VPS refers to an image-based positioning technology that obtains the location information of the current device in the environment by processing and analyzing the query image and the database image. Among them, the processing and analysis process of the query image and the database image can be called image retrieval. It can be understood that image retrieval is an important module in VPS. Its function is to quickly retrieve images related to or similar to the query image content from a large-scale image database (hereinafter referred to as the database in the embodiment of this application) given a query image, and sort them according to the retrieval distance for use by downstream modules.

[0056] For example, reference Figure 1 As shown, Figure 1A schematic diagram of the image retrieval process of content-based image retrieval (CBIR) is provided. The main process includes image preprocessing of the query image. For example, image preprocessing includes image enhancement, image rotation, image filtering, image segmentation, etc. Feature extraction is performed on the query image (or the query image after preprocessing), and efficient, stable and repeatable features are extracted to obtain query image features. Exemplarily, feature extraction methods include scale-invariant feature transform (SIFT), speeded up robust features (SURF), convolutional neural network (CNN), etc. After feature extraction, an image feature index is established based on the image in the image database, and query image features are extracted and a feature vector is constructed. The query image features are searched for similarity with the image feature library, and the search results about the query image are returned based on the similarity search results and the image feature index. Among them, the search matching is implemented by the search module.

[0057] For existing image retrieval methods based on image content, if the number of images in the database is too large, it means that there are too many contents (or features) of the images to be retrieved for matching, which will cause problems such as increased time-consuming and costly image retrieval and low image retrieval efficiency.

[0058] This embodiment proposes an image retrieval method, wherein the map image to be retrieved and matched by the query image includes multiple map point images, the map image is divided into multiple image areas, each image area includes multiple map point images, and the first image is a part of the image in the image area. The electronic device first retrieves and matches the query image with the first image of the map image, which can reduce the number of map images that are retrieved and matched with the query image in the first level. After obtaining the first matching degree between the query image and each first image, the target image area is determined from the image area according to the first matching degree and the image area to which each first image belongs. The query image is retrieved and matched with the second image in the target image area in the second level to obtain the second matching degree between the query image and each second image. The second image is an image in the target image area other than the first image. After the query image is retrieved and matched twice in a hierarchical manner with the first image and the second image, the number of map images that are retrieved and matched with the query image is greatly reduced, the time consumption of the image retrieval can be reduced, and the efficiency of the image retrieval can be improved. Finally, based on the first matching degree and the second matching degree, the image retrieval result of the query image is determined, and the loss of the image content in the image area is avoided, thereby ensuring that the effect of the image retrieval is not reduced.

[0059] The image retrieval method provided in the embodiments of the present application can be applied to a computing device, or an electronic device. For example, the electronic device can be an independent server, a server cluster, etc., or a notebook computer, a personal computer (PC), etc. The following embodiments do not impose any special restrictions on the specific form of the electronic device.

[0060] For example, please refer to Figure 2 , which shows a structural block diagram of an electronic device (such as electronic device 100) provided in an embodiment of the present application. Figure 2 The electronic device shown may include: a processor 201 , a memory 202 , a communication module 203 and a bus 204 . The processor 201 , the memory 202 and the communication module 203 may be connected via the bus 204 .

[0061] The processor 201 is the control center of the electronic device, and may be a general-purpose central processing unit (CPU) or other general-purpose processors, etc. The general-purpose processor may be a microprocessor or any conventional processor, etc.

[0062] As an example, the processor 201 may include one or more CPUs, such as Figure 2 CPU0 and CPU1 are shown in the figure.

[0063] The memory 202 may be a read-only memory (ROM) or other type of static storage device that can store static information and instructions, a random access memory (RAM) or other type of dynamic storage device that can store information and instructions, an electrically erasable programmable read-only memory (EEPROM), a disk storage medium or other magnetic storage device, or any other medium that can be used to carry or store desired program code in the form of instructions or data structures and can be accessed by a computer, but is not limited to these.

[0064] In a possible implementation, the memory 202 may exist independently of the processor 201. The memory 202 may be connected to the processor 201 via a bus 204 and used to store data, instructions, or program codes. When the processor 201 calls and executes the instructions or program codes stored in the memory 202, the split-screen display method provided in the embodiment of the present application can be implemented.

[0065] In another possible implementation, the memory 202 may also be integrated with the processor 201 .

[0066] The communication module 203 is used for the electronic device to connect with other devices through a communication network, and the communication network can be Ethernet, a radio access network (RAN), a wireless local area network (WLAN), etc. The communication module 203 may include a receiving unit for receiving data and a sending unit for sending data.

[0067] In this embodiment, if other devices have the need for image retrieval and image positioning, the other devices may send a query request carrying a query image to the electronic device 100. The communication module 203 of the electronic device 100 may communicate with other devices through a communication network. For example, the communication module 203 of the electronic device 100 may receive a query request sent by other devices through a communication network. Afterwards, the communication module 203 may forward the query request to the processor 201. The processor 201 obtains the query image by parsing the query request. The processor 201 of the electronic device 100 implements image positioning of the query image based on the image retrieval method provided in this embodiment and the image positioning method based on the image retrieval result, and obtains an image positioning result. The processor 201 transmits the image positioning result to the communication module 203, so that the communication module 203 sends a request response carrying the image positioning result to other devices.

[0068] Exemplarily, the other devices may be terminals, such as mobile phones, tablet computers, wearable electronic devices, augmented reality (AR) / virtual reality (VR) devices, etc.

[0069] The bus 204 may be an industry standard architecture (ISA) bus, a peripheral component interconnect (PCI) bus, or an extended industry standard architecture (EISA) bus. The bus may be divided into an address bus, a data bus, a control bus, etc. For ease of representation, Figure 2 Only one thick line is used in the diagram, but this does not mean that there is only one bus or only one type of bus.

[0070] It should be pointed out that Figure 2 The structure shown in the figure does not constitute a limitation on the electronic device 100. Figure 2In addition to the components shown, the electronic device 100 may also include more or fewer components than shown, or combine certain components, or arrange the components differently. In conjunction with specific illustrations, the image retrieval method provided by the embodiment of the present application is introduced with the electronic device as the execution subject. The image retrieval method provided in this embodiment includes two parts, one part is the area division processing of the map image and the screening processing of the first image and the second image; the other part is the image retrieval part based on the first image and the second image in the map image after area division.

[0071] refer to Figure 3 The method flow chart shown in the figure, the process of performing area division processing on the map image and screening processing of the first image and the second image includes:

[0072] S201, obtaining a map image.

[0073] In this embodiment, the map image may include multiple map point images at different angles collected by the image acquisition device. Among them, the map point refers to a certain place in the map. For example, when the map image is a map image of the first floor of a shopping mall, the map points in the map image may include shops, stalls, shared charging piles, toilets, passages, elevators, escalators, service desks, etc. on the first floor of the shopping mall. Then, the image corresponding to each map point is the map point image, that is, the map image of the first floor of the shopping mall includes shop images, stall images, shared charging pile images, toilet images, passage images, elevator images, escalator images, service desk images, etc. taken from different angles by different image acquisition devices or the same image acquisition device. For another example, when the map image is a map image of the first floor of the terminal building, the map points in the map image may include the manual check-in counter, self-service check-in counter, security checkpoint, boarding gate, shared charging pile, toilet, passage, elevator, escalator, manual service desk, etc. on the first floor of the terminal building. Then, the map point image may include images of manual check-in counters, self-service check-in counters, security checkpoints, boarding gates, shared charging piles, restrooms, passages, elevators, escalators, manual service desks, etc. taken from different angles by different image acquisition devices or the same image acquisition device. The electronic device can obtain the map image corresponding to an actual scene based on all the map point images corresponding to the actual scene. For example, if the actual scene is a certain floor, the map image of the floor can be obtained based on the store images, stall images, shared charging pile images, restroom images, passage images, elevator images, escalators, and service desk images taken from different angles of the floor.

[0074] A map image of an actual scene may include one or more map point images. The actual scene may cover one or more actual areas. For example, the actual scene may include the indoor area of ​​each floor of a shopping mall; it may also include the indoor area of ​​each floor of multiple shopping malls; it may also include the indoor area of ​​each floor of multiple shopping malls and outdoor road areas, etc. For example, Figure 4 A schematic diagram of a map image of a certain floor is given. Figure 4 The map image shown includes a plurality of map point images and movement tracks. Here, the movement track includes the track of the map point images included in the current map image during the movement of the image acquisition device. It should be noted that Figure 4 The number and positions of the multiple map point images included in the shown map image are only for illustration.

[0075] That is, the map image involved in this embodiment may include a map image of an actual indoor scene; may also include a map image of an actual outdoor scene; may also include a map image of an actual indoor scene and a map image of an actual outdoor scene.

[0076] The map point images in the map image can be acquired from different angles by a moving image acquisition device. For example, by a mobile platform, or a manually handheld, or self-movable method such as a drone image acquisition device, the image acquisition device collects images of various points in a certain area from different angles during the movement. For example, the actual scene is the first floor area of ​​a shopping mall. By manually hand-holding an image acquisition device, the image acquisition device can be moved at a uniform speed along the aisle of the shopping mall to collect the passed shops, stalls, shared charging piles, toilets, passages, elevators, escalators, service desks and other map points from different angles, and obtain shop images, stall images, shared charging pile images, toilet images, passage images, elevator images, escalator images, service desk images and the like at different angles. Accordingly, the moving trajectory formed by the uniform movement of the image acquisition device along the aisle of the shopping mall can be reflected in the map image formed by the map point images in the form of a passage image.

[0077] When capturing map point images, the image acquisition device can directly mark the pose of the map point images based on the image coordinate system and the world coordinate system. The pose can be the coordinates (x, y, z) of the image acquisition device in the world coordinate system when capturing the map point images. Optionally, if the actual scene is an indoor scene on each floor of a shopping mall, then the coordinates (z) perpendicular to the earth's surface are the same in the poses of the map point images captured on the same floor.

[0078] Optionally, after the image acquisition device acquires the map point image, it may store the map point image in a designated storage space or database. The map point image stored here may be marked with a posture. The electronic device may obtain the map image from the designated storage space or database. After the map image is subsequently processed by region division or other image processing, the processed map image may also be stored in the original storage space or original database.

[0079] Alternatively, the image acquisition device may also directly transmit the acquired map point image to the electronic device. Here, the map point image sent by the image acquisition device to the electronic device may also be marked with a posture. The electronic device may first store the map point image in a designated storage space or database. When it is necessary to obtain the map point image for image processing, the map point image may be obtained from the designated storage space or database.

[0080] After acquiring the map point image, the electronic device may perform a region division process on the map image formed by the map point image to obtain a plurality of image regions of the map image. Specifically, it includes S202-S204.

[0081] S202: Acquire a map outline of the map image according to the position and posture of the map point image in the map image.

[0082] The pose of the map point image is the coordinates (x, y, z) of the image acquisition device in the world coordinate system when the map point image is acquired. The pose of the map point image is known information marked by the image acquisition device and can be directly obtained by the electronic device.

[0083] In some embodiments, the electronic device obtains the position and posture of all map point images contained in the map image of the current actual scene, and determines the movement trajectory of the image acquisition device in all map point images based on the position and posture of all map point images. And, the electronic device can determine the coordinates of the map points corresponding to the map point images based on the position and posture of the map point images. Here, collecting the movement trajectory of the image acquisition device in all map point images means the channel for objects, such as people, to move in the current actual scene; according to the movement trajectory and each map point in the map point image, the map outline of the map represented by the map image is determined. The map outline includes: channel images and map points corresponding to the map point images, etc. For example, the current actual scene is the first floor of a shopping mall, and the map outline corresponding to the map image of the first floor of the shopping mall includes the channel image of the first floor of the shopping mall and the map points corresponding to the map point images corresponding to the first floor of the shopping mall, etc.

[0084] After obtaining the map outline of the map image, the electronic device can obtain the map points included in the outer boundary of the map outline. Among them, the electronic device can obtain the map points included in the outer boundary of the map outline by a convex hull algorithm. In this embodiment, the convex hull is a convex polygon formed by connecting the outermost map points in the map image, the convex polygon includes the map points of the outer boundary of the map outline, and the convex polygon includes all the map points in the map image except the map points of the outer boundary. Among them, the process of constructing the convex hull using the convex hull algorithm includes determining the map point with the smallest ordinate from the map outline of the map image, taking it as the first point of the convex hull, and obtaining the polar angles of other map points and the first point. Sort the polar angles from small to large, add the sorted map points to the convex hull in turn and maintain the properties of the convex hull until all the map points are traversed. Remove the repeated parts of the first point in the convex hull, and obtain the final convex hull. The process of determining the convex hull is the process of determining the map points included in the outer boundary of the map outline. Among them, the process of maintaining the properties of the convex hull is the process of maintaining a monotonically rising slope.

[0085] S203: Determine a target point based on the map outline, take the target point as the coordinate origin, and construct an image coordinate system in the map image.

[0086] Among them, the target point can be any point among the map points included in the map outline; it can also be a point determined based on the map points included in the map outline. When the map image includes map point images on the same floor, the z coordinates of these map point images on the same floor are the same. Therefore, in this case, a two-dimensional image coordinate system of the map image can be directly established. In the process of processing the map image, the electronic device will perform region division processing on the map images at the same height. For example, the map image includes map images of each floor of a shopping mall, then the electronic device will construct an image coordinate system and perform subsequent region division processing on the map images of each floor of the shopping mall respectively. The z coordinates of the map point images in each layer of the map image are the same. Therefore, the image coordinates involved in this embodiment are two-dimensional image coordinate systems.

[0087] Exemplarily, the electronic device may determine a circumscribed polygon that may contain all map points and channels in the map outline. The interior of the circumscribed polygon should include all map points included in the map outline. An image coordinate system is established with one of the multiple vertices of the circumscribed polygon as the coordinate origin and two adjacent sides of the point as the horizontal axis and the vertical axis. Optionally, the rectangle corresponding to the map outline may be its minimum circumscribed rectangle.

[0088] In some embodiments, one implementation of S203 includes:

[0089] S2031. Based on the map points included in the map outline, obtain the minimum circumscribed rectangle corresponding to the map outline.

[0090] In some embodiments, the electronic device may perform a dimensionality reduction operation on the map points included in the map outline through a principal component analysis (PCA) algorithm to obtain information such as the geometric center and principal axis direction of all map points included in the map outline, and then fit a minimum circumscribed rectangle based on this information.

[0091] Specifically, the electronic device can calculate the geometric center of all map points included in the map outline and the covariance matrix of the map points using the PCA algorithm according to the coordinates of the map points included in the map outline. The covariance matrix is ​​eigen-decomposed to obtain eigenvectors and eigenvalues. The eigenvector is the feature of the covariance matrix, which is used to characterize the main axis direction of all map points of the map outline. The eigenvectors are sorted in the order of the eigenvalues, and the direction where the maximum eigenvector is located is determined as the main axis direction. The main axis direction can be understood as the direction of one side of the minimum circumscribed rectangle, for example, it can be the direction where the length of the rectangle is located. After obtaining the main axis direction, the length of the length is determined based on the outer boundary points of the map outline included in the convex hull. For example, the two points farthest from the geometric center in the main axis direction are obtained, and the length between the two points is determined as the main axis length, that is, the length of the long side of the rectangle. The direction perpendicular to the long side of the rectangle is the direction where the width of the rectangle is located. Similarly, the two points farthest from the geometric center in the width direction are obtained, and the length between the two points is determined as the length of the width. In this way, the circumscribed rectangle corresponding to the map outline can be determined. Optionally, in order to obtain the smallest rotated rectangle, the main axis can be adjusted to align with the edge of the rectangle. For example, if the main axis angle is greater than 45 degrees, then the angle is subtracted by 90 to align the main axis with the rectangle. This will obtain the smallest circumscribed rectangle corresponding to the map outline. Figure 5 As shown, Figure 5 A schematic diagram of the minimum circumscribed rectangle of a map outline is given.

[0092] S2032. Take any vertex of the minimum circumscribed rectangle as the target point, and construct an image coordinate system in the map image with two adjacent sides of the target point as the horizontal axis and the vertical axis respectively.

[0093] In some embodiments, after obtaining the minimum circumscribed rectangle of the map outline, the electronic device can use any one of the four vertices of the minimum circumscribed rectangle as the target point, that is, as the origin of the pre-constructed image coordinate system. The image coordinate system corresponding to the map image is constructed with the two sides of the minimum circumscribed rectangle adjacent to the target point as the horizontal axis and the vertical axis respectively. Figure 6 As shown, Figure 6 A schematic diagram of an image coordinate system in a map image is given. Figure 6 In the figure, the vertex P of the minimum circumscribed rectangle is taken as the target point, the adjacent side A is taken as the horizontal axis (X axis), and the adjacent side B is taken as the vertical axis (Y axis) to establish the image coordinate system.

[0094] Optionally, in some embodiments, another implementation of S203 includes:

[0095] Determine any map point from the map outline as the target point, take the target point as the origin, and take any two mutually perpendicular straight lines as the horizontal axis and vertical axis of the image coordinate system to construct the image coordinate system in the map image.

[0096] S204 , starting from the origin of the image coordinate system, along the horizontal axis and the vertical axis of the image coordinate system, the map image is divided into regions with a preset step length to obtain a plurality of image regions.

[0097] In this embodiment, starting from the origin of the image coordinate system, the map image is drawn along the horizontal axis of the image coordinate system with a preset step length, and the map image is drawn along the vertical axis of the image coordinate system with a preset step length. The dividing line of the horizontal axis and the dividing line of the vertical axis divide the map image into multiple image areas. Figure 7 As shown, Figure 7 , starting from the coordinate origin point P, the horizontal axis dividing line is made along the horizontal axis with a preset step length, and the vertical axis dividing line is made along the vertical axis with a preset step length, and the map image is divided into 9 rectangular image areas. Optionally, the preset step length can be determined according to the distribution density of the map points in the map image. If the distribution density of the map points is high, the value of the preset step length can be set within a first value range; if the distribution density of the map points is low, the value of the preset step length can be set within a second value range. Among them, the maximum value of the first value range is less than the minimum value of the second value range.

[0098] Optionally, since the map image may include intersections, which are relatively iconic points, intersection areas can also be divided for the intersections. Exemplarily, the electronic device can identify the intersection image in the map image, and construct a regular graphic area of ​​a preset range as the intersection area with the intersection point in the intersection image as the center point. For example, with the intersection point as the center point, a rectangular intersection area is constructed with the first side length and the second side length; for example, with the intersection point as the center point, a square intersection area is constructed with the third side length; for another example, with the intersection point as the center point, a circular intersection area is constructed with a preset radius, and so on.

[0099] S205: Identify the intersection image in the map image and determine the intersection point of the intersection image.

[0100] In some embodiments, the electronic device may perform road network recognition on the map image, obtain an intersection image in the map image, obtain the position and posture of the intersection image, and determine the intersection point in the intersection image.

[0101] S206 , taking the intersection point as the center and drawing a circle with a preset radius, to obtain an intersection area corresponding to the intersection image.

[0102] After the electronic device obtains each intersection point in the map image, it takes each intersection point as the center of the circle and draws a circular area with a preset radius to obtain the intersection area. Figure 8 As shown, Figure 8 A schematic diagram of an intersection image, an intersection point, and an intersection area in a map image is given.

[0103] The intersection area may include one or more map point images.

[0104] Optionally, the preset radius may also be determined according to the distribution density of the map points in the map image. If the distribution density of the map points is high, the value of the preset radius may be set within a third value range; if the distribution density of the map points is low, the value of the preset radius may be set within a fourth value range. The maximum value of the third value range is less than the minimum value of the fourth value range.

[0105] S207: Obtain a map image after region division processing.

[0106] After the map image is divided into image regions as in step S204 and the intersection regions as in step S206, a map image is obtained after the region division processing.

[0107] Thus, after the above steps, the map image is divided into regions, and multiple rectangular image regions and multiple circular intersection regions of the map image are obtained. The image region and the intersection region are collectively referred to as regions. Dividing the map image into regions is to perform pose clustering on the map image. The regions obtained after the division can also be understood as the classification results of the map image. Each region represents a category. The map image includes multiple regions (categories).

[0108] The electronic device determines the map outline of the map image based on the position and posture of the map point image in the map image. Based on the map outline and the convex hull algorithm, the minimum circumscribed rectangle of the map outline is determined; based on the minimum circumscribed rectangle, the origin and the horizontal and vertical axes of the image coordinate system are determined, so that the map image is divided into several image areas (categories) along the horizontal and vertical axes with a preset step length starting from the origin. This area division method does not depend on the image content (features) of the map image, and the number of divided areas (categories) of the obtained map image is relatively balanced. In the subsequent image retrieval and matching process based on the divided image areas, the effect of image retrieval and matching can be guaranteed, avoiding the problem that the number of features in the category is uneven due to the large image content (features) of some categories and the small image content (features) of some categories, thereby affecting the image retrieval and matching (classification) effect.

[0109] In some embodiments, dividing the map image into regions to obtain multiple image regions of the map image may also include another implementation method:

[0110] In some embodiments, the electronic device may divide the map image into regions by directly taking one of the four vertices of the map image as a starting point and dividing the regions along the boundary of the map image with a preset step length to obtain multiple image regions of the map image. Fig. 9 As shown, Fig. 9 A schematic diagram of directly dividing a map image into multiple image regions is given. Fig. 9 In the example, starting from vertex O of the map image, dividing lines are made along two directions of the adjacent edges of vertex 0 with preset step lengths to obtain multiple divided image areas.

[0111] After the map image is divided into regions, the image region of the map image may be screened for the first image. In some embodiments, the method includes:

[0112] S208: Determine a first image in the image area based on the map point images included in the image area.

[0113] For each image region in the map image, each image region includes a plurality of map point images.

[0114] The electronic device may use a first number of map point images in the image area as the first image and the remaining map point images as the second image. When screening the first image and the second image, the electronic device should ensure that the first image and the second image are evenly distributed in the image area.

[0115] For example, the electronic device may obtain the earliest map point image in the image region, and take the earliest map point image as the starting point, select a map point image at a preset interval as the first image, and obtain a first number of first images in the image region. Accordingly, the map point images in the image region other than the first image are second images.

[0116] Optionally, the electronic device may also store the first image and the second image of each map area in a preset storage space, so as to perform subsequent primary image retrieval and secondary image retrieval of the query image. Optionally, the first image and the second image may be stored in the same storage space, and the first image and the second image may have different image tags, so as to obtain the corresponding images; the first image and the second image may also be stored in different storage spaces.

[0117] Here, the first image may also be referred to as a key image, which is an image that matches the query image in the primary image search, and the second image may also be referred to as a non-key image, which is an image that matches the query image in the secondary image search.

[0118] Optionally, all map point images included in the intersection area obtained in the above step S206 can be regarded as the first image.

[0119] Alternatively, part of the map point images included in the intersection area is determined as the first image. For example, after the intersection area is determined, the number of map point images in the intersection area can be counted, and the first proportion of the map point images in the intersection area can be randomly regarded as the first image, and the remaining part of the map point images can be regarded as the second image. Here, the first proportion can be 40%, 50%, 60%, etc. Alternatively, the method of determining the first image from the image area can also be referred to to determine the first image in the intersection area.

[0120] In some embodiments, determining the first image and the second image from the image area based on a preset distance can ensure that the distribution of the first image and the second image in the regional image is uniform and balanced, and in the image retrieval process based on the first image and the second image, the image retrieval effect can be guaranteed.

[0121] Optionally, another implementation of determining the first image and the second image in the image area includes:

[0122] The electronic device may count the number of map point images in each image region, and then randomly obtain a second proportion of map point images in the image region as the first image, and use the remaining map point images as the second image, etc. For example, the second proportion may be 40%, 50%, 60%, etc.

[0123] In some embodiments, the map image is regionalized through the above embodiments to obtain an image region; after determining the first image and the second image in the image region, the image retrieval process for the query image based on the first image and the second image can refer to Fig.10 As shown, including:

[0124] S301: Search and match a query image with first images in a map image to obtain a first matching degree between the query image and each first image.

[0125] In this embodiment, the electronic device searches and matches the query image with the first images in all image regions of the map image. The search and matching process may include extracting the feature descriptor of the query image and the feature descriptors of all the first images using a network local aggregated descriptor vector (NetVlad), matching the feature descriptor of the query image with the feature descriptors of all the first images one by one, and obtaining the matching result of the query image and each first image. Exemplarily, the matching result of the query image and the first image may be determined by calculating the distance between the feature descriptor of the query image and the feature descriptor of the first image. For example, the Hamming distance between the feature descriptor of the query image and the feature descriptor of the first image is calculated, and the Hamming distance is used to characterize the similarity between two objects. The matching result may characterize the feature similarity (first matching degree) between the query image and each first image. That is, the matching result includes the first matching degree between the query image and each first image in each image region.

[0126] S302: Determine a target image region from the image region according to the first matching degree and the image region to which each first image belongs.

[0127] In this embodiment, after obtaining the first matching degree between the query image and each first image in each image region, the electronic device may determine the target image region according to the first matching degree of each first image and the image region to which each first image belongs.

[0128] Exemplarily, the image region to which the first image with a first matching degree greater than a matching degree threshold belongs can be determined as the target image region. For example, among 1000 first matching degrees, 450 first images have a first matching degree greater than the matching degree threshold. The image regions to which the 450 first images belong are analyzed and counted. There may be multiple first images belonging to the same image region among the 450 first images. After analysis and statistics, the image region to which the 450 first images belong is determined as the target image region. Exemplarily, the matching degree threshold can be 60%-80%.

[0129] Optionally, the electronic device may also determine, from the image area to which the first image to which the first matching degree is greater than the matching degree threshold belongs, an image area whose image area appearance frequency is greater than the frequency threshold as the target image area. For example, among the 450 first images to which the first matching degree is greater than the matching degree threshold, the frequency of the first image area appearance is 15, the frequency of the second image area appearance is 10, the frequency of the third image area appearance is 3, and the frequency of the fourth image area appearance is 2. The image area with a frequency greater than 10 is taken as the target image area, and the target image area includes the first image area and the second image area.

[0130] Optionally, the electronic device may first arrange the first matching degree in descending order, and count the image areas of the first images of the TOPN in the arrangement. Here, N may be a natural number greater than 1, for example, N is 30, 40, 50, etc. After obtaining the image areas of the first images of the TOPN, the frequency of occurrence of the image areas is counted. For example, in the arrangement of TOP30, the frequency of occurrence of the first image area is 15, the frequency of occurrence of the second image area is 10, the frequency of occurrence of the third image area is 3, the frequency of occurrence of the fourth image area is 2, and so on. The image area with a frequency greater than the frequency threshold is determined as the target area. For example, the frequency threshold may be 10, that is, the first image area and the second image area are the target image areas. Optionally, the electronic device may also arrange the frequency in descending order, and take the image areas of the TOPM as the target area. Here, M may be a natural number greater than 1, for example, M is 3, 4, 5, etc. Exemplarily, the image area of ​​the TOP3 is taken as the target area, then the first image area, the second image area, and the third image area are the target image areas.

[0131] In one implementation of determining the target image area, the method includes:

[0132] S3021. Arrange the first matching degrees in descending order to obtain a first image within a first target range.

[0133] The electronic device may also first arrange the first matching degree in descending order, and count the first images of the first target range in the arrangement. Here, the first target range can be understood as the TOPN of the first matching degree in descending order. For example, N is 30. The electronic device obtains the TOP30 first images in the descending order of the first matching degree, and determines the image area to which the TOP30 first images belong.

[0134] S3022. Count the frequency of the image area to which the first image belongs within the first target range.

[0135] In this embodiment, the electronic device counts the frequency of occurrence of the image region of the first image according to the image region of each first image within the first target range. For example, in the TOP30 arrangement, the frequency of occurrence of the first image region is 16, the frequency of occurrence of the second image region is 9, the frequency of occurrence of the third image region is 3, the frequency of occurrence of the fourth image region is 2, and so on.

[0136] S3023: Arrange the frequencies of the image regions to which the first image belongs within the first target range in descending order, and determine the image region of the second target range as the target image region.

[0137] The electronic device can also arrange the image areas of the first image within the first target range in descending order of frequency, and take the image areas of the second target range as the target image areas. Here, the second target range can be understood as TOPM arranged in descending order of frequency. M can be a natural number greater than 1, for example, M is 3, 4, 5, etc. For example, take the image area of ​​TOP3 as the target area. Exemplarily, within the first target range, the frequency of the first image area is 16, the frequency of the second image area is 9, the frequency of the third image area is 3, and the frequency of the fourth image area is 2, then the first image area, the second image area, and the third image area are target image areas.

[0138] S303: perform search and matching on the query image and the second images in the target image area to obtain a second matching degree between the query image and each second image.

[0139] In this embodiment, the electronic device retrieves and matches the query image with the second image in the target image area. The retrieval and matching process may include extracting the feature descriptor of the query image and the feature descriptor of the second image in the target image area using NetVlad, etc., matching the feature descriptor of the query image with the feature descriptor of the second image in the target image area one by one, and obtaining the matching result of the query image and each second image. Exemplarily, the matching result of the query image and the second image may be determined by calculating the distance between the feature descriptor of the query image and the feature descriptor of the second image. For example, the Hamming distance between the feature descriptor of the query image and the feature descriptor of the second image is calculated. The matching result may characterize the feature similarity (second matching degree) between the query image and each second image. That is, the matching result includes the second matching degree between the query image and each second image.

[0140] S304: Determine a map point image that matches the query image according to the first matching degree and the second matching degree.

[0141] In this embodiment, the electronic device may arrange the first matching degree and the second matching degree in descending order, and obtain the map point images corresponding to each matching degree within the third target range as the final image retrieval result of the query image. Here, the third target range can be understood as TOPK arranged in descending order of matching degree, where K is a natural number greater than 1, for example, M is 3, 4, 5, etc. Here, TOPK can also be understood as the K images with the highest matching degree.

[0142] Alternatively, illustratively, the electronic device arranges the first and second matching degrees obtained in descending order, obtains a map point image corresponding to a matching degree greater than a matching degree threshold, and obtains the map point image that matches the query image as the final image retrieval result of the query image. Exemplarily, the matching degree threshold may be 60%-80%. The map point image corresponding to a matching degree greater than the matching degree threshold includes a first image having a first matching degree greater than the matching degree threshold and a second image having a second matching degree greater than the matching degree threshold.

[0143] Alternatively, the electronic device further arranges the first matching degree and the second matching degree of the first image belonging to the target image area in descending order, obtains the map point image corresponding to the matching degree greater than the matching degree threshold; and obtains the TOPK arranged in descending order of matching degree from the map point images corresponding to the matching degree greater than the matching degree threshold as the final image retrieval result of the query image. Exemplarily, the matching degree threshold may be 60%-80%.

[0144] In this embodiment, the map image to be retrieved and matched by the query image includes multiple map point images, the map image is divided into multiple image areas, each image area includes multiple map point images, and the first image is a part of the image in the image area. The electronic device first retrieves and matches the query image with the first image of the map image, which can reduce the number of map images that are retrieved and matched with the query image in the first level. After obtaining the first matching degree between the query image and each first image, the target image area is determined from the image area according to the first matching degree and the image area to which each first image belongs. The query image is retrieved and matched with the second image in the target image area in the second level to obtain the second matching degree between the query image and each second image. The second image is another part of the image in the target image area except the first image. After the query image is retrieved and matched twice with the first image and the second image, the number of map images that are retrieved and matched with the query image is greatly reduced, the time consumption of image retrieval can be reduced, and the efficiency of image retrieval can be improved. Finally, based on the first matching degree and the second matching degree, the image retrieval result of the query image is determined to avoid the loss of image content in the image area. The search matching ensures that the effect of image retrieval is not reduced.

[0145] In some embodiments, after obtaining the image retrieval result of the query image, data support can also be provided for subsequent image positioning processing. For example, the executable steps include:

[0146] S305: Acquire a target image based on the image retrieval result of the query image.

[0147] In this embodiment, the image retrieval results of the query image include corresponding images whose matching degree meets the conditions, such as images whose matching degree is greater than the matching degree threshold, or images whose matching degree is within the third target range. These images are used as target images to perform positioning processing on the query image.

[0148] S306: Perform feature extraction, feature matching, pose calculation and other processing based on the target image and the query image to obtain an image positioning result of the query image.

[0149] The electronic device extracts features from the query image, extracts features from the target image, and performs feature matching between the image features of the query image and the image features of the target image. The target image is actually a map point image, and each map point image is marked with its position and posture. The electronic device can perform positioning calculations based on the position and posture of the target image and the feature matching results to obtain the final image positioning result of the query image.

[0150] The image retrieval method provided in this embodiment can obtain an image retrieval result of a query image, which can provide effective data support for subsequent image positioning processing.

[0151] In some scenarios, for example, after acquiring a query image, a terminal device needs to obtain an image positioning result of the query image.

[0152] Exemplarily, the terminal device may send a query request carrying a query image to the server in this embodiment. After receiving the query request, the server obtains the query image carried in the query request, and determines the map point image matching the query image based on the image retrieval method provided in this embodiment. The map point image matching the query image is subjected to image positioning processing such as step S305 and step S306 to obtain an image positioning result for the query image. The server returns a request response carrying the image positioning result to the terminal device. After receiving the request response, the terminal device obtains the image positioning result and displays the image positioning result on the display interface.

[0153] To further illustrate, for example, a user wants to retrieve the location information of image 1 through the search application of the terminal to locate image 1. After the search application of the terminal receives the image 1 uploaded by the user, it can send a query request carrying image 1 to the server. After receiving the query request, the server obtains image 1 and performs image retrieval and positioning processing on image 1. Specifically, the server determines the map point image matching image 1 based on the image retrieval method provided in this embodiment. The map point image matching the query image is processed as in step S305 and step S306 to obtain the image positioning result of image 1. The server returns a request response carrying the image positioning result to the search application. After receiving the request response, the search application of the terminal obtains the image positioning result, and the image positioning result of image 1 can be displayed on the display interface of the search application. Here, the image positioning result may include the location information of image 1, a map including image 1, and the like, wherein the location information may be a coordinate position in a world coordinate system.

[0154] Among them, the communication method between the server and the terminal device may include wireless communication methods, such as global system for mobile communications (GSM), general packet radio service (GPRS), code division multiple access (CDMA), wideband code division multiple access (WCDMA), time-division code division multiple access (TD-SCDMA), long term evolution (LTE), BT, GNSS, WLAN, NFC, FM, and / or IR technology, etc.

[0155] In some other embodiments, the server may also receive an input query image, and based on the image retrieval method provided in this embodiment, perform image retrieval and subsequent image positioning on the query image, thereby obtaining an image positioning result of the query image. Optionally, the server may output the image positioning result of the query image. For example, the image positioning result of the query image is output in the visual interface of the server; or, the server may send the image positioning result of the query image to other devices. For example, the other device may be a positioning device, etc. Alternatively, the server may also store the image positioning result of the query image in a designated storage space or database for subsequent data use.

[0156] Fig.11A possible structural diagram of the electronic device involved in the above embodiments is shown. Fig.11 The electronic device 1000 shown includes a processor 1001 , a storage module 1002 , and a communication module 1003 .

[0157] Among them, the processor 1001 can be a central processing unit (CPU), a digital signal processor (DSP), an application-specific integrated circuit (ASIC), a field programmable gate array (FPGA) or other programmable logic devices, transistor logic devices, hardware components or any combination thereof. The processor may include an application processor and a baseband processor. It can implement or execute various exemplary logic blocks, modules and circuits described in conjunction with the disclosure of this application. The processor may also be a combination that implements computing functions, such as a combination of one or more microprocessors, a combination of a DSP and a microprocessor, and the like. The storage module 1002 may be a memory.

[0158] For example, the processor 1001 may be Figure 2 The processor 201 shown; the storage module 1002 can be as follows Figure 2 The electronic device provided in the embodiment of the present application can be Figure 2 The electronic device 100 shown. The communication module 1003 can be Figure 2 The communication module 203 in.

[0159] The present application also provides a chip system (eg, a system on a chip (system on a chip, SoC)), such as Fig.12 As shown, the chip system includes at least one processor 701 and at least one interface circuit 702. The processor 701 and the interface circuit 702 can be interconnected by lines. For example, the interface circuit 702 can be used to receive signals from other devices (such as a memory of an electronic device). For another example, the interface circuit 702 can be used to send signals to other devices (such as a processor 701 or a camera of an electronic device). Exemplarily, the interface circuit 702 can read instructions stored in the memory and send the instructions to the processor 701. When the instruction is executed by the processor 701, the electronic device can perform the various steps in the above embodiments. Of course, the chip system may also include other discrete devices, which are not specifically limited in the embodiments of the present application.

[0160] An embodiment of the present application also provides a computer-readable storage medium, which includes computer instructions. When the computer instructions are executed on the above-mentioned electronic device, the electronic device executes each function or step executed by the electronic device 100 in the above-mentioned method embodiment.

[0161] The embodiment of the present application further provides a computer program product, which, when executed on a computer, enables the computer to execute the functions or steps executed by the electronic device 100 in the above method embodiment. For example, the computer may be the above electronic device 100.

[0162] Through the description of the above implementation methods, technical personnel in the relevant field can clearly understand that for the convenience and simplicity of description, only the division of the above-mentioned functional modules is used as an example. In actual applications, the above-mentioned functions can be assigned to different functional modules as needed, that is, the internal structure of the device can be divided into different functional modules to complete all or part of the functions described above.

[0163] In the several embodiments provided in the present application, it should be understood that the disclosed devices and methods can be implemented in other ways. For example, the device embodiments described above are only schematic. For example, the division of the modules or units is only a logical function division. There may be other division methods in actual implementation, such as multiple units or components can be combined or integrated into another device, or some features can be ignored or not executed. Another point is that the mutual coupling or direct coupling or communication connection shown or discussed can be through some interfaces, indirect coupling or communication connection of devices or units, which can be electrical, mechanical or other forms.

[0164] The units described as separate components may or may not be physically separated, and the components shown as units may be one physical unit or multiple physical units, that is, they may be located in one place or distributed in multiple different places. Some or all of the units may be selected according to actual needs to achieve the purpose of the present embodiment.

[0165] In addition, each functional unit in each embodiment of the present application may be integrated into one processing unit, or each unit may exist physically separately, or two or more units may be integrated into one unit. The above-mentioned integrated unit may be implemented in the form of hardware or in the form of software functional units.

[0166] If the integrated unit is implemented in the form of a software functional unit and sold or used as an independent product, it can be stored in a readable storage medium. Based on this understanding, the technical solution of the embodiment of the present application is essentially or the part that contributes to the prior art or all or part of the technical solution can be embodied in the form of a software product, which is stored in a storage medium, including several instructions to enable a device (which can be a single-chip microcomputer, chip, etc.) or a processor (processor) to perform all or part of the steps of the method described in each embodiment of the present application. The aforementioned storage medium includes: U disk, mobile hard disk, read-only memory (ROM), random access memory (RAM), disk or optical disk and other media that can store program code.

[0167] The above contents are only specific implementation methods of the present application, but the protection scope of the present application is not limited thereto. Any changes or substitutions within the technical scope disclosed in the present application shall be included in the protection scope of the present application. Therefore, the protection scope of the present application shall be subject to the protection scope of the claims.

Claims

1. An image retrieval method, characterized in that: The method comprises: Retrieve and match the query image with the first image in the map image to obtain a first matching degree between the query image and each of the first images; wherein the map image refers to an image of one or more regions acquired from different angles by an image acquisition device, the map image is divided into a plurality of image regions, each of the image regions includes one or more map point images, the map point images refer to images corresponding to locations in the region, the image region includes the first image and the second image, and the first image and the second image are evenly distributed in the image region; determining a target image region from the multiple image regions according to the first matching degree and the image region to which each of the first images belongs; Retrieve and match the query image with the second images in the target image area to obtain a second matching degree between the query image and each of the second images; the second images are map point images in the target image area except the first image; A map point image matching the query image is determined according to the first matching degree and the second matching degree.

2. The method according to claim 1, characterized in that The method further comprises: The map image is subjected to a map region division process to obtain a plurality of image regions of the map image.

3. The method according to claim 2, characterized in that The performing map area division processing on the map image to obtain a plurality of image areas of the map image includes: According to the position and posture of the map point images in the map image, a map outline of the map image is obtained; the position and posture are the coordinates of the image acquisition device in the world coordinate system when acquiring the map point images; the map outline includes the map points corresponding to all the map point images in the map image and the channels in the map image; Determine a target point based on the map outline, and construct an image coordinate system in the map image with the target point as the coordinate origin; Starting from the origin of the image coordinate system, the map area in the map image is divided along the horizontal axis and the vertical axis of the image coordinate system with a preset step length to obtain a plurality of image areas of the map image.

4. The method according to claim 3, characterized in that The step of determining a target point based on the map outline, taking the target point as a coordinate origin, and constructing an image coordinate system in the map image includes: Based on all the map points included in the map outline, obtaining a circumscribed polygon corresponding to the map outline; the circumscribed polygon includes all the map points and channels included in the map outline; Any vertex of the circumscribed polygon is used as the target point, and two adjacent sides of the target point are used as the horizontal axis and the vertical axis respectively, so as to construct the image coordinate system in the map image.

5. The method according to claim 2, characterized in that: The multiple image areas also include a road junction area, and the method further includes: Identify a road intersection image in the map image, and determine a road intersection point in the road intersection image; A regular area of ​​a preset range is determined based on the intersection as the intersection area.

6. The method according to claim 2, characterized in that The positions of the first image and the second image in the image area are evenly distributed.

7. The method according to any one of claims 1 to 6, characterized in that The target image region is an image region in which the number of first target images included in the multiple image regions is greater than a threshold, and the first target image is a first image with a first matching degree greater than a matching degree threshold.

8. The method according to any one of claims 1 to 6, characterized in that The map point image matched with the query image includes a first image whose first matching degree is greater than a matching degree threshold and a second image whose second matching degree is greater than the matching degree threshold.

9. The method according to any one of claims 1 to 6, characterized in that: The map point images matching the query image include K images with the highest matching degree in the second target image, and the second target image includes the first image with the first matching degree greater than the matching degree threshold and / or the second image with the second matching degree greater than the matching degree threshold.

10. An electronic device, characterized in that: The electronic device includes a memory, a communication module and one or more processors; the memory and the communication module are coupled to the processor; the memory stores computer program code, and the computer program code includes computer instructions, and when the computer instructions are executed by the processor, the electronic device executes the method as described in any one of claims 1-9.

11. A computer-readable storage medium, characterized in that: The method comprises computer instructions, which, when executed on an electronic device, cause the electronic device to execute the method as claimed in any one of claims 1 to 9.