CN110874416B - Image characteristic value storage method and device and electronic equipment - Google Patents

Image characteristic value storage method and device and electronic equipment Download PDF

Info

Publication number
CN110874416B
CN110874416B CN201811028338.2A CN201811028338A CN110874416B CN 110874416 B CN110874416 B CN 110874416B CN 201811028338 A CN201811028338 A CN 201811028338A CN 110874416 B CN110874416 B CN 110874416B
Authority
CN
China
Prior art keywords
image characteristic
characteristic value
image
bit container
length
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
CN201811028338.2A
Other languages
Chinese (zh)
Other versions
CN110874416A (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.)
Shenzhen Intellifusion Technologies Co Ltd
Original Assignee
Shenzhen Intellifusion Technologies 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 Shenzhen Intellifusion Technologies Co Ltd filed Critical Shenzhen Intellifusion Technologies Co Ltd
Priority to CN201811028338.2A priority Critical patent/CN110874416B/en
Publication of CN110874416A publication Critical patent/CN110874416A/en
Application granted granted Critical
Publication of CN110874416B publication Critical patent/CN110874416B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Landscapes

  • Information Retrieval, Db Structures And Fs Structures Therefor (AREA)

Abstract

The embodiment of the invention provides an image characteristic value storage method, an image characteristic value storage device and electronic equipment, wherein the method comprises the following steps: adding the image characteristic value into a bit container, and recording the length and the identification of the image characteristic value added into the bit container; if the image characteristic values stored in the bit container reach a preset writing condition, judging whether the lengths of the image characteristic values stored in the bit container are the same or not; if the lengths of the image characteristic values stored in the bit container are different, confirming the initial address of each image characteristic value, writing each image characteristic value into a storage device according to the initial address of each image characteristic value, and recording the length, the identification and the initial address of each image characteristic value, wherein the initial address is a logical address in the storage device. The embodiment of the invention can improve the compatibility of the image characteristic value storage, thereby improving the image searching performance.

Description

