CN114282026A - Image data storage method and device, electronic equipment and storage medium - Google Patents

Image data storage method and device, electronic equipment and storage medium Download PDF

Info

Publication number
CN114282026A
CN114282026A CN202111555142.0A CN202111555142A CN114282026A CN 114282026 A CN114282026 A CN 114282026A CN 202111555142 A CN202111555142 A CN 202111555142A CN 114282026 A CN114282026 A CN 114282026A
Authority
CN
China
Prior art keywords
data
target
bit
image data
value
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.)
Pending
Application number
CN202111555142.0A
Other languages
Chinese (zh)
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 Baidu Netcom Science and Technology Co Ltd
Original Assignee
Beijing Baidu Netcom Science and 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 Baidu Netcom Science and Technology Co Ltd filed Critical Beijing Baidu Netcom Science and Technology Co Ltd
Priority to CN202111555142.0A priority Critical patent/CN114282026A/en
Publication of CN114282026A publication Critical patent/CN114282026A/en
Pending legal-status Critical Current

Links

Images

Abstract

The present disclosure provides a method and an apparatus for storing image data, an electronic device and a storage medium, and relates to the technical field of computer data processing, in particular to the field of computer vision and computer graphic image processing. The specific implementation scheme is as follows: acquiring image data to be stored; determining a target interval according to a preset target storage digit, and determining a designated subinterval in the target interval according to a designated value; converting the image data into target data having a value belonging to the target section; storing data belonging to the specified subinterval in the target data in a first type; the first type is data comprising a first sign bit, an exponent bit and a first mantissa bit, and the total number of the three bits is equal to the target storage bit number. By adopting the scheme, the storage bit number of the image data can be set according to actual requirements, the image data can be flexibly stored, and the image data is not distorted when stored by adopting the scheme.

Description

