CN112948620B - Image indexing method and device, electronic equipment and storage medium thereof - Google Patents

Image indexing method and device, electronic equipment and storage medium thereof Download PDF

Info

Publication number
CN112948620B
CN112948620B CN202110484474.8A CN202110484474A CN112948620B CN 112948620 B CN112948620 B CN 112948620B CN 202110484474 A CN202110484474 A CN 202110484474A CN 112948620 B CN112948620 B CN 112948620B
Authority
CN
China
Prior art keywords
target image
image
grid
code string
axis coordinate
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Active
Application number
CN202110484474.8A
Other languages
Chinese (zh)
Other versions
CN112948620A (en
Inventor
李虎民
崔建平
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Beijing Aibee Technology Co Ltd
Original Assignee
Beijing Aibee Technology Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Beijing Aibee Technology Co Ltd filed Critical Beijing Aibee Technology Co Ltd
Priority to CN202110484474.8A priority Critical patent/CN112948620B/en
Publication of CN112948620A publication Critical patent/CN112948620A/en
Application granted granted Critical
Publication of CN112948620B publication Critical patent/CN112948620B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F16/00Information retrieval; Database structures therefor; File system structures therefor
    • G06F16/50Information retrieval; Database structures therefor; File system structures therefor of still image data
    • G06F16/58Retrieval characterised by using metadata, e.g. metadata not derived from the content or metadata generated manually
    • G06F16/587Retrieval characterised by using metadata, e.g. metadata not derived from the content or metadata generated manually using geographical or spatial information, e.g. location
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F16/00Information retrieval; Database structures therefor; File system structures therefor
    • G06F16/50Information retrieval; Database structures therefor; File system structures therefor of still image data
    • G06F16/51Indexing; Data structures therefor; Storage structures

Landscapes

  • Engineering & Computer Science (AREA)
  • Theoretical Computer Science (AREA)
  • Data Mining & Analysis (AREA)
  • Databases & Information Systems (AREA)
  • Physics & Mathematics (AREA)
  • General Engineering & Computer Science (AREA)
  • General Physics & Mathematics (AREA)
  • Library & Information Science (AREA)
  • Software Systems (AREA)
  • Image Analysis (AREA)
  • Compression Or Coding Systems Of Tv Signals (AREA)

Abstract

The application provides an image indexing method, an image indexing device, electronic equipment and a storage medium thereof. In the image indexing method, position information of a target image is acquired, and the position information of the target image is encoded to obtain a position code string of the target image. And searching the image data of the image in the preset range of the position distance target image in the data set by using the position code string of the target image. And finally, finding out K similar images matched with the target image from the image data. Therefore, by utilizing the method, the searching range of the image can be reduced, only the image data in a certain area away from the position of the image is needed to be searched in the data set, and the image data in the whole data set are not needed to be searched, so that the calculated amount of the image index is reduced, and the accuracy of the image index is improved.

Description

Image indexing method and device, electronic equipment and storage medium thereof
Technical Field
The present disclosure relates to the field of data indexing technologies, and in particular, to an image indexing method and apparatus, an electronic device, and a storage medium thereof.
Background
The current society is a society with high development speed, developed technology, information circulation, more and more intimate communication among people, more and more convenient life, and data interconnection is a product of the high-tech age, and people can inquire or store a large amount of data through a data set, wherein the index of image data can be used in a large number of scenes.
The indexing of an image is typically given by one image and then looking directly for one or more images similar to the image to be indexed in the dataset in which the image is stored. However, when the data set is large, there may be many images of similar scenes in the data set, for example, scenes such as a mall, a parking lot, etc., and a large amount of index results may be obtained when the images of such scenes are indexed, and the index results necessarily include a large amount of wrong image data, so that the accuracy of image indexing is greatly reduced.
Disclosure of Invention
In view of this, the present application provides an image indexing method, apparatus, electronic device and storage medium thereof, so as to solve the problem in the prior art that when a data set is large, the accuracy of image indexing is low.
In order to achieve the above purpose, the present application provides the following technical solutions:
the first aspect of the application discloses an indexing method of images, comprising the following steps:
acquiring position information of a target image;
encoding the position information of the target image to obtain a position code string of the target image; the position code string of the target image is used for representing the grid where the target image is located;
searching image data of an image with a position within a preset range from the target image in a data set by using the position code string of the target image;
finding out K similar images matched with the target image from the image data; the similar image is an image with high similarity with the target image, and K is a preset positive integer.
Optionally, in the above method, the encoding the position information of the target image to obtain a position code string of the target image includes:
acquiring range information of a map where the target image is located and range information of grids; wherein the map of the target image is divided into a plurality of grids;
according to the principle that the coordinate codes of the images obtained by calculation are the same in the same grid, the position information of the target image, the range information of the map where the target image is located and the range information of the grid are processed to obtain the coordinate codes of the target image; wherein the coordinate encoding includes an X-axis coordinate encoding and a Y-axis coordinate encoding;
and combining the X-axis coordinate code and the Y-axis coordinate code of the target image to obtain a position code string of the target image.
Optionally, in the above method, according to the principle that the coordinate codes of the images obtained by calculating the images in the same grid are the same, the processing the position information of the target image, the range information of the map where the target image is located, and the range information of the grid, to obtain the coordinate codes of the target image includes:
taking the value of the quotient of the target sum value and the range information of the grid to obtain the coordinate code of the target image; the target sum value is the sum of the position information of the target image and the range information of the map where the target image is located.
Optionally, in the above method, the searching the image data of the image in the preset range of the position distance from the target image in the data set by using the position code string of the target image includes:
searching each position code string which is within a preset range from an image code string library by utilizing the position code string of the target image; wherein, the image code string library comprises: a position code string corresponding to each image of the visual map; the position code strings corresponding to the images are obtained by encoding the position information of the images;
and acquiring image data of the image to which each position code string belongs in the data set.
Optionally, in the above method, the searching each position code string from the target image in a preset range from an image code string library by using the position code string of the target image includes:
decoding the position code string of the target image to obtain a coordinate code of a grid where the target image is located; the coordinate codes of the grid where the target image is located comprise X-axis coordinate codes and Y-axis coordinate codes;
searching an X-axis coordinate code of a grid in a preset range of the grid where the target image is located in the image code string library according to the X-axis coordinate code of the grid where the target image is located, and searching a Y-axis coordinate code of the grid in the preset range of the grid where the target image is located in the image code string library according to the Y-axis coordinate code of the grid where the target image is located;
and respectively combining the searched X-axis coordinate codes of each grid and the searched Y-axis coordinate codes of each grid to obtain a position code string of each grid within a preset range of the grid where the target image is located.
The second aspect of the present application discloses an indexing device for images, comprising:
an acquisition unit configured to acquire positional information of a target image;
the encoding unit is used for encoding the position information of the target image to obtain a position code string of the target image; the position code string of the target image is used for representing the grid where the target image is located;
the first searching unit is used for searching image data of an image with a position within a preset range from the target image in the data set by utilizing the position code string of the target image;
the second searching unit is used for searching K similar images matched with the target image from the image data; the similar image is an image with high similarity with the target image, and K is a preset positive integer.
Optionally, in the foregoing apparatus, the coding unit includes:
the first acquisition subunit is used for acquiring the range information of the map where the target image is located and the range information of the grid; wherein the map of the target image is divided into a plurality of grids;
the processing subunit is used for processing the position information of the target image, the range information of the map where the target image is positioned and the range information of the grid according to the principle that the coordinate codes of the images are the same, which is obtained by calculation, so as to obtain the coordinate codes of the target image; wherein the coordinate encoding includes an X-axis coordinate encoding and a Y-axis coordinate encoding;
and the first combination unit is used for combining the X-axis coordinate code and the Y-axis coordinate code of the target image to obtain a position code string of the target image.
Optionally, in the foregoing apparatus, the processing subunit includes:
the calculating subunit is used for taking the value of the quotient of the target sum value and the range information of the grid to obtain the coordinate code of the target image; the target sum value is the sum of the position information of the target image and the range information of the map where the target image is located.
Optionally, in the foregoing apparatus, the first search unit includes:
the first searching subunit is used for searching each position code string which is within a preset range from the image code string library by utilizing the position code string of the target image; wherein, the image code string library comprises: a position code string corresponding to each image of the visual map; the position code strings corresponding to the images are obtained by encoding the position information of the images;
and the second acquisition subunit is used for acquiring the image data of the image of each position code string in the data set.
Optionally, in the foregoing apparatus, the first search subunit includes:
the decoding subunit is used for decoding the position code string of the target image to obtain the coordinate code of the grid where the target image is located; the coordinate codes of the grid where the target image is located comprise X-axis coordinate codes and Y-axis coordinate codes;
the second searching subunit is used for searching the X-axis coordinate code of the grid in which the target image is positioned in the image code string library according to the X-axis coordinate code of the grid in which the target image is positioned, and searching the Y-axis coordinate code of the grid in which the target image is positioned in the image code string library according to the Y-axis coordinate code of the grid in which the target image is positioned;
and the second combination subunit is used for respectively combining the searched X-axis coordinate codes of each grid and the searched Y-axis coordinate codes of each grid to obtain a position code string of each grid within a preset range of the grid where the target image is located.
A third aspect of the present application discloses an electronic device, comprising:
one or more processors;
a storage device having one or more programs stored thereon;
the one or more programs, when executed by the one or more processors, cause the one or more processors to implement the method of any of the first aspects of the present application.
A fourth aspect of the present application discloses a computer readable medium having stored thereon a computer program, wherein the computer program, when executed by a processor, implements a method according to any of the first aspects of the present application.
According to the technical scheme, in the image indexing method, the position information of the target image is firstly obtained, and then the position information of the target image is encoded to obtain the position code string of the target image. The position code string of the target image is used for representing the grid where the target image is located. And searching the image data of the image in the preset range of the position distance target image in the data set by using the position code string of the target image. Finally, K similar images matched with the target image are searched out from the image data; the similar image is an image with high similarity with the target image, and K is a preset positive integer. Therefore, when the method is used for indexing the target image, firstly, position coding is carried out based on the position information of the target image to obtain a position code string of the target image, so that the position area of the image can be known, then all image data within a preset range from the target image are searched, and then the image with high similarity with the target image is screened out. Therefore, the searching range of the image can be reduced, only the image data in a certain area away from the position of the image is needed to be searched in the data set, and the image data in the whole data set are not needed to be searched, so that the calculated amount of the image index is reduced, and the accuracy of the image index is improved.
Drawings
In order to more clearly illustrate the embodiments of the present application or the technical solutions in the prior art, the drawings that are required to be used in the embodiments or the description of the prior art will be briefly described below, and it is obvious that the drawings in the following description are only embodiments of the present application, and that other drawings may be obtained according to the provided drawings without inventive effort to a person skilled in the art.
FIG. 1 is a flow chart of an indexing method for images disclosed in an embodiment of the present application;
FIG. 2 is a flow chart of one implementation of step S102 disclosed in another embodiment of the present application;
FIG. 3 is a flow chart of one implementation of step S202 disclosed in another embodiment of the present application;
FIG. 4 is a flowchart of a process for constructing an image code string library according to another embodiment of the present application;
FIG. 5 is a flow chart of one implementation of step S301 disclosed in another embodiment of the present application;
FIG. 6 is a schematic diagram of an image indexing device according to another embodiment of the present disclosure;
fig. 7 is a schematic diagram of an electronic device according to another embodiment of the present disclosure.
Detailed Description
The following description of the embodiments of the present application will be made clearly and fully with reference to the accompanying drawings, in which it is evident that the embodiments described are only some, but not all, of the embodiments of the present application. All other embodiments, which can be made by one of ordinary skill in the art without undue burden from the present disclosure, are within the scope of the present disclosure.
In this application, the terms "comprises," "comprising," or any other variation 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 only those elements but may include other elements not expressly listed or inherent to such process, method, article, or apparatus. Without further limitation, an element defined by the phrase "comprising one … …" does not exclude the presence of other like elements in a process, method, article, or apparatus that comprises the element.
Moreover, relational terms such as first and second, and the like may be used solely to distinguish one entity or action from another entity or action without necessarily requiring or implying any actual such relationship or order between such entities or actions.
As known from the background art, in the prior art, when a data set is large, there may be many images of similar scenes in the data set, for example, scenes such as a mall, a parking lot, etc., and when indexing the images of such scenes, a large amount of index results may be obtained, and the index results necessarily include a large amount of wrong image data, so the accuracy of image indexing is greatly reduced.
In view of this, the present application provides an image indexing method, apparatus, electronic device, and storage medium thereof, so as to solve the problem in the prior art that when a data set is large, the accuracy of image indexing is low.
The embodiment of the application discloses an image indexing method, as shown in fig. 1, specifically including:
s101, acquiring position information of a target image.
It should be noted that, when the target image needs to be indexed, the position information of the target image needs to be acquired first, and this position information may be acquired by some positioning devices, for example, when navigating, the target image is an image captured by the mobile phone, and then the position information of the image may use the position currently located by the mobile phone, and the position information is taken as the position prior of the target image, where the position prior includes each coordinate position of the target image, such as an X-axis coordinate, a Y-axis coordinate, and so on.
S102, encoding the position information of the target image to obtain a position code string of the target image; the position code string of the target image is used for representing the grid where the target image is located.
After the position information of the target image is obtained, the position information of the target image is further encoded, each coordinate of the target image is converted into a corresponding coordinate code, and each coordinate code is combined to obtain a position code string of the target image, wherein the position code string of the target image is used for representing the grid where the target image is located.
It should be further noted that, in the embodiment of the present application, the visual map is divided into a plurality of grids with the same size according to the preset length, and the codes are performed according to the coordinates of each grid, so as to obtain the position code string of each grid, and all the images within the same grid range have the same position code as the position code of the grid where the position code string is located. The position code of the target image is thus the position code of the grid in which the target image is located.
Alternatively, in another embodiment of the present application, an implementation of step S102, as shown in fig. 2, may include:
s201, acquiring range information of a map where a target image is located and range information of grids; wherein the map of the target image is divided into a plurality of grids.
The maximum range of the map in which the target image is located, specifically, the maximum coordinate of the map in the X-axis direction and the maximum coordinate of the map in the Y-axis direction, is obtained according to the position information of the target image. And simultaneously acquiring the grid length of the grid in the X-axis direction and the grid length of the grid in the Y-axis direction of the target image.
S202, according to the principle that the coordinate codes of the images obtained by calculation are the same in the same grid, processing the position information of the target image, the range information of the map where the target image is located and the range information of the grid to obtain the coordinate codes of the target image; wherein the coordinate encoding includes an X-axis coordinate encoding and a Y-axis coordinate encoding.
It should be noted that, the coordinate codes of all the images in the same grid are the same, and according to this principle, the coordinates of the target image are encoded by the position information of the target image, the range information of the map where the target image is located, and the range information of the grid, so as to obtain the coordinate code of the target image. The coordinate codes comprise X-axis coordinate codes and Y-axis coordinate codes, and the rule of the coordinate codes can be formulated according to actual conditions.
Optionally, in another embodiment of the present application, an implementation of step S202 may include:
taking the value of the quotient of the target sum value and the range information of the grid to obtain the coordinate code of the target image; the target sum value is the sum of the position information of the target image and the range information of the map where the target image is located.
Specifically, the position information of the target image, the range information of the map where the target image is located and the range information of the grid are substituted into a formula for calculating the coordinate code, so that the coordinate code of the target image is obtained. The calculation coordinate coding formula is as follows:
x_index=int((tx+x_max)/x_grid_size)
y_index=int((ty+y_max)/y_grid_size)
wherein tx is the X-axis coordinate of the target image, ty is the Y-axis coordinate of the target image, x_max is the maximum coordinate of the map of the target image in the X-axis direction, y_max is the maximum coordinate of the map of the target image in the Y-axis direction, x_grid_size is the grid length of the grid of the target image in the X-axis direction, y_grid_size is the grid length of the grid of the target image in the Y-axis direction, x_index is the X-axis coordinate code of the target image, and y_index is the Y-axis coordinate code of the target image.
The above formula is used for calculation, and coordinate codes obtained by calculating coordinates belonging to the same grid range are uniform coordinate codes, for example: assuming x_max=1000, x_grid_size=20, tx=30, and tx=25, substitution into the formula yields:
x_index=int((30+1000)/20)=51
x_index=int((25+1000)/20)=51
it can be seen that the two X-axis coordinates are calculated to have a coordinate code of 51.
S203, combining the X-axis coordinate code and the Y-axis coordinate code of the target image to obtain a position code string of the target image.
After the X-axis coordinate code and the Y-axis coordinate code of the target image are calculated, the X-axis coordinate code and the Y-axis coordinate code of the target image need to be combined to obtain the position code string of the target image. The specific combination formula is as follows:
code=x_index+10e(index_size)*y_index
where code is a position code string of the target image, e is a constant, and index_size is the maximum length of the subcodes. Assuming that index_size=3, x_index=123, and y_index=456, the calculated code is 123456, and 123456 is the position code string of the target image. Similarly, if the x_index and y_index in the formula are interchanged to combine the X-axis coordinate encoding and Y-axis coordinate encoding of the target image, the calculated code is 456123.
S103, searching image data of the image in a preset range of the position distance target image in the data set by using the position code string of the target image.
After the position code string of the target image is obtained, the position area where the image is located can be known, so that the position of the target image can be found in the map by using the position code string of the target image, a range is set, and the image data of each image which is within a preset range from the position of the target image is found by taking the position of the target image as the center.
Alternatively, in another embodiment of the present application, an implementation of step S103 may include:
s301, searching each position code string within a preset range from an image code string library by utilizing the position code string of the target image; wherein, the image code string library comprises: a position code string corresponding to each image of the visual map; the position code string corresponding to each image is obtained by encoding the position information of each image.
It should be noted that, the process of constructing the image code string library may refer to fig. 4, firstly, all images in the visual map and the position coordinates of each image are obtained, then the position coordinates of the images are respectively encoded, the position code strings of each image are obtained by combining, and finally, the position code strings corresponding to all the images are stored in the image code string library, so as to complete the construction of the image code string library.
Therefore, after the position code string of the target image is obtained, each position code string of the target image within a preset range can be found out from the image code string library by utilizing the position code string of the target image, and each position code string of the target image within the preset range can be obtained by only taking the X-axis coordinate code within the preset range in the X-axis coordinate direction of the target image and the adjacent Y-axis coordinate code within the preset range in the Y-axis coordinate direction and then combining the coordinate codes respectively. For example, assuming that the position code string of the target image is 123456, if a position code string having a distance of 1 from the target image on the X-axis is to be acquired, two position code strings of 122456 and 124456 can be obtained. If the position code strings of 3*3 grids around the target image are taken, the nine position code strings of 122455, 123455, 124455, 122456, 123456, 124456, 122457, 23457, 124457 can be obtained.
S302, acquiring image data of an image to which each position code string belongs in a data set.
It should be noted that, after each position code string of the distance target image within the preset range is obtained, an image corresponding to each position code string may be found in the data set, and image data of each found image, such as data of a gray value of the image, a shape feature of the image, and the like, may be obtained.
Alternatively, in another embodiment of the present application, an implementation manner of the step S301, as shown in fig. 5, may include:
s501, decoding a position code string of the target image to obtain a coordinate code of a grid where the target image is located; the coordinate codes of the grid where the target image is located comprise X-axis coordinate codes and Y-axis coordinate codes.
It should be noted that, the position code string of the target image is decoded by a preset decoding formula, so as to obtain the coordinate code of the grid where the target image is located, where the coordinate code of the grid where the target image is located includes an X-axis coordinate code and a Y-axis coordinate code. The specific decoding formula is as follows:
x_index=code[0:index_size]
y_index=code[index_size:]
where x_index represents the coordinate code of X-axis before the index_size bit and the coordinate code of Y-axis after the index_size bit, divided according to the maximum length of subcodes. That is, x_index is the first bit code to index_size bit code in the position code string, and y_index is the code following the index_size bit of the position code string. For example, assuming code=123456 and index_size=3, x_index=123 and y_index=456.
S502, searching an X-axis coordinate code of a grid in a preset range of the grid where the target image is located in the image code string library based on the X-axis coordinate code of the grid where the target image is located, and searching a Y-axis coordinate code of the grid in the preset range of the grid where the target image is located in the image code string library based on the Y-axis coordinate code of the grid where the target image is located.
After the coordinate codes of the grids where the target image is located are obtained, the X-axis coordinate codes and the Y-axis coordinate codes of the grids where the target image is located can be utilized to find out the X-axis coordinate codes of the grids within a preset range of the grids where the target image is located and the Y-axis coordinate codes of the grids within the preset range of the grids where the target image is located in the image code string library. For example, assuming that the X-axis coordinate code of the target image is 123, if the X-axis coordinate code of a grid having a distance of 1 in the X-axis direction from the grid where the target image is located is found, the X-axis coordinate codes of the obtained grid are 122 and 124, respectively. Similarly, assuming that the Y-axis coordinate code of the target image is 456, if the Y-axis coordinate code of the grid having a distance of 1 in the Y-axis direction from the grid where the target image is located is found, the Y-axis coordinate codes of the obtained grids are 455 and 457, respectively.
Specifically, substituting the X-axis coordinate code and the Y-axis coordinate code of the grid where the target image is located into a code search formula, and acquiring the X-axis coordinate code and the Y-axis coordinate code of the grid within a preset range of the grid where the target image is located, wherein the code search formula is as follows:
x_index_all=[x_index-n1,x_index-n1+1,......,x_index+n2]
y_index_all=[y_index-m1,y_index-m1+1,......,y_index+m2]
wherein x_index_all represents the X-axis coordinate codes of all grids in the preset range of the grid where the searched distance target image is located, y_index_all represents the Y-axis coordinate codes of all grids in the preset range of the grid where the searched distance target image is located, and n1 and m1 are constants.
S503, respectively combining the searched X-axis coordinate codes of each grid and the Y-axis coordinate codes of each grid to obtain a position code string of each grid within a preset range of the grid where the distance target image is located.
It should be noted that, using the above mentioned combination formula:
code=x_index+10e(index_size)*y_index
the searched X-axis coordinate codes of each grid and the searched Y-axis coordinate codes of each grid are respectively combined to obtain a position code string of each grid within a preset range of the grid where the distance target image is located, the position code string of each grid is put into a set, and the position code string set of each grid is as follows:
code_all=[code0,code1,......,code_n]
s104, finding K similar images matched with the target image from the image data; the similar image is an image with high similarity with the target image, and K is a preset positive integer.
It should be noted that, according to the image data of the image in the preset range of the found position distance target image, feature extraction is performed on the image data of each image, and then the similarity between each image and the target image is calculated. K images with the highest similarity with the target image are found out from the search according to the similarity between each image and the target image, wherein K is a preset positive integer and can be set according to actual conditions, for example, 5 images. And further screening can be carried out in the K images, and the image closest to the target image is determined.
In the image indexing method provided by the embodiment of the application, the position information of the target image is firstly obtained, and then the position information of the target image is encoded to obtain the position code string of the target image. The position code string of the target image is used for representing the grid where the target image is located. And searching the image data of the image in the preset range of the position distance target image in the data set by using the position code string of the target image. Finally, K similar images matched with the target image are searched out from the image data; the similar image is an image with high similarity with the target image, and K is a preset positive integer. Therefore, when the method is used for indexing the target image, firstly, position coding is carried out based on the position information of the target image to obtain a position code string of the target image, so that the position area of the image can be known, then all image data within a preset range from the target image are searched, and then the image with high similarity with the target image is screened out. Therefore, the searching range of the image can be reduced, only the image data in a certain area away from the position of the image is needed to be searched in the data set, and the image data in the whole data set are not needed to be searched, so that the calculated amount of the image index is reduced, and the accuracy of the image index is improved.
In addition, the method can realize image indexing in any position and any size area in the map, has high speed of position coordinate coding and decoding and small calculated amount, can be well applied to a real-time system, for example, in AR navigation, when navigation is carried out, the mobile phone end can provide current position information of the mobile phone as priori position information of a target image shot in navigation, then image data in a priori position information preset range of the target image are found according to the priori position information of the target image to solve the accurate position of the target image, and the rapid indexing of the image in the map is realized, so that the navigation result is more accurate.
In another embodiment of the present application, an indexing device for an image is also disclosed, as shown in fig. 6, including:
an acquisition unit 601 is configured to acquire positional information of a target image.
The encoding unit 602 is configured to encode the position information of the target image to obtain a position code string of the target image; the position code string of the target image is used for representing the grid where the target image is located.
The first searching unit 603 is configured to search, in the data set, image data of an image within a preset range from the target image by using the position code string of the target image.
A second searching unit 604, configured to search K similar images matched with the target image from the image data; the similar image is an image with high similarity with the target image, and K is a preset positive integer.
In this embodiment, the specific execution process of the obtaining unit 601, the encoding unit 602, the first searching unit 603, and the second searching unit 604 may refer to the content of the method embodiment corresponding to fig. 1, which is not described herein again.
In the image indexing device provided in the embodiment of the present application, the acquiring unit 601 first acquires the position information of the target image, and then the encoding unit 602 encodes the position information of the target image to obtain the position code string of the target image. The position code string of the target image is used for representing the grid where the target image is located. The first search unit 603 searches the data set for image data of an image within a predetermined range of the position from the target image using the position code string of the target image. Finally, the second searching unit 604 searches K similar images matched with the target image from the image data; the similar image is an image with high similarity with the target image, and K is a preset positive integer. Therefore, when the method is used for indexing the target image, firstly, position coding is carried out based on the position information of the target image to obtain a position code string of the target image, so that the position area of the image can be known, then all image data within a preset range from the target image are searched, and then the image with high similarity with the target image is screened out. Therefore, the searching range of the image can be reduced, only the image data in a certain area away from the position of the image is needed to be searched in the data set, and the image data in the whole data set are not needed to be searched, so that the calculated amount of the image index is reduced, and the accuracy of the image index is improved.
Optionally, in another embodiment of the present application, an implementation of the encoding unit 602 includes:
the first acquisition subunit is used for acquiring the range information of the map where the target image is located and the range information of the grid; wherein the map of the target image is divided into a plurality of grids.
The processing subunit is used for processing the position information of the target image, the range information of the map where the target image is positioned and the range information of the grid according to the principle that the coordinate codes of the images are the same and obtained by calculation, so as to obtain the coordinate codes of the target image; wherein the coordinate encoding includes an X-axis coordinate encoding and a Y-axis coordinate encoding.
And the first combination unit is used for combining the X-axis coordinate code and the Y-axis coordinate code of the target image to obtain a position code string of the target image.
In this embodiment, the specific execution process of the first acquiring subunit, the processing subunit, and the first combining unit may refer to the content of the method embodiment corresponding to fig. 2, which is not described herein again.
Optionally, in another embodiment of the present application, an implementation of the processing subunit includes:
the calculating subunit is used for taking the value of the quotient of the target sum value and the range information of the grid to obtain the coordinate code of the target image; the target sum value is the sum of the position information of the target image and the range information of the map where the target image is located.
In this embodiment, the specific execution process of the computing subunit may refer to the content corresponding to the embodiment of the method described above, which is not described herein again.
Optionally, in another embodiment of the present application, an implementation manner of the first search unit 603 includes:
the first searching subunit is used for searching each position code string which is within a preset range from the image code string library by utilizing the position code string of the target image; wherein, the image code string library comprises: a position code string corresponding to each image of the visual map; the position code string corresponding to each image is obtained by encoding the position information of each image.
And the second acquisition subunit is used for acquiring the image data of the image of each position code string in the data set.
In this embodiment, the specific execution process of the first search subunit and the second acquisition subunit may refer to the content of the method embodiment corresponding to fig. 3, which is not described herein again.
Optionally, in another embodiment of the present application, an implementation of the first search subunit includes:
the decoding subunit is used for decoding the position code string of the target image to obtain the coordinate code of the grid where the target image is located; the coordinate codes of the grid where the target image is located comprise X-axis coordinate codes and Y-axis coordinate codes.
The second searching subunit is configured to search, based on the X-axis coordinate code of the grid where the target image is located, for an X-axis coordinate code of the grid within a preset range from the grid where the target image is located in the image code string library, and search, based on the Y-axis coordinate code of the grid where the target image is located, for a Y-axis coordinate code of the grid within the preset range from the grid where the target image is located in the image code string library.
And the second combination subunit is used for respectively combining the searched X-axis coordinate codes of each grid and the searched Y-axis coordinate codes of each grid to obtain a position code string of each grid within a preset range of the grid where the target image is located.
In this embodiment, the specific execution process of the decoding subunit, the second searching subunit, and the second combining subunit may refer to the content of the method embodiment corresponding to fig. 5, which is not described herein again.
Another embodiment of the present application further provides an electronic device, as shown in fig. 7, specifically including:
one or more processors 701.
A storage 702, on which one or more programs are stored.
The one or more programs, when executed by the one or more processors 701, cause the one or more processors 701 to implement the methods of any of the embodiments described above.
Another embodiment of the present application also provides a computer storage medium having a computer program stored thereon, wherein the computer program, when executed by a processor, implements a method according to any of the above embodiments.
In this specification, each embodiment is described in a progressive manner, and identical and similar parts of each embodiment are all referred to each other, and each embodiment mainly describes differences from other embodiments. In particular, for a system or system embodiment, since it is substantially similar to a method embodiment, the description is relatively simple, with reference to the description of the method embodiment being made in part. The systems and system embodiments described above are merely illustrative, wherein the elements illustrated as separate elements may or may not be physically separate, and the elements shown as elements may or may not be physical elements, may be located in one place, or may be distributed over a plurality of network elements. Some or all of the modules may be selected according to actual needs to achieve the purpose of the solution of this embodiment. Those of ordinary skill in the art will understand and implement the present invention without undue burden.
Those of skill would further appreciate that the various illustrative elements and algorithm steps described in connection with the embodiments disclosed herein may be implemented as electronic hardware, computer software, or combinations of both, and that the various illustrative elements and steps are described above generally in terms of functionality in order to clearly illustrate the interchangeability of hardware and software. Whether such functionality is implemented as hardware or software depends upon the particular application and design constraints imposed on the solution. Skilled artisans may implement the described functionality in varying ways for each particular application, but such implementation decisions should not be interpreted as causing a departure from the scope of the present invention.
The previous description of the disclosed embodiments is provided to enable any person skilled in the art to make or use the present invention. Various modifications to these embodiments will be readily apparent to those skilled in the art, and the generic principles defined herein may be applied to other embodiments without departing from the spirit or scope of the application. Thus, the present application is not intended to be limited to the embodiments shown herein but is to be accorded the widest scope consistent with the principles and novel features disclosed herein.

Claims (10)

1. A method of indexing an image, comprising:
acquiring position information of a target image;
encoding the position information of the target image to obtain a position code string of the target image; the position code string of the target image is used for representing the grid where the target image is located;
searching image data of an image with a position distance from the target image within a preset range in a data set by using the position code string of the target image;
finding out K images with highest similarity with the target image from the image data; wherein K is a preset positive integer.
2. The method of claim 1, wherein encoding the position information of the target image to obtain the position code string of the target image comprises:
acquiring range information of a map where the target image is located and range information of grids; wherein the map of the target image is divided into a plurality of grids;
according to the principle that the coordinate codes of the images obtained by calculation are the same in the same grid, the position information of the target image, the range information of the map where the target image is located and the range information of the grid are processed to obtain the coordinate codes of the target image; wherein the coordinate encoding includes an X-axis coordinate encoding and a Y-axis coordinate encoding;
and combining the X-axis coordinate code and the Y-axis coordinate code of the target image to obtain a position code string of the target image.
3. The method according to claim 2, wherein the calculating the coordinate code of the image according to the same principle of the image in the same grid, and processing the position information of the target image, the range information of the map in which the target image is located, and the range information of the grid, to obtain the coordinate code of the target image, includes:
taking the value of the quotient of the target sum value and the range information of the grid to obtain the coordinate code of the target image; the target sum value is the sum of the position information of the target image and the range information of the map where the target image is located.
4. The method according to claim 1, wherein the searching the image data of the image having the position within the predetermined range from the target image in the data set using the position code string of the target image comprises:
searching each position code string which is within a preset range from an image code string library by utilizing the position code string of the target image; wherein, the image code string library comprises: a position code string corresponding to each image of the visual map; the position code strings corresponding to the images are obtained by encoding the position information of the images;
and acquiring image data of the image to which each position code string belongs in the data set.
5. The method of claim 4, wherein using the position code strings of the target image to find each position code string from the image code string library that is within a predetermined range from the target image comprises:
decoding the position code string of the target image to obtain a coordinate code of a grid where the target image is located; the coordinate codes of the grid where the target image is located comprise X-axis coordinate codes and Y-axis coordinate codes;
searching an X-axis coordinate code of a grid which is within a preset range from the grid which is located in the target image in the image code string library according to the X-axis coordinate code of the grid which is located in the target image, and searching a Y-axis coordinate code of the grid which is within the preset range from the grid which is located in the target image in the image code string library according to the Y-axis coordinate code of the grid which is located in the target image;
and respectively combining the searched X-axis coordinate codes of each grid and the searched Y-axis coordinate codes of each grid to obtain a position code string of each grid within a preset range from the grid where the target image is located.
6. An image indexing apparatus, comprising:
an acquisition unit configured to acquire positional information of a target image;
the encoding unit is used for encoding the position information of the target image to obtain a position code string of the target image; the position code string of the target image is used for representing the grid where the target image is located;
the first searching unit is used for searching image data of an image, the position of which is within a preset range from the target image, in the data set by utilizing the position code string of the target image;
the second searching unit is used for searching K images with highest similarity with the target image from the image data; wherein K is a preset positive integer.
7. The apparatus of claim 6, wherein the encoding unit comprises:
the first acquisition subunit is used for acquiring the range information of the map where the target image is located and the range information of the grid; wherein the map of the target image is divided into a plurality of grids;
the processing subunit is used for processing the position information of the target image, the range information of the map where the target image is positioned and the range information of the grid according to the principle that the coordinate codes of the images are the same, which is obtained by calculation, so as to obtain the coordinate codes of the target image; wherein the coordinate encoding includes an X-axis coordinate encoding and a Y-axis coordinate encoding;
and the first combination unit is used for combining the X-axis coordinate code and the Y-axis coordinate code of the target image to obtain a position code string of the target image.
8. The apparatus of claim 6, wherein the first lookup unit comprises:
the first searching subunit is used for searching each position code string which is within a preset range from the image code string library by utilizing the position code string of the target image; wherein, the image code string library comprises: a position code string corresponding to each image of the visual map; the position code strings corresponding to the images are obtained by encoding the position information of the images;
and the second acquisition subunit is used for acquiring the image data of the image of each position code string in the data set.
9. An electronic device, comprising:
one or more processors;
a storage device having one or more programs stored thereon;
the one or more programs, when executed by the one or more processors, cause the one or more processors to implement the method of any of claims 1-5.
10. A computer readable medium, characterized in that a computer program is stored thereon, wherein the computer program, when executed by a processor, implements the method according to any of claims 1 to 5.
CN202110484474.8A 2021-04-30 2021-04-30 Image indexing method and device, electronic equipment and storage medium thereof Active CN112948620B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202110484474.8A CN112948620B (en) 2021-04-30 2021-04-30 Image indexing method and device, electronic equipment and storage medium thereof

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202110484474.8A CN112948620B (en) 2021-04-30 2021-04-30 Image indexing method and device, electronic equipment and storage medium thereof

Publications (2)

Publication Number Publication Date
CN112948620A CN112948620A (en) 2021-06-11
CN112948620B true CN112948620B (en) 2024-03-08

Family

ID=76233667

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202110484474.8A Active CN112948620B (en) 2021-04-30 2021-04-30 Image indexing method and device, electronic equipment and storage medium thereof

Country Status (1)

Country Link
CN (1) CN112948620B (en)

Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN102368237A (en) * 2010-10-18 2012-03-07 中国科学技术大学 Image retrieval method, device and system
CN103455588A (en) * 2013-08-30 2013-12-18 小米科技有限责任公司 Image indexing method and device
CN108388656A (en) * 2018-03-06 2018-08-10 南京邮电大学 A kind of image searching method based on label correlation
CN109408652A (en) * 2018-09-30 2019-03-01 北京搜狗科技发展有限公司 A kind of image searching method, device and equipment
CN110502599A (en) * 2019-08-23 2019-11-26 腾讯科技(深圳)有限公司 Querying method, device and the computer readable storage medium of map datum

Family Cites Families (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP2004240750A (en) * 2003-02-06 2004-08-26 Canon Inc Picture retrieval device

Patent Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN102368237A (en) * 2010-10-18 2012-03-07 中国科学技术大学 Image retrieval method, device and system
CN103455588A (en) * 2013-08-30 2013-12-18 小米科技有限责任公司 Image indexing method and device
CN108388656A (en) * 2018-03-06 2018-08-10 南京邮电大学 A kind of image searching method based on label correlation
CN109408652A (en) * 2018-09-30 2019-03-01 北京搜狗科技发展有限公司 A kind of image searching method, device and equipment
CN110502599A (en) * 2019-08-23 2019-11-26 腾讯科技(深圳)有限公司 Querying method, device and the computer readable storage medium of map datum

Non-Patent Citations (1)

* Cited by examiner, † Cited by third party
Title
分形技术图像比对搜索模型;楼伟进等;计算机辅助设计与图形学学报;第15卷(第10期);第1242-1246页 *

Also Published As

Publication number Publication date
CN112948620A (en) 2021-06-11

Similar Documents

Publication Publication Date Title
US9710488B2 (en) Location estimation using image analysis
US7634465B2 (en) Indexing and caching strategy for local queries
US20090083275A1 (en) Method, Apparatus and Computer Program Product for Performing a Visual Search Using Grid-Based Feature Organization
CN107766433B (en) Range query method and device based on Geo-BTree
CN108549690B (en) Spatial keyword query method and system based on spatial distance constraint
CN112418129B (en) Point cloud data processing method and device, electronic equipment and storage medium
WO2021072874A1 (en) Dual array-based location query method and apparatus, computer device, and storage medium
CN107463585B (en) Fingerprint data storage processing method and device
CN110502599A (en) Querying method, device and the computer readable storage medium of map datum
CN107092623B (en) Interest point query method and device
CN109800360B (en) Cell query method, cell query device, electronic equipment and storage medium
CN105447190A (en) Image retrieval method, device and server based on convolutional neural network
CN113688193B (en) Track data storage and indexing method and device, electronic equipment and readable medium
CN112100308B (en) Similarity query method for Beidou space-time trajectory
CN111641924A (en) Position data generation method and device and electronic equipment
CN113806601B (en) Peripheral interest point retrieval method and storage medium
CN114814802A (en) Positioning method and device
CN112948620B (en) Image indexing method and device, electronic equipment and storage medium thereof
CN113191323A (en) Semantic element processing method and device, electronic equipment and storage medium
CN110413716B (en) Data storage and data query method and device and electronic equipment
CN111353007B (en) Geographic element pickup method, coding method and device based on vector slicing and electronic equipment
CN113473153B (en) Point cloud attribute prediction method, encoding method, decoding method and equipment thereof
CN112836077B (en) Specific person retrieval method, system, device and storage medium
CN112614162A (en) Indoor vision rapid matching positioning method and system based on space optimization strategy
CN112100180B (en) Method and device for determining position range, storage medium and electronic equipment

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination
GR01 Patent grant
GR01 Patent grant