Image characteristic value storage method and device and electronic equipment
Technical Field
The present invention relates to the field of image processing technologies, and in particular, to an image feature value storage method and apparatus, and an electronic device.
Background
Image searching is a very widely applied technology, and before image searching, an image repository is often required to be established, and image feature values of a large number of images are stored in the image repository. Currently, when storing image feature values, only the storage of image feature values with the same length is often supported, that is, the lengths of all stored image feature values must be the same. In practical applications, however, the image search algorithm is often updated in version to improve the image search performance. However, the lengths of the image feature values used by the different algorithm versions may not be consistent, for example: the image feature values used by the old version of the algorithm may be 100 bits in length, while the image feature values used by the new version of the algorithm may be 300 bits in length. It can be seen that, in the current image search technology, only image feature values with the same length can be stored, which results in poor compatibility and thus poor image search performance.
Disclosure of Invention
The embodiment of the invention provides an image characteristic value storage method and device and electronic equipment, which can improve the compatibility of image characteristic value storage and further improve the image searching performance.
In a first aspect, an embodiment of the present invention provides an image feature value storage method, including:
adding the image characteristic value into a bit container, and recording the length and the identification of the image characteristic value added into the bit container;
if the image characteristic values stored in the bit container reach a preset writing condition, judging whether the lengths of the image characteristic values stored in the bit container are the same or not;
if the lengths of the image characteristic values stored in the bit container are different, confirming the initial address of each image characteristic value, writing each image characteristic value into a storage device according to the initial address of each image characteristic value, and recording the length, the identification and the initial address of each image characteristic value, wherein the initial address is a logical address in the storage device.
Optionally, the method further includes:
if the lengths of the image characteristic values stored in the bit container are the same, writing each image characteristic value into the storage device, and recording a target length and an identifier of each image characteristic value, wherein the target length is the common length of all the image characteristic values stored in the bit container.
Optionally, the storage device is further written with a storage flag, where the storage flag is used to indicate whether the lengths of the stored image feature values are the same; the method further comprises the following steps:
if the image characteristic value in the storage device needs to be read, judging whether the image characteristic value needing to be read is written in the same length mode or not when the image characteristic value needing to be read is written in according to the storage mark;
if the image characteristic value needing to be read currently is judged to be written in the same length mode when being written in, reading the image characteristic value according to the identifier of the image characteristic value and the target length;
and if the image characteristic value needing to be read currently is judged not to be written in the same length mode when being written in, reading the image characteristic value according to the length, the identification and the initial address of the image characteristic value.
Optionally, if the lengths of the image feature values stored in the bit container are different, determining a start address of each image feature value, writing each image feature value into the storage device according to the start address of each image feature value, and recording the length, the identifier, and the start address of each image feature value, including:
if the lengths of the image characteristic values stored in the bit container are different, judging whether the values of each image characteristic value stored in the bit container at a specific position are the same or not;
if the value of each image characteristic value stored in the bit container at a specific position is the same, compressing the image characteristic value stored in the bit container at the specific position, and confirming the initial address of each compressed image characteristic value, wherein the initial address is a logical address in the storage device;
and writing each compressed image characteristic value into the storage device according to the start address of each compressed image characteristic value, and recording the length and the identification of each image characteristic value and the start address of each compressed image characteristic value.
In a second aspect, an embodiment of the present invention provides an image feature value storage apparatus, including:
the adding module is used for adding the image characteristic value into a bit container and recording the length and the identification of the image characteristic value added into the bit container;
the first judging module is used for judging whether the lengths of the image characteristic values stored in the bit container are the same or not if the image characteristic values stored in the bit container reach a preset writing condition;
the first writing module is used for confirming the initial address of each image characteristic value, writing each image characteristic value into the storage device according to the initial address of each image characteristic value, and recording the length, the identification and the initial address of each image characteristic value, wherein the initial address is a logic address in the storage device.
In a third aspect, an embodiment of the present invention provides an electronic device, including: the image feature value storage method comprises a memory, a processor and a computer program stored on the memory and capable of running on the processor, wherein the processor executes the computer program to realize the steps of the image feature value storage method provided by the embodiment of the invention.
In a fourth aspect, an embodiment of the present invention provides a computer-readable storage medium, where a computer program is stored, and when the computer program is executed by a processor, the computer program implements the steps in the image feature value storage method provided by the embodiment of the present invention.
In the embodiment of the invention, the image characteristic value is added into a bit container, and the length and the identification of the image characteristic value added into the bit container are recorded; if the image characteristic values stored in the bit container reach a preset writing condition, judging whether the lengths of the image characteristic values stored in the bit container are the same or not; if the lengths of the image characteristic values stored in the bit container are different, confirming the initial address of each image characteristic value, writing each image characteristic value into a storage device according to the initial address of each image characteristic value, and recording the length, the identification and the initial address of each image characteristic value, wherein the initial address is a logical address in the storage device. Therefore, the storage of the image characteristic values with different lengths can be realized, so that the storage compatibility of the image characteristic values can be improved, and the image searching performance is further improved.
Drawings
In order to more clearly illustrate the embodiments of the present invention or the technical solutions in the prior art, the drawings used in the description of the embodiments or the prior art will be briefly described below, it is obvious that the drawings in the following description are only some embodiments of the present invention, and for those skilled in the art, other drawings can be obtained according to the drawings without creative efforts.
Fig. 1 is a schematic flowchart of an image feature value storage method according to an embodiment of the present invention;
FIG. 2 is a flow chart illustrating another image feature value storage method according to an embodiment of the present invention;
FIG. 3 is a schematic structural diagram of an image feature value storage apparatus according to an embodiment of the present invention;
FIG. 4 is a schematic structural diagram of another image feature value storage device according to an embodiment of the present invention;
FIG. 5 is a schematic structural diagram of another image feature value storage device according to an embodiment of the present invention;
FIG. 6 is a schematic structural diagram of another image feature value storage device according to an embodiment of the present invention;
FIG. 7 is a schematic structural diagram of another image feature value storage device according to an embodiment of the present invention;
fig. 8 is a schematic structural diagram of an electronic device according to an embodiment of the present invention.
Detailed Description
The technical solutions in the embodiments of the present invention will be clearly and completely described below with reference to the drawings in the embodiments of the present invention, and it is obvious that the described embodiments are only a part of the embodiments of the present invention, and not all of the embodiments. All other embodiments, which can be derived by a person skilled in the art from the embodiments given herein without making any creative effort, shall fall within the protection scope of the present invention.
Referring to fig. 1, fig. 1 is a schematic flow chart of an image feature value storage method according to an embodiment of the present invention, as shown in fig. 1, including the following steps:
101. adding the image feature value to a bit container and recording the length and identification of the image feature value added to the bit container.
The image feature value may be an image feature value recognized by an image recognition engine, and is used to represent features of an image, such as shape, color, and a positional relationship between features. In addition, in the embodiment of the present invention, the image feature value may be a set of binary numbers, but may also be other types of image feature values in some embodiments, and when the image feature value is added to the bit container, the image feature value is converted into a binary number to be added.
In addition, the step may be adding the image feature value to the bit container and recording the length and the identifier of the image feature value when the image feature value is swiped. The bit container may be a reserved storage space in the memory, and the size of the bit container may be preset according to actual needs. In the embodiment of the present invention, an identifier may be defined for each image feature value, for example: docid, to record the identity of the image feature value as it is swiped through. And the length may be a length of each image feature value, and in some cases, the lengths of the image feature values stored in the bit container may be the same, and in other cases, the lengths of the image feature values stored in the bit container may be different.
102. And if the image characteristic values stored in the bit container reach the preset writing condition, judging whether the lengths of the image characteristic values stored in the bit container are the same or not.
The preset writing condition may be that the number of image feature values stored in the bit container reaches a preset number threshold, for example: 100. 200, etc. Or the preset writing condition may be that the amount of data stored in the bit container reaches a preset size threshold, or the preset writing condition may be that the remaining space in the bit container is smaller than a preset space threshold, and the like. When the image feature value stored in the bit container reaches the preset writing condition, it indicates that the image feature value stored in the bit container needs to be written into the storage device, for example: a magnetic disk.
The above-mentioned determination of whether the lengths of the image feature values stored in the bit container are the same may be a determination of whether the lengths of all the image feature values stored in the bit container are the same. For example: if 100 sets of image feature values are stored in the bit container, it is determined whether the lengths of the 100 sets of image feature values are all the same.
103. If the lengths of the image characteristic values stored in the bit container are different, confirming the initial address of each image characteristic value, writing each image characteristic value into a storage device according to the initial address of each image characteristic value, and recording the length, the identification and the initial address of each image characteristic value, wherein the initial address is a logical address in the storage device.
The length of the image feature values stored in the bit container is different, and it is indicated that image feature values with different lengths are stored in the bit container.
The determining of the start address of each image feature value may be assigning a start address to each image feature value, or may be determining a start address of each image feature value under an image feature value writing rule according to the writing rule, and of course, may also be referred to as recording a corresponding start logical address of each image feature value in the storage device. The writing of each image feature value into the storage device according to the start address of each image feature value may be writing each image feature value into a respective start address. In addition, in the embodiment of the present invention, the start address may also be referred to as a start subscript, for example: each image feature value is identified at a corresponding starting logical index of the storage device. The length, the mark and the start address of each image feature value may be recorded by writing the length, the mark and the start address of each image feature value into the storage device, wherein the writing positions of the length, the mark and the start address are not limited.
In addition, in the embodiment of the present invention, when it is determined that the lengths of the image feature values stored in the bit container are the same, the process may be ended, or the image feature values may be directly written in the storage device.
In the method, under the condition that the lengths of the image characteristic values stored in the bit container are different, the length, the mark and the initial address of each image characteristic value are recorded, so that when the image characteristic values are read, the corresponding image characteristic values can be read through the mark, the length and the initial address. Therefore, the image characteristic values with different lengths can be stored, and when the image characteristic values are read, the image characteristic values can be read through the identification, the length and the initial address, so that the storage compatibility of the image characteristic values can be improved, and the image searching performance is further improved. In addition, the image characteristic values with different lengths can be stored, so that the reusability of project history data can be improved, and the steps that the characteristic values need to be regenerated for images with different algorithm versions brought by project upgrading are reduced. And the maintainability and the expansibility of the project can be improved, the compatibility of the project with the image characteristic value of the historical short characteristic value length is ensured, and the maintenance cost of the project maintenance long and short characteristic value data can be reduced.
It should be noted that the image feature value storage method provided in the embodiment of the present invention may be applied to an image search service, for example: face search, etc. Specifically, the method can be applied to an image search server, a computer, a mobile terminal, or other devices capable of storing images.
In the embodiment of the invention, the image characteristic value is added into a bit container, and the length and the identification of the image characteristic value added into the bit container are recorded; if the image characteristic values stored in the bit container reach a preset writing condition, judging whether the lengths of the image characteristic values stored in the bit container are the same or not; if the lengths of the image characteristic values stored in the bit container are different, confirming the initial address of each image characteristic value, writing each image characteristic value into a storage device according to the initial address of each image characteristic value, and recording the length, the identification and the initial address of each image characteristic value, wherein the initial address is a logical address in the storage device. Therefore, the storage of the image characteristic values with different lengths can be realized, so that the storage compatibility of the image characteristic values can be improved, and the image searching performance is further improved.
Referring to fig. 2, fig. 2 is a schematic flow chart of another image feature value storage method according to an embodiment of the present invention, as shown in fig. 2, including the following steps:
201. adding the image feature value to a bit container and recording the length and identification of the image feature value added to the bit container.
This step may be, as the image feature values are flushed into memory, sequential or cyclic processing, and recording the length and identification of each image feature value added to the bit container.
In an optional embodiment, the method further comprises:
setting the bit container for storing the image characteristic value, a first array for recording the identifier of the image characteristic value and a second array for recording the length of the image characteristic value in a memory;
the adding the image characteristic value into a bit container and recording the length and the identification of the image characteristic value added into the bit container comprises the following steps:
-accumulating image feature values to the bit container, and-recording the identity of image feature values accumulated into the bit container by means of the first array, and-recording the length of image feature values accumulated into the bit container by means of the second array.
The length of the bit container may be predetermined, and the first array may be an object array. The accumulation of the image feature values into the bit container may be a continuous or discrete brushing of image feature values into the bit container. Due to the accumulation mode, the waste of the space of the bit container can be reduced or eliminated, and the storage of the maximum capacity of the bit container is realized.
In addition, because the identification and the length are respectively recorded by the first array and the second array, each image characteristic value can be accurately intercepted from the bit container subsequently.
It should be noted that, in this embodiment, the storage of the image feature value and the recording of the identifier and the length by the above method are not limited, for example: the identity and length of the image feature values may also be recorded directly.
202. And if the image characteristic value stored in the bit container reaches a preset writing condition, judging whether the lengths of the image characteristic values stored in the bit container are the same or not.
As an optional implementation manner, the determining whether the lengths of the image feature values stored in the bit container are the same if the image feature values stored in the bit container reach a preset writing condition includes:
if the image characteristic values stored in the bit container reach the preset writing condition, intercepting the image characteristic values stored in the bit container according to the length of each image characteristic value, and recording the maximum length value and the minimum length value of the image characteristic values stored in the bit container;
judging whether the maximum length value is consistent with the minimum length value or not, if so, determining that the lengths of the image characteristic values stored in the bit container are the same, and if not, determining that the lengths of the image characteristic values stored in the bit container are different.
In this embodiment, when the image feature value stored in the bit container reaches the preset writing condition, that is, when the image feature value needs to be written into the storage device, the image feature value in the bit container may be processed in a loop, for example: and intercepting the image characteristic values according to the length of each image characteristic value recorded previously, and recording the maximum length value and the minimum length value of the image characteristic values stored in the bit container. And after the loop interception is finished, judging whether the recorded maximum length value is consistent with the recorded minimum length value, if so, indicating that the lengths of the image characteristic values stored in the bit container are the same, otherwise, indicating that the lengths of the image characteristic values stored in the bit container are different. If not, the image feature values in the bit container can be reprocessed, that is, the image feature values in the bit container can be intercepted again, and the length and the starting address of each image feature value are recorded.
In this embodiment, only the maximum length value and the minimum length value are compared, so that the amount of calculation can be saved. Of course, in this embodiment, it is not limited whether the lengths of the image feature values stored in the bit container are the same through the maximum length value and the minimum length value, for example: the determination can be made directly from the length recorded in step 201.
203. If the lengths of the image characteristic values stored in the bit container are different, confirming the initial address of each image characteristic value, writing each image characteristic value into a storage device according to the initial address of each image characteristic value, and recording the length, the identification and the initial address of each image characteristic value, wherein the initial address is a logical address in the storage device.
As an optional implementation manner, if the lengths of the image feature values stored in the bit container are different, the determining a start address of each image feature value, writing each image feature value into the storage device according to the start address of each image feature value, and recording the length, the identifier, and the start address of each image feature value includes:
if the lengths of the image characteristic values stored in the bit container are different, judging whether the values of each image characteristic value stored in the bit container at a specific position are the same or not;
if the value of each image characteristic value stored in the bit container on a specific position is the same, compressing the image characteristic value stored in the bit container on the specific position, and confirming the initial address of each compressed image characteristic value, wherein the initial address is a logic address in the storage device;
and writing each compressed image characteristic value into the storage device according to the start address of each compressed image characteristic value, and recording the length and the identification of each image characteristic value and the start address of each compressed image characteristic value.
The specific position may be preset, for example: the last 100, 50 bits of each image feature value. Of course, the specific position may also be confirmed in the process of determining whether the value of each image feature value stored in the bit container at the specific position is the same, for example: and analyzing each image characteristic value to determine that the last 100 and 50 bits of each image characteristic value are the same, and then the last 100 and 50 bits are the specific positions.
The fact that the value of each image feature value stored in the bit container is the same at a specific position may mean that the bits of each image stored in the bit container at the specific position are the same, for example: the last 50 bits of each image feature value are 010101010101 … 10(50 bits).
The compressing the image feature value stored in the bit container at the specific position may be to compress the bit at the specific position in the image feature value, for example: and compressing the last 50 bits into one or more bits, thereby achieving the effect of saving the storage space.
In the embodiment, the image characteristic values stored in the bit container are compressed before being written into the storage device, so that the storage space can be saved, and the efficiency of writing into the storage device can be improved.
In addition, in this embodiment, since the length and the identifier of each image feature value and the start address of each compressed image feature value are recorded, when the image feature values are read, the compressed image feature values can be read by the length, the identifier and the start address, and then each image feature value is obtained by the decompression operation. In this embodiment, the length may be a length of each image feature value without being compressed, and the length of the compressed image feature value may be obtained by the length, because the position and the number of bits of compression are determined. Of course, in some cases, in this embodiment, the length may be a length of the image feature value after compression, and may specifically be derived from a length before decompression, so that when subsequent reading is performed through the length, the position, and the start position are directly used to read the corresponding image feature value.
204. If the lengths of the image characteristic values stored in the bit container are the same, writing each image characteristic value into the storage device, and recording a target length and an identifier of each image characteristic value, wherein the target length is the common length of all the image characteristic values stored in the bit container.
The image feature values stored in the bit container have the same length, which means that the image feature values having the same length are stored in the bit container, that is, the lengths of the image feature values are the same.
In step 204, since the identifier and the target length of each image feature value are recorded, in the subsequent reading, the reading may be directly performed according to the identifier and the target length, for example: and reading the image characteristic value in the storage device according to docid multiplied by length. This saves storage space because the start address of each image feature value does not need to be stored.
As an optional implementation manner, the storage device further writes a storage flag, where the storage flag is used to indicate whether the lengths of the stored image feature values are the same; the method further comprises the following steps:
if the image characteristic value in the storage device needs to be read, judging whether the image characteristic value needing to be read is written in the same length mode or not when the image characteristic value needing to be read is written in according to the storage mark;
if the image characteristic value needing to be read currently is judged to be written in the same length mode when being written in, reading the image characteristic value according to the identifier of the image characteristic value and the target length;
and if the image characteristic value needing to be read currently is judged not to be written in the same length mode when being written in, reading the image characteristic value according to the length, the identification and the initial address of the image characteristic value.
The storage flag may indicate whether the lengths of the stored image feature values are the same, and the storage flag may indicate whether the lengths of the image feature values stored in step 203 or step 203 are the same. That is, the storage flag may correspond to a group of image feature values, and the image feature value in each group of image feature values corresponds to the image feature value stored in the bit container, that is, the image feature value written once (the image feature value stored in the bit container is written in the storage device) may correspond to one storage flag.
It should be noted that, the above-mentioned determining, according to the storage flag, whether the image feature value that needs to be currently read is written in the same way as the length when writing is performed may be understood as determining whether the image feature value that needs to be currently read is written in the same way as the length when writing is performed, or may be understood as determining whether the length of the image feature value that needs to be currently read is the same as the length of the image feature value that is written in the same way at the same time.
When the image characteristic value is read, whether the currently read image characteristic value is written in a same length mode is judged through the storage mark, if the currently read image characteristic value is not written in the same length mode (for example, step 203), the image characteristic value is read according to the length, the identifier and the start address of the image characteristic value, otherwise (for example, step 204), the image characteristic value is read according to the identifier of the image characteristic value and the target length.
In the embodiment, different reading modes can be adopted according to different conditions, so that the efficiency of reading the image characteristic values with different lengths can be improved, and the correct reading of the image characteristic values with different lengths can be ensured.
In this embodiment, a plurality of optional implementation modes are added on the basis of the embodiment shown in fig. 1, and the effects of saving storage space, improving storage efficiency and the like can be achieved.
Referring to fig. 3, fig. 3 is a schematic structural diagram of an image feature value storage apparatus according to an embodiment of the present invention, as shown in fig. 3, including:
an adding module 301, configured to add an image feature value to a bit container, and record a length and an identifier of the image feature value added to the bit container;
a first determining module 302, configured to determine whether lengths of image feature values stored in the bit container are the same if the image feature values stored in the bit container reach a preset writing condition;
a first writing module 303, configured to, if lengths of image feature values stored in the bit container are different, determine a start address of each image feature value, write each image feature value into a storage device according to the start address of each image feature value, and record the length, the identifier, and the start address of each image feature value, where the start address is a logical address in the storage device.
Optionally, as shown in fig. 4, the apparatus further includes:
a second writing module 304, configured to write each image feature value into the storage device if the lengths of the image feature values stored in the bit container are the same, and record a target length and an identifier of each image feature value, where the target length is a common length of all the image feature values stored in the bit container.
Optionally, the storage device is further written with a storage flag, where the storage flag is used to indicate whether the lengths of the stored image feature values are the same; as shown in fig. 5, the apparatus further includes:
a second determining module 305, configured to determine, according to the storage flag, whether the image feature values that need to be read currently are written in a manner of the same length when the image feature values in the storage device need to be read;
a first reading module 306, configured to, if it is determined that the image feature values that need to be read currently are written in a manner of the same length when writing, read the image feature values according to the identifier of the image feature values and the target length;
and a second reading module 307, configured to read the image feature value according to the length, the identifier, and the start address of the image feature value if it is determined that the image feature value that needs to be read currently is not written in the same length manner during writing.
Optionally, as shown in fig. 6, the first writing module 303 includes:
a determining unit 3031, configured to determine whether values of each image feature value stored in the bit container at a specific position are the same if lengths of the image feature values stored in the bit container are different;
a recording module 3032, configured to compress the image feature value stored in the bit container at a specific position if the value of each image feature value stored in the bit container at the specific position is the same, and determine a start address of each compressed image feature value, where the start address is a logical address in the storage device;
a writing unit 3033, configured to write each compressed image feature value into the storage device according to the start address of each compressed image feature value, and record the length and identifier of each image feature value and the start address of each compressed image feature value.
Optionally, as shown in fig. 7, the apparatus further includes:
a setting module 308, configured to set the bit container for storing the image feature value, a first array for recording an identifier of the image feature value, and a second array for recording a length of the image feature value in a memory;
the adding module 301 is configured to accumulate the image feature values into the bit container, and record the identification of the image feature values accumulated into the bit container through the first array, and record the length of the image feature values accumulated into the bit container through the second array.
The image feature value storage device provided by the embodiment of the present invention can implement each implementation manner in the method embodiments of fig. 1 and fig. 2, and has corresponding beneficial effects, and for avoiding repetition, details are not repeated here.
It should be noted that the image feature value storage device provided in the embodiment of the present invention may be applied to an image search service, for example: face search, etc. Specifically, the apparatus can be applied to a device capable of storing images, such as an image search server, a computer, or a mobile terminal.
Referring to fig. 8, fig. 8 is a schematic structural diagram of an electronic device according to an embodiment of the present invention, as shown in fig. 8, including: a memory, a processor, and a computer program stored on the memory and executable on the processor, wherein:
the processor 801 is used to call the computer program stored in the memory 802, and executes the following steps:
adding the image characteristic value into a bit container, and recording the length and the identification of the image characteristic value added into the bit container;
if the image characteristic values stored in the bit container reach a preset writing condition, judging whether the lengths of the image characteristic values stored in the bit container are the same or not;
if the lengths of the image characteristic values stored in the bit container are different, confirming the initial address of each image characteristic value, writing each image characteristic value into a storage device according to the initial address of each image characteristic value, and recording the length, the identification and the initial address of each image characteristic value, wherein the initial address is a logical address in the storage device.
Optionally, the processor 801 is further configured to:
if the lengths of the image characteristic values stored in the bit container are the same, writing each image characteristic value into the storage device, and recording a target length and an identifier of each image characteristic value, wherein the target length is the common length of all the image characteristic values stored in the bit container.
Optionally, the storage device is further written with a storage flag, where the storage flag is used to indicate whether the lengths of the stored image feature values are the same; the processor 801 is further configured to:
if the image characteristic value in the storage device needs to be read, judging whether the image characteristic value which needs to be read currently is written in a mode of the same length when being written in according to the storage mark;
if the image characteristic value needing to be read currently is judged to be written in the same length mode when being written in, reading the image characteristic value according to the identifier of the image characteristic value and the target length;
and if the image characteristic value needing to be read currently is judged not to be written in the same length mode when being written in, reading the image characteristic value according to the length, the identification and the initial address of the image characteristic value.
Optionally, the processor 801 executes the steps of determining a start address of each image feature value if the lengths of the image feature values stored in the bit container are different, writing each image feature value into the storage device according to the start address of each image feature value, and recording the length, the identifier, and the start address of each image feature value, including:
if the lengths of the image characteristic values stored in the bit container are different, judging whether the values of each image characteristic value stored in the bit container at a specific position are the same or not;
if the value of each image characteristic value stored in the bit container at a specific position is the same, compressing the image characteristic value stored in the bit container at the specific position, and confirming the initial address of each compressed image characteristic value, wherein the initial address is a logical address in the storage device;
and writing each compressed image characteristic value into the storage device according to the start address of each compressed image characteristic value, and recording the length and the identification of each image characteristic value and the start address of each compressed image characteristic value.
Optionally, the processor 801 is further configured to:
setting the bit container for storing the image characteristic value, a first array for recording the identifier of the image characteristic value and a second array for recording the length of the image characteristic value in a memory;
the adding of image feature values into a bit container and recording of the length and identification of image feature values added into the bit container performed by processor 801 includes:
-accumulating image feature values to the bit container, and-recording the identity of image feature values accumulated into the bit container by means of the first array, and-recording the length of image feature values accumulated into the bit container by means of the second array.
The community management device provided in the embodiment of the present invention can implement each implementation manner in the method embodiments of fig. 1 and fig. 2, and has corresponding beneficial effects, and for avoiding repetition, details are not repeated here. The electronic device may be a device capable of storing images, such as an image search server, a computer, or a mobile terminal.
The embodiment of the present invention further provides a computer-readable storage medium, where a computer program is stored on the computer-readable storage medium, and when the computer program is executed by a processor, the computer program implements each process of the embodiment of the image feature value storage method provided in the embodiment of the present invention, and can achieve the same technical effect, and is not described herein again to avoid repetition.
It will be understood by those skilled in the art that all or part of the processes of the methods of the embodiments described above can be implemented by a computer program, which can be stored in a computer-readable storage medium, and when executed, can include the processes of the embodiments of the methods described above. The storage medium may be a magnetic disk, an optical disk, a Read-Only Memory (ROM), a Random Access Memory (RAM), or the like.
The above disclosure is only for the purpose of illustrating the preferred embodiments of the present invention, and it is therefore to be understood that the invention is not limited by the scope of the appended claims.