Image data storage method and device, electronic equipment and storage medium
Technical Field
The present disclosure relates to the field of computer data processing technologies, and in particular, to the field of computer vision and computer graphic image processing, and in particular, to an image storage method and apparatus, an electronic device, and a storage medium.
Background
In recent years, with the development of science and technology, the application of face recognition is very wide, and in the process of face recognition, relevant data of registered face pictures need to be read from a database, face features are obtained from the data, and then the face features are compared with faces in real-time photos. If the related data of the face picture is small, the representative face feature data is small, the features obtained from the representative face feature data are rough, and if the comparison is carried out based on the rough features, an accurate comparison result is difficult to obtain; however, if the related data of the face image is huge, due to the limitation of the machine memory, the related data needs to be read for comparison for many times, which reduces the comparison efficiency, thereby affecting the real-time performance of the dynamic face recognition service.
Disclosure of Invention
The disclosure provides a storage method and device for image data, an electronic device and a storage medium.
According to an aspect of the present disclosure, there is provided a storage method of image data, including:
acquiring image data to be stored;
determining a target interval according to a preset target storage digit, and determining a designated subinterval in the target interval according to a designated value;
converting the image data into target data having a value belonging to the target section;
storing data belonging to the specified subinterval in the target data in a first type; the first type is data comprising a first sign bit, an exponent bit and a first mantissa bit, and the total number of the three bits is equal to the target storage bit number.
According to another aspect of the present disclosure, there is provided a storage apparatus of image data, including:
the data acquisition module is used for acquiring image data to be stored;
the interval determining module is used for determining a target interval according to a preset target storage digit and determining a designated subinterval in the target interval according to a designated value;
the data conversion module is used for converting the image data into target data of which the value belongs to the target interval;
the first storage module is used for storing data which belongs to the appointed subinterval in the target data in a first type, wherein the first type is data comprising a first sign bit, an exponent bit and a first mantissa bit, and the total number of the three bits is equal to the target storage bit number.
According to another aspect of the present disclosure, there is provided an electronic device including:
at least one processor; and
a memory communicatively coupled to the at least one processor; wherein the content of the first and second substances,
the memory stores instructions executable by the at least one processor to enable the at least one processor to perform a method according to any one of the embodiments of the present disclosure.
According to another aspect of the present disclosure, there is provided a non-transitory computer readable storage medium having stored thereon computer instructions for causing a computer to perform a method in any of the embodiments of the present disclosure.
According to another aspect of the present disclosure, there is provided a computer program product comprising computer programs/instructions, characterized in that the computer programs/instructions, when executed by a processor, implement the method in any of the embodiments of the present disclosure.
According to the technology disclosed by the invention, the image data to be stored is firstly acquired, the target interval and the designated subinterval are determined according to the preset target storage digit, then different storage forms are adopted for the data in different intervals, and the image data is ensured not to be distorted to the greatest extent on the premise that the storage digit can be flexibly changed according to actual requirements.
It should be understood that the statements in this section do not necessarily identify key or critical features of the embodiments of the present disclosure, nor do they limit the scope of the present disclosure. Other features of the present disclosure will become apparent from the following description.
Drawings
The drawings are included to provide a better understanding of the present solution and are not to be construed as limiting the present disclosure. Wherein:
fig. 1 is a flowchart illustrating a method of storing image data according to an embodiment of the present disclosure;
FIG. 2 is a schematic diagram of an image data storage format according to an embodiment of the present disclosure;
FIG. 3 is a schematic diagram of image data storage results according to an embodiment of the present disclosure;
FIG. 4 is a flow chart diagram of a method of storing image data according to another embodiment of the present disclosure;
FIG. 5 is a schematic diagram of an image data storage format according to another embodiment of the present disclosure;
FIG. 6 is a schematic diagram of image data storage results according to another embodiment of the present disclosure;
FIG. 7 is a schematic diagram of a storage device for image data according to an embodiment of the present disclosure;
FIG. 8 is a schematic diagram of a storage device for image data according to another embodiment of the present disclosure;
fig. 9 is a block diagram of an electronic device to implement the storage method of image data of the embodiment of the present disclosure.
Detailed Description
Exemplary embodiments of the present disclosure are described below with reference to the accompanying drawings, in which various details of the embodiments of the disclosure are included to assist understanding, and which are to be considered as merely exemplary. Accordingly, those of ordinary skill in the art will recognize that various changes and modifications of the embodiments described herein can be made without departing from the scope and spirit of the present disclosure. Also, descriptions of well-known functions and constructions are omitted in the following description for clarity and conciseness.
The term "and/or" herein is merely an association describing an associated object, meaning that three relationships may exist, e.g., a and/or B, may mean: a exists alone, A and B exist simultaneously, and B exists alone. The term "at least one" herein means any combination of at least two of any one or more of a plurality, for example, including at least one of A, B, C, and may mean including any one or more elements selected from the group consisting of A, B and C. The terms "first" and "second" used herein refer to and distinguish one from another in the similar art, without necessarily implying a sequence or order, or implying only two, such as first and second, to indicate that there are two types/two, first and second, and first and second may also be one or more.
Furthermore, in the following detailed description, numerous specific details are set forth in order to provide a better understanding of the present disclosure. It will be understood by those skilled in the art that the present disclosure may be practiced without some of these specific details. In some instances, methods, means, elements and circuits that are well known to those skilled in the art have not been described in detail so as not to obscure the present disclosure.
In recent years, with the development of science and technology, the application of face recognition is very wide, and in the face recognition technology, a face image needs to extract a floating-point type face feature vector (namely, related data of a face image) through a face recognition model, and the similarity of two faces is obtained by solving a cosine distance between the two face feature vectors. Therefore, an excellent face recognition model needs to output enough features to ensure the accuracy of face recognition.
In some specific scenes, for example, in a dynamic face recognition scene which is currently being widely researched, in order to complete non-sensory recognition, a camera is required to collect data in real time for recognition of M: N, where M represents the number of faces in an image collected by the camera in real time, and N represents the number of all faces registered in the scene. When N is large, the memory of the computer is challenged because the registered face data needs to be downloaded to the memory for later comparison. Specifically, currently, the following two schemes are commonly used in the face recognition technology to complete face similarity calculation:
(1) and reading all the registered face feature vectors into a memory before the face recognition service is started.
(2) And reading the registered face features from the database in batches during face recognition.
It should be noted that the facial feature data in the above two schemes are stored in a floating point type.
The application scenario of the scheme (1) can only be a scenario that the data size of all the registered face feature vectors is within the range of the machine memory, and if the data size is too large, the scheme cannot be used.
Although the scheme (2) can be applied to a scene with a large data volume, due to the limitation of a machine memory, data needs to be read from a database in batches and similarity calculation needs to be performed in the memory, and the real-time performance of the dynamic face recognition service is affected.
In view of the fact that the prior art cannot solve the problem of machine resources faced by mass registrants in large-scale scenes, and the problem hinders the wide landing of dynamic face recognition to a certain extent, most of the current application scenes adopt certificates to assist recognition. Along with the popularization of electronic certificates in future life, the dynamic face recognition technology is bound to be widely applied. Under such a trend, it is important to provide a compression method for floating-point image data to reduce the memory usage of face extraction features.
The disclosure provides a compression storage scheme for image data of a floating point type, aiming at reducing the consumption of a large number of human face features to a memory. The compression storage scheme can be used for any product or project with the calculation requirement of mass floating point data.
According to an embodiment of the present disclosure, a method for storing image data is provided, and fig. 1 is a schematic flow chart of the method for storing image data according to an embodiment of the present disclosure, which specifically includes:
s101: acquiring image data to be stored;
in an example, the image data is a feature vector of a floating-point data type, but may also be image data of other forms, such as data corresponding to an image pixel point, and the like, which is not limited herein.
S102: determining a target interval according to a preset target storage digit, and determining a designated subinterval in the target interval according to a designated value;
in one example, the target interval is a numerical range that can be stored by the storage scheme, and specifically, a limit value that can be stored can be determined according to a preset target storage bit number; then, the target interval is determined based on the limit value. Within the limitUnder the premise of determining the target storage bit number and the storage format, the limit value which can be stored in the target storage bit number can be calculated, for example, the target storage bit is determined to be 16 bits, then the exponent bit is determined to be 4 bits according to the target storage bit, and the maximum value of the value which can be expressed by the binary 4-bit exponent bit is 28The minimum value is-28Thereby determining that the range of the target interval is [ -2 ]8,28]. In this example, binary systems are used as an example, and in a specific use process, no matter the hexa-system and the twelve-system can be used for determining the storable limit value and then determining the target interval range. By the scheme, the numerical range which can be represented by the target storage digit is determined, the data beyond the range is prepared to be specially processed, and the data can be stored without distortion by adopting the scheme.
In one example, an interval having an absolute value not lower than a specified value within the target interval is determined as a specified subinterval. In the subsequent storage step, in order to store data as faithfully as possible, the data are divided into two different ranges according to the numerical value and stored in different forms, and the specified value is a specific value set according to the storage requirement and used for dividing the target interval into at least two different ranges. Specifically, the specified value may be 1, that is, data having an absolute value not less than 1 is divided into specified subintervals. By the aid of the dividing method, the target interval can be divided into at least two different sub-intervals, and then the sub-intervals are stored in a corresponding mode according to characteristics of numerical values in each interval, so that a fidelity effect can be achieved.
S103: converting the image data into target data having a value belonging to the target section;
in one example, for all image data of a whole image, judging whether all the image data are in a target interval, and if so, directly taking the image data as target data; if not, all the image data are processed uniformly to be converted into target data in the target section.
In one example, the mean and standard deviation of all image data is obtained; then, the average and the standard deviation are used for normalization to generate target data with values belonging to the target section, it should be emphasized that the number of the target data is equal to the number of all the image data before conversion, for example, if there are N image data before conversion, there are N target data after conversion. Specifically, the normalization may employ a Z-score normalization method, which normalizes data based on the mean and standard deviation (standard deviation) of raw data. The transformation function is: x- μ σ, where μ is the mean of all sample data and σ is the standard deviation of all sample data. The processed data were in accordance with the standard normal distribution, i.e. mean 0 and standard deviation 1. By converting the image data into the target interval through normalization, the difference of cosine distance or inner product results among image samples can be increased, and the discrimination is stronger, which is an advantage of being unique for image identification. And the processed image feature data conform to normal distribution, thereby not only keeping the relevance among the image features, but also reducing the weight of unimportant feature data or noise data. In summary, although normalization has a certain loss in data accuracy, it can play a positive role in the image recognition process, thereby improving the recognition accuracy.
S104: storing data belonging to the specified subinterval in the target data in a first type; the first type is data comprising a first sign bit, an exponent bit and a first mantissa bit, and the total number of the three bits is equal to the target storage bit number.
In one example, the first type of storage bit number is a first sign bit, an exponent bit and a first mantissa bit in order from high to low, the first sign bit is used for representing that the target data is positive and negative, the exponent bit is used for storing an exponent, and the sum of the first sign bit, the exponent bit and the first mantissa bit is equal to the target storage bit number;
in one example, the first sign bit is set to a designated flag, characterizing the data as a positive or negative number; setting the numerical value of the exponent number to be obtained by adding a preset constant to the exponential numerical value of data in a scientific counting method form, wherein the preset constant is related to the number of the exponent number; setting the value of the first mantissa bit as the tail of data in scientific counting methodBinary representation of the numerical value. Specifically, with the target number of storage bits being 2 bytes 16 bits, the specified subinterval is (-2)8,-1]∪[1,+28) For example, in binary storage, as shown in fig. 2, the highest bit in the memory is the first sign bit set as 1 bit, 0 represents a positive number, and 1 represents a negative number; next, 4-bit exponent bits are set to represent exponents when the exponents are represented by a scientific notation method, the scientific notation method adopts a binary representation, so that a base 2 is used, in order to solve the problem that negative exponents cannot be stored, an offset 7 needs to be added when the real values of the exponents are converted into the exponent bits, and then the exponent bits are converted into a binary form; the last is the first mantissa bit of 11 bits, representing the binary form of the fractional part when scientific notation is used. If the above first type is used, the image data 2.5 is stored in 2 bytes as: 1010110011001100. by adopting the scheme, the image data can be flexibly stored in a selected mode, and the precision of the image data is ensured to the maximum extent.
Fig. 3 shows a comparison of the prior art, i.e. 2.5 for 4-byte storage in single precision floating point, and 2.5 for 2-byte storage in this scheme.
In an example, 4 bytes of image data stored in the prior art is selected as a first sample, then the method disclosed by the present disclosure is selected, 2 bytes of image data stored is selected as a second sample, and then the first sample and the second sample are compared in terms of characteristics, as shown in table 1, it can be seen that the memory occupied by the data compressed according to the scheme is reduced by 50%, and the recognition rate is only reduced by less than 2%, that is, on the basis of greatly saving the space occupation, the influence on the calculation result is very small, and the expectation can be reached.
TABLE 1 image data storage cost resource comparison Table
Figure BDA0003418875340000071
In summary, the scheme of the present disclosure may design the target storage bit number according to specific requirements, and store the image data according to the target storage bit number. In particular, image data can be compressed greatly when the memory is insufficient. Moreover, the compressed image data can maximize fidelity without influencing the subsequent feature extraction or identification.
According to an embodiment of the present disclosure, there is also provided a method for storing image data, and fig. 4 is a schematic flow chart of a method for storing image data according to another embodiment of the present disclosure, which specifically includes:
s401: acquiring image data to be stored;
s402: determining a target interval according to a preset target storage digit, and determining a designated subinterval in the target interval according to a designated value;
s403: converting the image data into target data having a value belonging to the target section;
s404: storing data belonging to the specified subinterval in the target data in a first type; the first type is data comprising a first sign bit, an exponent bit and a first mantissa bit, and the total number of the three bits is equal to the target storage bit number.
The above-mentioned specific implementation of S401-S404 is the same as S101-S104, and is not described herein again.
S405: storing data which does not belong to the specified subinterval in the target data in a second type; wherein the second type is that the data comprises a second sign bit and a second mantissa bit, and the total number of bits of the second sign bit and the second mantissa bit is equal to the target storage bit number.
In one example, if the specified subinterval is (-2)8,-1]∪[1,+28) Then if the target data is within the (-1, 1) range, then it does not belong to the specified subinterval, then the second type of storage is employed. Through the partition, the data can be stored according to the characteristics of the data in different partitions, so that the storage efficiency is improved, and the fidelity of the data is improved.
In one example, the second sign bit is set to a designated flag, and the data is characterized as a positive number or a negative number; the value of the second mantissa bit is set to a binary representation of the data. Specifically, taking the target storage bit number as 2 bytes and 16 bits, and the value of the target data as-0.35 as an example, first, as shown in fig. 5, the most significant bit in the memory is the second sign bit set as 1 bit, 0 represents a positive number, and 1 represents a negative number; the second mantissa bit is the bit that converts the target fractional portion to binary. Fig. 6 shows the comparison of 4 bytes of storage-0.35 using the existing single-precision floating point and 2 bytes of storage-0.35 using the scheme, and it can be seen that, by using the scheme, the target storage bit number can be selected for storage according to actual requirements, and if the target storage bit number is small, the occupation of bytes during storage can be greatly reduced, thereby saving storage space and improving the efficiency of data transmission and use.
In an example, converting the image data into target data whose value belongs to the target interval may further be: extracting the features of the image data, specifically, if the image data is pixel data, extracting the vector features of the image data, wherein the vector features are floating point type data; and then, converting the extracted feature data into target data belonging to the target interval. By adopting the scheme, the vector characteristics can be acquired through any image related data, and then the vector characteristics are stored based on the acquired vector characteristics.
As shown in fig. 7, an embodiment of the present disclosure provides an image data storage device 700, including:
a data obtaining module 701, configured to obtain image data to be stored;
an interval determining module 702, configured to determine a target interval according to a preset target storage bit number, and determine a designated sub-interval within the target interval according to a designated value;
a data conversion module 703, configured to convert the image data into target data whose value belongs to the target interval;
a first storage module 704, configured to store data belonging to the specified subinterval in a first type, where the first type is data including a first sign bit, an exponent bit, and a first mantissa bit, and a total number of bits of the first sign bit, the exponent bit, and the mantissa bit is equal to the target storage bit number.
As shown in fig. 8, an embodiment of the present disclosure provides another image data storage apparatus 800, including:
a data obtaining module 801, configured to obtain image data to be stored;
an interval determining module 802, configured to determine a target interval according to a preset target storage bit number, and determine a designated sub-interval within the target interval according to a designated value;
a data conversion module 803, configured to convert the image data into target data whose value belongs to the target interval;
a first storage module 804, configured to store data belonging to the specified subinterval in a first type, where the first type is data including a first sign bit, an exponent bit, and a first mantissa bit, and a total number of bits of the first sign bit, the exponent bit, and the mantissa bit is equal to the target storage bit number.
A second storage module 805, configured to store, in a second type, data that does not belong to the specified subinterval in the target data; wherein the second type is that the data comprises a second sign bit and a second mantissa bit, and the total number of bits of the second sign bit and the second mantissa bit is equal to the target storage bit number.
In one example, the interval determining module in the above apparatus is configured to:
and determining an interval with an absolute value not lower than a specified value in the target interval as a specified subinterval.
In one example, the apparatus 700 further includes:
the first sign bit setting module is used for setting the first sign bit as a designated identifier and representing data as a positive number or a negative number;
the exponent number setting module is used for setting the value of the exponent number to be obtained by adding a preset constant to the exponent number of the data in the form of a scientific counting method, wherein the preset constant is related to the number of the exponent number;
the first mantissa digit setting module is used for setting the value of the first mantissa digit into binary representation of the mantissa value of the data in the form of scientific counting method.
In an example, the apparatus 800 further includes:
the second sign bit setting module is used for setting the second sign bit as a designated identifier and representing that the data is a positive number or a negative number;
a second mantissa bit setting module to set a value of the second mantissa bit to a binary representation of the data.
In an example, the interval determining module in any one of the apparatuses is configured to:
determining a limit value capable of being stored according to a preset target storage bit number;
the target interval is determined on the basis of the limit value.
In an example, the interval determining module in any one of the apparatuses is configured to:
obtaining a mean and a standard deviation of the image data;
and normalizing by using the mean value and the standard deviation to generate target data with values belonging to the target interval.
In an example, the data conversion module in any one of the above apparatuses is configured to:
extracting the features of the image data;
and converting the extracted feature data into target data belonging to the target interval.
The functions of each module in each apparatus in the embodiments of the present disclosure may refer to the corresponding description in the above method, and are not described herein again.
In the technical scheme of the disclosure, the acquisition, storage, application and the like of the personal information of the related user all accord with the regulations of related laws and regulations, and do not violate the good customs of the public order.
The present disclosure also provides an electronic device, a readable storage medium, and a computer program product according to embodiments of the present disclosure.
Fig. 9 illustrates a schematic block diagram of an example electronic device 800 that can be used to implement embodiments of the present disclosure. Electronic devices are intended to represent various forms of digital computers, such as laptops, desktops, workstations, personal digital assistants, servers, blade servers, mainframes, and other appropriate computers. The electronic device may also represent various forms of mobile devices, such as personal digital processing, cellular phones, smart phones, wearable devices, and other similar computing devices. The components shown herein, their connections and relationships, and their functions, are meant to be examples only, and are not meant to limit implementations of the disclosure described and/or claimed herein.
As shown in fig. 9, the apparatus 900 includes a computing unit 901, which can perform various appropriate actions and processes in accordance with a computer program stored in a Read Only Memory (ROM)902 or a computer program loaded from a storage unit 908 into a Random Access Memory (RAM) 903. In the RAM 903, various programs and data required for the operation of the device 900 can also be stored. The calculation unit 901, ROM 902, and RAM 903 are connected to each other via a bus 904. An input/output (I/O) interface 905 is also connected to bus 904.
A number of components in the device 900 are connected to the I/O interface 905, including: an input unit 906 such as a keyboard, a mouse, and the like; an output unit 907 such as various types of displays, speakers, and the like; a storage unit 908 such as a magnetic disk, optical disk, or the like; and a communication unit 909 such as a network card, a modem, a wireless communication transceiver, and the like. The communication unit 909 allows the device 900 to exchange information/data with other devices through a computer network such as the internet and/or various telecommunication networks.
The computing unit 901 may be a variety of general and/or special purpose processing components having processing and computing capabilities. Some examples of the computing unit 901 include, but are not limited to, a Central Processing Unit (CPU), a Graphics Processing Unit (GPU), various dedicated Artificial Intelligence (AI) computing chips, various computing units running machine learning model algorithms, a Digital Signal Processor (DSP), and any suitable processor, controller, microcontroller, and so forth. The calculation unit 901 performs the respective methods and processes described above, such as storage of method image data. For example, in some embodiments, the storage of method image data may be implemented as a computer software program tangibly embodied on a machine-readable medium, such as storage unit 908. In some embodiments, part or all of the computer program may be loaded and/or installed onto device 900 via ROM 902 and/or communications unit 909. When the computer program is loaded into the RAM 903 and executed by the computing unit 901, one or more steps of the storage of image data of the above-described method may be performed. Alternatively, in other embodiments, the computing unit 901 may be configured to perform the storing of method image data by any other suitable means (e.g., by means of firmware).
Various implementations of the systems and techniques described here above may be implemented in digital electronic circuitry, integrated circuitry, Field Programmable Gate Arrays (FPGAs), Application Specific Integrated Circuits (ASICs), Application Specific Standard Products (ASSPs), system on a chip (SOCs), load programmable logic devices (CPLDs), computer hardware, firmware, software, and/or combinations thereof. These various embodiments may include: implemented in one or more computer programs that are executable and/or interpretable on a programmable system including at least one programmable processor, which may be special or general purpose, receiving data and instructions from, and transmitting data and instructions to, a storage system, at least one input device, and at least one output device.
Program code for implementing the methods of the present disclosure may be written in any combination of one or more programming languages. These program codes may be provided to a processor or controller of a general purpose computer, special purpose computer, or other programmable data processing apparatus, such that the program codes, when executed by the processor or controller, cause the functions/operations specified in the flowchart and/or block diagram to be performed. The program code may execute entirely on the machine, partly on the machine, as a stand-alone software package partly on the machine and partly on a remote machine or entirely on the remote machine or server.
In the context of this disclosure, a machine-readable medium may be a tangible medium that can contain, or store a program for use by or in connection with an instruction execution system, apparatus, or device. The machine-readable medium may be a machine-readable signal medium or a machine-readable storage medium. A machine-readable medium may include, but is not limited to, an electronic, magnetic, optical, electromagnetic, infrared, or semiconductor system, apparatus, or device, or any suitable combination of the foregoing. More specific examples of a machine-readable storage medium would include an electrical connection based on one or more wires, a portable computer diskette, a hard disk, a Random Access Memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), an optical fiber, a portable compact disc read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the foregoing.
To provide for interaction with a user, the systems and techniques described here can be implemented on a computer having: a display device (e.g., a CRT (cathode ray tube) or LCD (liquid crystal display) monitor) for displaying information to a user; and a keyboard and a pointing device (e.g., a mouse or a trackball) by which a user can provide input to the computer. Other kinds of devices may also be used to provide for interaction with a user; for example, feedback provided to the user can be any form of sensory feedback (e.g., visual feedback, auditory feedback, or tactile feedback); and input from the user may be received in any form, including acoustic, speech, or tactile input.
The systems and techniques described here can be implemented in a computing system that includes a back-end component (e.g., as a data server), or that includes a middleware component (e.g., an application server), or that includes a front-end component (e.g., a user computer having a graphical user interface or a web browser through which a user can interact with an implementation of the systems and techniques described here), or any combination of such back-end, middleware, or front-end components. The components of the system can be interconnected by any form or medium of digital data communication (e.g., a communication network). Examples of communication networks include: local Area Networks (LANs), Wide Area Networks (WANs), and the Internet.
The computer system may include clients and servers. A client and server are generally remote from each other and typically interact through a communication network. The relationship of client and server arises by virtue of computer programs running on the respective computers and having a client-server relationship to each other. The server may be a cloud server, a server of a distributed system, or a server with a combined blockchain.
It should be understood that various forms of the flows shown above may be used, with steps reordered, added, or deleted. For example, the steps described in the present disclosure may be executed in parallel, sequentially, or in different orders, as long as the desired results of the technical solutions disclosed in the present disclosure can be achieved, and the present disclosure is not limited herein.
The above detailed description should not be construed as limiting the scope of the disclosure. It should be understood by those skilled in the art that various modifications, combinations, sub-combinations and substitutions may be made in accordance with design requirements and other factors. Any modification, equivalent replacement, and improvement made within the spirit and principle of the present disclosure should be included in the scope of protection of the present disclosure.