Claims (10)

1. A method of image feature value storage, comprising:
adding an image characteristic value into a bit container, and recording the length and the identification of the image characteristic value added into the bit container, wherein the bit container is a storage space reserved in a memory;
if the image characteristic values stored in the bit container reach a preset writing condition, judging whether the lengths of the image characteristic values stored in the bit container are the same or not;
if the lengths of the image characteristic values stored in the bit container are different, confirming the initial address of each image characteristic value, writing each image characteristic value into a storage device according to the initial address of each image characteristic value, and recording the length, the identification and the initial address of each image characteristic value, wherein the initial address is a logical address in the storage device.
2. The method of claim 1, wherein the method further comprises:
if the lengths of the image characteristic values stored in the bit container are the same, writing each image characteristic value into the storage device, and recording a target length and an identifier of each image characteristic value, wherein the target length is the common length of all the image characteristic values stored in the bit container.
3. The method of claim 2, wherein the storage device is further written with a storage flag indicating whether the lengths of the stored image feature values are the same; the method further comprises the following steps:
if the image characteristic value in the storage device needs to be read, judging whether the image characteristic value needing to be read is written in the same length mode or not when the image characteristic value needing to be read is written in according to the storage mark;
if the image characteristic value needing to be read currently is judged to be written in the same length mode when being written in, reading the image characteristic value according to the identifier of the image characteristic value and the target length;
and if the image characteristic value needing to be read currently is judged not to be written in the same length mode when being written in, reading the image characteristic value according to the length, the identifier and the initial address of the image characteristic value.
4. The method according to any one of claims 1 to 3, wherein if the lengths of the image feature values stored in the bit container are different, confirming a start address of each image feature value, writing each image feature value into a storage device according to the start address of each image feature value, and recording the length, identification and start address of each image feature value comprises:
if the lengths of the image characteristic values stored in the bit container are different, judging whether the values of each image characteristic value stored in the bit container at a specific position are the same or not;
if the value of each image characteristic value stored in the bit container at a specific position is the same, compressing the image characteristic value stored in the bit container at the specific position, and confirming the initial address of each compressed image characteristic value, wherein the initial address is a logical address in the storage device;
and writing each compressed image characteristic value into the storage device according to the start address of each compressed image characteristic value, and recording the length and the identification of each image characteristic value and the start address of each compressed image characteristic value.
5. The method of any of claims 1 to 3, further comprising:
setting the bit container for storing the image characteristic value, a first array for recording the identifier of the image characteristic value and a second array for recording the length of the image characteristic value in a memory;
the adding the image characteristic value into a bit container and recording the length and the identification of the image characteristic value added into the bit container comprises the following steps:
-accumulating image feature values to the bit container, and-recording the identity of image feature values accumulated into the bit container by means of the first array, and-recording the length of image feature values accumulated into the bit container by means of the second array.
6. An image feature value storage device, comprising:
the adding module is used for adding the image characteristic value into a bit container and recording the length and the identification of the image characteristic value added into the bit container, wherein the bit container is a storage space reserved in the memory;
the first judgment module is used for judging whether the lengths of the image characteristic values stored in the bit container are the same or not if the image characteristic values stored in the bit container reach a preset writing condition;
the first writing module is used for confirming the initial address of each image characteristic value if the lengths of the image characteristic values stored in the bit container are different, writing each image characteristic value into the storage device according to the initial address of each image characteristic value, and recording the length, the identification and the initial address of each image characteristic value, wherein the initial address is a logical address in the storage device.
7. The apparatus of claim 6, wherein the apparatus further comprises:
and a second writing module, configured to write each image feature value into the storage device if the lengths of the image feature values stored in the bit container are the same, and record a target length and an identifier of each image feature value, where the target length is a common length of all image feature values stored in the bit container.
8. The apparatus of claim 6 or 7, wherein the first write module comprises:
a judging unit, configured to judge whether values of the image feature values stored in the bit container at a specific position are the same or not if lengths of the image feature values stored in the bit container are different;
a recording module, configured to compress the image feature value stored in the bit container at a specific position if the value of each image feature value stored in the bit container at the specific position is the same, and determine a start address of each compressed image feature value, where the start address is a logical address in the storage device;
and the writing unit is used for writing each compressed image characteristic value into the storage device according to the start address of each compressed image characteristic value, and recording the length and the identification of each image characteristic value and the start address of each compressed image characteristic value.
9. An electronic device, comprising: a memory, a processor and a computer program stored on the memory and executable on the processor, the processor implementing the steps in the image feature value storage method according to any one of claims 1 to 5 when executing the computer program.
10. A computer-readable storage medium, characterized in that a computer program is stored thereon, which, when being executed by a processor, implements the steps in the image feature value storage method according to any one of claims 1 to 5.
CN201811028338.2A 2018-09-04 2018-09-04 Image characteristic value storage method and device and electronic equipment Active CN110874416B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201811028338.2A CN110874416B (en) 2018-09-04 2018-09-04 Image characteristic value storage method and device and electronic equipment

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201811028338.2A CN110874416B (en) 2018-09-04 2018-09-04 Image characteristic value storage method and device and electronic equipment