Claims (19)

1. A method of storing image data, comprising:
acquiring image data to be stored;
determining a target interval according to a preset target storage digit, and determining a designated subinterval in the target interval according to a designated value;
converting the image data into target data having a value belonging to the target section;
storing data belonging to the specified subinterval in the target data in a first type; wherein the first type is that the data comprises a first sign bit, an exponent bit and a first mantissa bit, and the total number of bits of the three is equal to the target storage bit number.
2. The method of claim 1, further comprising:
storing data which does not belong to the specified subinterval in the target data in a second type; wherein the second type is that the data comprises a second sign bit and a second mantissa bit and the total number of bits of the second sign bit and the second mantissa bit is equal to the target number of storage bits.
3. The method of claim 1, wherein said determining a specified subinterval within the target interval according to a specified value comprises:
and determining an interval with the absolute value not lower than a specified value in the target interval as a specified subinterval.
4. The method of claim 1, further comprising:
setting the first sign bit as a designated identifier, and representing data as a positive number or a negative number;
setting the numerical value of the exponent number to be obtained by adding a preset constant to the exponent numerical value of data in a scientific counting method form, wherein the preset constant is related to the number of the exponent number;
and setting the value of the first mantissa digit as a binary representation of the mantissa value of the data in the form of scientific notation.
5. The method of claim 2, further comprising:
setting the second sign bit as a designated identifier, and representing that the data is a positive number or a negative number;
setting a value of the second mantissa bit to a binary representation of the data.
6. The method of claim 1, wherein the determining the target interval according to the preset target storage bit number comprises:
determining a limit value capable of being stored according to a preset target storage bit number;
a target interval is determined from the limit values.
7. The method of claim 1, wherein converting the image data into target data having values belonging to the target interval comprises:
obtaining a mean and a standard deviation of the image data;
and normalizing by using the mean value and the standard deviation to generate target data with values belonging to the target interval.
8. The method of claim 1, wherein converting the image data into target data having values belonging to the target interval comprises:
performing feature extraction on the image data;
and converting the extracted feature data into target data belonging to the target interval.
9. An apparatus for storing image data, comprising:
the data acquisition module is used for acquiring image data to be stored;
the interval determining module is used for determining a target interval according to a preset target storage digit and determining a designated subinterval in the target interval according to a designated value;
the data conversion module is used for converting the image data into target data of which the value belongs to the target interval;
and the first storage module is used for storing the data belonging to the specified subinterval in the target data in a first type, wherein the first type is data comprising a first sign bit, an exponent bit and a first mantissa bit, and the total number of the three bits is equal to the target storage bit number.
10. The apparatus of claim 9, further comprising:
the second storage module is used for storing the data which do not belong to the specified subinterval in the target data in a second type; wherein the second type is that the data comprises a second sign bit and a second mantissa bit and the total number of bits of the second sign bit and the second mantissa bit is equal to the target number of storage bits.
11. The apparatus of claim 9, wherein the interval determination module is configured to:
and determining an interval with the absolute value not lower than a specified value in the target interval as a specified subinterval.
12. The apparatus of claim 9, further comprising:
the first sign bit setting module is used for setting the first sign bit as a designated identifier and representing data as a positive number or a negative number;
the exponent number setting module is used for setting the value of the exponent number to be obtained by adding a preset constant to the exponent number of data in a scientific counting method form, wherein the preset constant is related to the number of the exponent number;
the first mantissa digit setting module is used for setting the value of the first mantissa digit to be binary representation of the mantissa value of the data in a scientific counting method form.
13. The apparatus of claim 10, further comprising:
the second sign bit setting module is used for setting the second sign bit as a designated identifier and representing data as a positive number or a negative number;
a second mantissa bit setting module to set a value of the second mantissa bit to a binary representation of data.
14. The apparatus of claim 9, wherein the interval determination module is configured to:
determining a limit value capable of being stored according to a preset target storage bit number;
a target interval is determined from the limit values.
15. The apparatus of claim 9, wherein the data conversion module is to:
obtaining a mean and a standard deviation of the image data;
and normalizing by using the mean value and the standard deviation to generate target data with values belonging to the target interval.
16. The apparatus of claim 9, wherein the data conversion module is to:
performing feature extraction on the image data;
and converting the extracted feature data into target data belonging to the target interval.
17. An electronic device, comprising:
at least one processor; and
a memory communicatively coupled to the at least one processor; wherein the content of the first and second substances,
the memory stores instructions executable by the at least one processor to enable the at least one processor to perform the method of any one of claims 1-8.
18. A non-transitory computer readable storage medium having stored thereon computer instructions for causing the computer to perform the method of any one of claims 1-8.
19. A computer program product comprising a computer program which, when executed by a processor, implements the method according to any one of claims 1-8.
CN202111555142.0A 2021-12-17 2021-12-17 Image data storage method and device, electronic equipment and storage medium Pending CN114282026A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202111555142.0A CN114282026A (en) 2021-12-17 2021-12-17 Image data storage method and device, electronic equipment and storage medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202111555142.0A CN114282026A (en) 2021-12-17 2021-12-17 Image data storage method and device, electronic equipment and storage medium