Publications (2)

Publication Number Publication Date
CN110874416A CN110874416A (en) 2020-03-10
CN110874416B true CN110874416B (en) 2022-06-24

Family

ID=69716091

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201811028338.2A Active CN110874416B (en) 2018-09-04 2018-09-04 Image characteristic value storage method and device and electronic equipment

Country Status (1)

Country Link
CN (1) CN110874416B (en)

Families Citing this family (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN114245010B (en) * 2021-12-08 2023-07-14 浙江大华技术股份有限公司 Image adjustment method and device, storage medium and electronic device

Citations (9)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP2007047980A (en) * 2005-08-09 2007-02-22 Ricoh Co Ltd Data transfer device, operation display device using the same and image formation apparatus
CN101207705A (en) * 2007-12-06 2008-06-25 四川长虹电器股份有限公司 Graphic file management method
CN101587474A (en) * 2008-05-20 2009-11-25 比亚迪股份有限公司 Method and system for storing picture data
CN102325244A (en) * 2011-08-26 2012-01-18 杭州海康威视数字技术股份有限公司 Method for rapidly positioning videos by time, video storage control device and positioning device
CN102695024A (en) * 2011-03-21 2012-09-26 鸿富锦精密工业(深圳)有限公司 Front-end recording system of network video recorder, and method therefor
CN104657362A (en) * 2013-11-18 2015-05-27 深圳市腾讯计算机系统有限公司 Method and device for storing and querying data
CN105808586A (en) * 2014-12-29 2016-07-27 北京奇虎科技有限公司 Picture data processing method and apparatus
CN106664460A (en) * 2014-06-20 2017-05-10 索尼公司 Information processing apparatus and information processing method
CN108073363A (en) * 2017-12-28 2018-05-25 深圳市得微电子有限责任公司 Date storage method, storage device and computer readable storage medium

Family Cites Families (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP4956517B2 (en) * 2008-10-02 2012-06-20 京セラドキュメントソリュ−ションズ株式会社 Data compression device, image reading device

Patent Citations (9)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP2007047980A (en) * 2005-08-09 2007-02-22 Ricoh Co Ltd Data transfer device, operation display device using the same and image formation apparatus
CN101207705A (en) * 2007-12-06 2008-06-25 四川长虹电器股份有限公司 Graphic file management method
CN101587474A (en) * 2008-05-20 2009-11-25 比亚迪股份有限公司 Method and system for storing picture data
CN102695024A (en) * 2011-03-21 2012-09-26 鸿富锦精密工业(深圳)有限公司 Front-end recording system of network video recorder, and method therefor
CN102325244A (en) * 2011-08-26 2012-01-18 杭州海康威视数字技术股份有限公司 Method for rapidly positioning videos by time, video storage control device and positioning device
CN104657362A (en) * 2013-11-18 2015-05-27 深圳市腾讯计算机系统有限公司 Method and device for storing and querying data
CN106664460A (en) * 2014-06-20 2017-05-10 索尼公司 Information processing apparatus and information processing method
CN105808586A (en) * 2014-12-29 2016-07-27 北京奇虎科技有限公司 Picture data processing method and apparatus
CN108073363A (en) * 2017-12-28 2018-05-25 深圳市得微电子有限责任公司 Date storage method, storage device and computer readable storage medium

Non-Patent Citations (2)

* Cited by examiner, † Cited by third party
Title
Design and implementation of offset system for video image based on FPGA technology;Yongxiang Zhang 等;《Industrial Electronics and Applications》;20121126;第1902-1905页 *
基于目标语义特征的图像检索系统;高永英 等;《电子与信息学报》;20031015;第1341-1348页 *

Also Published As

Publication number Publication date
CN110874416A (en) 2020-03-10

Similar Documents

Publication Publication Date Title
CN109446173B (en) Log data processing method, device, computer equipment and storage medium
CN111124464B (en) Method, system and computer readable storage medium for differential upgrade of embedded system
CN109802684B (en) Method and device for data compression
CN112714359B (en) Video recommendation method and device, computer equipment and storage medium
CN109213448B (en) Method, device, equipment and storage medium for erasing and writing data of smart card
CN105260639A (en) Face recognition system data update method and device
CN112269534A (en) Data reading method, device and equipment and computer readable storage medium
CN110874416B (en) Image characteristic value storage method and device and electronic equipment
CN111125018B (en) File exception tracing method, device, equipment and storage medium
CN111008183B (en) Storage method and system for business wind control log data
CN114860506A (en) Linux file system repairing method, system, device and storage medium
CN116225317A (en) Data read-write method and device for user identification card, user identification card and medium
CN111897828A (en) Data batch processing implementation method, device, equipment and storage medium
CN109901950A (en) A kind of method and device for evading application crash
CN109542523B (en) Remote U disk using method and device
CN111385511B (en) Video data processing method and device and video recording equipment
CN111026896B (en) Feature value storage and processing method, device and storage device
CN116431082B (en) Method, apparatus, computer device and storage medium for data storage
CN116955309A (en) Data migration method and device
CN112306551B (en) Historical configuration information acquisition method, system and device
CN112256634A (en) Low-memory large file analysis method based on http
CN110704256B (en) Storage system testing method, device, equipment and computer readable storage medium
CN116820625A (en) Data circulation method and device based on rule engine
CN115314487A (en) Data storage method applied to reliable transmission and related device
CN108171763B (en) Method and system for accessing decoded coefficient, and method for accessing JPEG decoded coefficient

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