Publications (1)

Publication Number Publication Date
CN114282026A true CN114282026A (en) 2022-04-05

Family

ID=80872910

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202111555142.0A Pending CN114282026A (en) 2021-12-17 2021-12-17 Image data storage method and device, electronic equipment and storage medium

Country Status (1)

Country Link
CN (1) CN114282026A (en)

Similar Documents

Publication Publication Date Title
CN106549673B (en) Data compression method and device
CN115567589B (en) Compression transmission method, device and equipment of JSON data and storage medium
CN114817651B (en) Data storage method, data query method, device and equipment
CN115311469A (en) Image labeling method, training method, image processing method and electronic equipment
CN113963197A (en) Image recognition method and device, electronic equipment and readable storage medium
CN113904943A (en) Account detection method and device, electronic equipment and storage medium
CN113642710A (en) Network model quantification method, device, equipment and storage medium
CN115205163B (en) Method, device and equipment for processing identification image and storage medium
CN111767419B (en) Picture searching method, device, equipment and computer readable storage medium
CN114691918B (en) Radar image retrieval method and device based on artificial intelligence and electronic equipment
CN114282026A (en) Image data storage method and device, electronic equipment and storage medium
CN115937039A (en) Data expansion method and device, electronic equipment and readable storage medium
CN115620321A (en) Table identification method and device, electronic equipment and storage medium
CN114120410A (en) Method, apparatus, device, medium and product for generating label information
CN113887630A (en) Image classification method and device, electronic equipment and storage medium
CN114691691A (en) Geohash-based spatial data processing method and device and electronic equipment
CN113903071A (en) Face recognition method and device, electronic equipment and storage medium
CN113628256A (en) Data processing method and device
CN113158801A (en) Method for training face recognition model and recognizing face and related device
CN115361584B (en) Video data processing method and device, electronic equipment and readable storage medium
CN116563395B (en) Image color feature extraction method and device, storage medium and electronic equipment
CN114550236B (en) Training method, device, equipment and storage medium for image recognition and model thereof
CN116361658A (en) Model training method, task processing method, device, electronic equipment and medium
CN114663276A (en) Map data compression method, device, equipment and storage medium
CN115757306A (en) Information compression method, device, equipment and storage medium

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