Video code stream encoding method and video code stream decoding method
Through the video stream encoding method, the infrared thermal imaging data is converted into color encoding format using lossless grayscale mapping relationship, which solves the problem of low temperature detection efficiency after infrared thermal imaging data transmission, and realizes effective retention and efficient detection of temperature information.
Patent Information
- Application Number
- CN202411224669.9
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2024-09-03
- Publication Date
- 2024-12-03
- Estimated Expiration
- 2044-09-03
AI Technical Summary
The existing infrared thermal imaging technology has low temperature detection efficiency after data transmission, which has failed to effectively solve this problem.
By using the video code stream encoding method, the original thermal imaging data stream is obtained, and the format conversion is performed according to the preset lossless grayscale mapping relationship, and the target data stream, lossless grayscale mapping relationship and measurement are obtained. The temperature parameter information is encoded in code stream to generate infrared compressed code streams to ensure that the temperature information is retained during data transmission.
Improve the temperature detection efficiency, avoid the need to perform temperature detection again after decoding, and ensure the integrity of the temperature information in the encoded data.
Smart Images

Figure CN118741135B_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the field of infrared image processing, and in particular to a video code stream encoding method and a video code stream decoding method. Background Art
[0002] Infrared thermal imaging technology uses infrared lenses and infrared detectors to sense infrared rays emitted by objects, and after light-to-electricity conversion, forms infrared images visible to the human eye. Objects above absolute zero (-273.15°C) will radiate infrared rays, and infrared thermal imaging has the characteristics of sensing temperature, not requiring visible light imaging, and avoiding interference from smoke, dust, etc. Therefore, infrared thermal imaging technology has a wide range of applications and has achieved relatively mature applications in the fields of medicine, industry, and military.
[0003] Currently, after the thermal imaging code stream is compressed, since the temperature information of the infrared image is not retained in the compressed data, the temperature of the thermal imaging image needs to be detected again after the compressed data is decoded, which leads to low temperature detection efficiency.
[0004] There is no effective solution to the problem of low temperature detection efficiency caused by data transmission of infrared thermal imaging in related technologies. Summary of the invention
[0005] In this embodiment, a video code stream encoding method and a video code stream decoding method are provided to solve the problem of low temperature detection efficiency caused by infrared thermal imaging data transmission in the related art.
[0006] In a first aspect, a video code stream encoding method is provided in this embodiment, including:
[0007] Get thermal imaging data stream in raw data format;
[0008] The thermal imaging data stream is format-converted according to a preset lossless grayscale mapping relationship to obtain a target data stream in a color coding format; wherein the pixel grayscale value in the original data format and the color coding value in the color coding format are mapped one-to-one in the lossless grayscale mapping relationship;
[0009] The target data stream, the lossless grayscale mapping relationship and the temperature measurement parameter information are encoded into a code stream to obtain an infrared compressed code stream.
[0010] In some embodiments, the format conversion of the thermal imaging data stream according to a preset lossless grayscale mapping relationship to obtain a target data stream in a color coding format includes:
[0011] Determine a conversion type of a target data stream to be converted; wherein the conversion type includes a black-hot image type, a white-hot image type, and a pseudo-color image type;
[0012] According to the conversion type, determining a lossless grayscale mapping relationship that corresponds in advance to the conversion type;
[0013] According to the determined lossless grayscale mapping relationship, the thermal imaging data stream is format converted to obtain a target data stream in a color coding format.
[0014] In some of the embodiments, determining, according to the conversion type, a lossless grayscale mapping relationship pre-corresponding to the conversion type includes:
[0015] When the conversion type of the target data stream is a black-hot image type or a white-hot image type, the lossless grayscale mapping relationship is:
[0016] Different grayscale values in the original data format for the same grayscale value in the color coding format correspond to different chromaticity values in the color coding format, respectively.
[0017] In some of the embodiments, determining, according to the conversion type, a lossless grayscale mapping relationship pre-corresponding to the conversion type includes:
[0018] When the conversion type of the target data stream is a pseudo-color image type, the lossless grayscale mapping relationship is:
[0019] Different grayscale values in the original data format correspond to different color coding combination values in the color coding format.
[0020] In some embodiments, the format conversion of the thermal imaging data stream according to a preset lossless grayscale mapping relationship to obtain a target data stream in a color coding format includes:
[0021] Performing format conversion on the thermal imaging data stream according to a preset lossless grayscale mapping relationship to obtain an initial conversion data stream of a conversion type of a black-hot image type or a white-hot image type;
[0022] The initial conversion data stream is converted into a target data stream whose conversion type is a pseudo color image type.
[0023] In some of the embodiments, the preset lossless grayscale mapping relationship includes: the smaller the grayscale difference of different pixels in the original data format is, the smaller the difference of color coding values in the corresponding color coding format is.
[0024] In some of the embodiments, the preset lossless grayscale mapping relationship includes: a grayscale value interval with higher color sensitivity of the human eye in the original data format corresponds to more color coding values in the color coding format.
[0025] In a second aspect, a video code stream decoding method is provided in this embodiment, including:
[0026] Get infrared compressed code stream;
[0027] Decoding the infrared compressed code stream to obtain a target data stream in a color coding format, a lossless grayscale mapping relationship, and temperature measurement parameter information;
[0028] According to the lossless grayscale mapping relationship, the target data stream is format-converted to obtain a thermal imaging data stream in an original data format; wherein the pixel grayscale value in the original data format and the color coding value in the color coding format in the lossless grayscale mapping relationship are mapped one-to-one;
[0029] The temperature detection information of the thermal imaging data stream is determined according to the thermal imaging data stream and the temperature measurement parameter information.
[0030] In a third aspect, a video code stream encoding device is provided in this embodiment, including: a thermal imaging acquisition module, a color coding conversion module and an encoding module; wherein:
[0031] The thermal imaging acquisition module is used to acquire the thermal imaging data stream in raw data format;
[0032] The color coding conversion module is used to convert the format of the thermal imaging data stream according to a preset lossless grayscale mapping relationship to obtain a target data stream in a color coding format; wherein the pixel grayscale value in the original data format and the color coding value in the color coding format in the lossless grayscale mapping relationship are mapped one-to-one;
[0033] The encoding module is used to perform code stream encoding on the target data stream, the lossless grayscale mapping relationship and the temperature measurement parameter information to obtain an infrared compressed code stream.
[0034] In a fourth aspect, a video code stream decoding device is provided in this embodiment, including: a compression acquisition module, a decoding module, a grayscale conversion module and a temperature measurement module; wherein:
[0035] The compression acquisition module is used to acquire infrared compression code stream;
[0036] The decoding module is used to decode the infrared compressed code stream to obtain the target data stream in the color coding format, the lossless grayscale mapping relationship and the temperature measurement parameter information;
[0037] The grayscale conversion module is used to perform format conversion on the target data stream according to the lossless grayscale mapping relationship to obtain a thermal imaging data stream in the original data format; wherein the lossless grayscale mapping relationship has a one-to-one mapping between the pixel grayscale value in the original data format and the color coding value in the color coding format;
[0038] The temperature measurement module is used to determine the temperature detection information of the thermal imaging data stream according to the thermal imaging data stream and the temperature measurement parameter information.
[0039] Compared with the related art, a video code stream encoding method and a video code stream decoding method are provided in this embodiment. The video code stream encoding method first obtains the thermal imaging data stream in the original data format; then converts the format of the thermal imaging data stream according to the preset lossless grayscale mapping relationship to obtain the target data stream in the color coding format; wherein the pixel grayscale value in the original data format in the lossless grayscale mapping relationship is mapped one-to-one with the color coding value in the color coding format; finally, the target data stream, the lossless grayscale mapping relationship and the temperature measurement parameter information are encoded to obtain an infrared compressed code stream. It can realize lossless grayscale mapping based on the one-to-one correspondence between grayscale value and color coding value during the format conversion of data transmission, so that the encoded and compressed data can retain the temperature information of the original thermal imaging data based on the correspondence between grayscale and temperature, and there is no need to perform temperature detection again after parsing the encoded data, thereby improving the efficiency of temperature detection.
[0040] Details of one or more embodiments of the present application are set forth in the following drawings and description to make other features, objects, and advantages of the present application more readily apparent. BRIEF DESCRIPTION OF THE DRAWINGS
[0041] The drawings described herein are used to provide a further understanding of the present application and constitute a part of the present application. The illustrative embodiments of the present application and their descriptions are used to explain the present application and do not constitute an improper limitation on the present application. In the drawings:
[0042] Figure 1 is a hardware structure block diagram of a terminal of the video code stream encoding method of this embodiment;
[0043] Figure 2 is a flow chart of the video code stream encoding method of this embodiment;
[0044] Figure 3 is a flowchart of the video code stream decoding method of this embodiment;
[0045] Figure 4 is a flowchart of another video code stream encoding method of this embodiment;
[0046] Figure 5 is a flowchart of another video code stream decoding method of this embodiment;
[0047] Figure 6 is a structural block diagram of the video code stream encoding device of this embodiment;
[0048] Figure 7It is a structural block diagram of the video code stream decoding device of this embodiment. DETAILED DESCRIPTION
[0049] In order to more clearly understand the purpose, technical solutions and advantages of the present application, the present application is described and illustrated below in conjunction with the accompanying drawings and embodiments.
[0050] Unless otherwise defined, the technical terms or scientific terms involved in this application shall have the general meaning understood by people with general skills in the technical field to which this application belongs. The words "one", "a", "the", "these" and the like in this application do not indicate a quantitative limitation, and they may be singular or plural. The terms "include", "comprise", "have" and any variants thereof involved in this application are intended to cover non-exclusive inclusions; for example, a process, method and system, product or device comprising a series of steps or modules (units) is not limited to the listed steps or modules (units), but may include unlisted steps or modules (units), or may include other steps or modules (units) inherent to these processes, methods, products or devices. The words "connect", "connected", "coupled" and the like involved in this application are not limited to physical or mechanical connections, but may include electrical connections, whether direct or indirect. The "multiple" involved in this application refers to two or more. "And / or" describes the association relationship of associated objects, indicating that there may be three relationships, for example, "A and / or B" may mean: A exists alone, A and B exist at the same time, and B exists alone. Generally, the character " / " indicates that the objects associated with each other are in an "or" relationship. The terms "first", "second", "third", etc. in this application are only used to distinguish similar objects and do not represent a specific ordering of the objects.
[0051] The method embodiment provided in this embodiment can be executed in a terminal, a computer or a similar computing device. For example, running on a terminal, Figure 1 FIG. 1 is a hardware structure block diagram of a terminal of the video code stream encoding method of this embodiment. Figure 1 As shown, the terminal may include one or more ( Figure 1 Only one is shown in the figure) a processor 102 and a memory 104 for storing data, wherein the processor 102 may include but is not limited to a processing device such as a microprocessor MCU or a programmable logic device FPGA. The above terminal may also include a transmission device 106 and an input and output device 108 for communication functions. It can be understood by those skilled in the art that Figure 1 The structure shown is only for illustration and does not limit the structure of the above terminal. Figure 1 More or fewer components as shown, or with Figure 1Different configurations shown.
[0052] The memory 104 can be used to store computer programs, for example, software programs and modules of application software, such as the computer program corresponding to the video code stream encoding method in this embodiment. The processor 102 executes various functional applications and data processing by running the computer program stored in the memory 104, that is, to implement the above method. The memory 104 may include a high-speed random access memory, and may also include a non-volatile memory, such as one or more magnetic storage devices, flash memory, or other non-volatile solid-state memory. In some examples, the memory 104 may further include a memory remotely arranged relative to the processor 102, and these remote memories may be connected to the terminal via a network. Examples of the above-mentioned network include, but are not limited to, the Internet, an intranet, a local area network, a mobile communication network, and combinations thereof.
[0053] The transmission device 106 is used to receive or send data via a network. The above network includes a wireless network provided by a communication provider of the terminal. In one example, the transmission device 106 includes a network adapter (Network Interface Controller, referred to as NIC), which can be connected to other network devices through a base station so as to communicate with the Internet. In one example, the transmission device 106 can be a radio frequency (Radio Frequency, referred to as RF) module, which is used to communicate with the Internet wirelessly.
[0054] In this embodiment, a video code stream encoding method is provided. Figure 2 is a flow chart of the video code stream encoding method of this embodiment. Figure 2 As shown, the process includes the following steps:
[0055] Step S210, obtaining a thermal imaging data stream in a raw data format.
[0056] The raw data format may be a raw format in the raw data code stream of the infrared image. The raw data format of the thermal imaging data stream may be a number of raw format thermal imaging images intercepted from the raw data code stream of the infrared image. The raw format is an unprocessed and uncompressed raw image encoding data format. 25 or 50 raw format thermal imaging images may be intercepted from a 1s infrared image raw data code stream.
[0057] Step S220, converting the format of the thermal imaging data stream according to a preset lossless grayscale mapping relationship to obtain a target data stream in a color coding format; wherein the lossless grayscale mapping relationship has a one-to-one mapping between the pixel grayscale value in the original data format and the color coding value in the color coding format.
[0058] Before the thermal imaging data stream is compressed and encoded, it is necessary to convert the thermal imaging data stream in the original data format into a target data stream in the color coding (YUV) format through format conversion. Specifically, when performing the format conversion, the pixel grayscale value of each frame of the thermal imaging image in the thermal imaging data stream can be converted into a color coding value (YUV value). In order to achieve lossless grayscale mapping and avoid the subsequent thermal imaging data stream restored based on the target data stream in the color coding format from losing part of the grayscale information, thereby avoiding the loss of temperature information, when performing the format conversion in this embodiment, the pixel grayscale value in the original data format corresponds to the color coding value in the color coding format. That is, in this embodiment, different pixel grayscale values correspond to different color coding values.
[0059] Among them, when setting the lossless grayscale mapping relationship, multiple pixel grayscale values can be made to correspond to the same grayscale value (that is, the Y value in the YUV value), and different pixel grayscale values can be made to correspond to different chromaticity values (that is, the UV value in the YUV value), so as to reduce the impact on the visual effect on the basis of achieving a one-to-one mapping relationship between the pixel grayscale value and the YUV value. In addition, different YUV combination values can be directly used to correspond to different pixel grayscale values. In addition, when setting the mapping relationship between the grayscale value and the color coding value, similar grayscales can be made to correspond to similar color coding values. In addition, for grayscale value areas where the human eye is more sensitive to color, relatively more color coding values can be mapped, and for grayscale value areas where the human eye is less sensitive to color, fewer color coding values can be mapped, so that users can accurately observe the image.
[0060] Step S230, encoding the target data stream, the lossless grayscale mapping relationship and the temperature measurement parameter information into a code stream to obtain an infrared compressed code stream.
[0061] Since the grayscale value is proportional to the temperature information in the thermal imaging image, if the grayscale value can be losslessly mapped during the format conversion process, the data after the format conversion can still retain the temperature information. Based on this, this embodiment can retain the temperature information based on the lossless grayscale mapping relationship.
[0062] Among them, the lossless grayscale mapping relationship can be implemented in the form of a mapping table, and can also be implemented in other data forms, such as function expressions, matrices, etc. The specific data form is not specifically limited in this embodiment. Different encoding methods are selected for the data volume of the data form of the lossless grayscale mapping relationship, such as the data volume of the lossless grayscale mapping table, combined with the data volume of the temperature measurement parameter information. Among them, if the data volume of the lossless grayscale mapping table and the temperature measurement parameter information is small, the lossless grayscale mapping table and the temperature measurement parameter information can be stored in the header of the transmission protocol and encoded; if the data volume of the lossless grayscale mapping table and the temperature measurement parameter information is large, the lossless grayscale mapping table and the temperature measurement parameter information can be stored in the auxiliary frame of the transmission protocol for encoding, and finally combined with the encoding of the thermal imaging data stream, an infrared compression code stream that can retain the temperature information is generated.
[0063] Specifically, the lossless grayscale mapping relationship is taken as an example of a lossless grayscale mapping table. In the lossless grayscale mapping table, a pixel grayscale value data column in the original data format may be included, which includes several pixel grayscale values in the original data format. In addition, the lossless grayscale mapping table may also include a YUV data array. The YUV data array includes a Y data column, a U data column, and a V data column. Among them, the Y data column includes several Y values; the U data column includes several U values; and the V data column includes several V values. Each YUV combination value corresponds one-to-one to a pixel grayscale value in the original data format.
[0064] At present, in the related technology, it is often impossible to retain temperature information in the compressed data stream, so after the data stream transmission is completed, the temperature detection needs to be performed again after the data stream is parsed and restored, resulting in low temperature detection efficiency. Different from this, this embodiment makes the pixel grayscale value correspond to the color coding value one by one during the format conversion, thereby realizing lossless mapping of the grayscale, so that the data after the format conversion can still retain the temperature information, and then there is no need to perform temperature detection again after decoding, thereby improving the efficiency of temperature detection.
[0065] In the above steps S210 to S230, the thermal imaging data stream in the original data format is obtained; the thermal imaging data stream is format-converted according to the preset lossless grayscale mapping relationship to obtain the target data stream in the color coding format; wherein the pixel grayscale value in the original data format in the lossless grayscale mapping relationship is mapped one-to-one with the color coding value in the color coding format; the target data stream, the lossless grayscale mapping relationship and the temperature measurement parameter information are encoded to obtain an infrared compressed code stream. Based on the one-to-one correspondence between the grayscale value and the color coding value, lossless grayscale mapping can be realized during the format conversion of data transmission, so that the encoded and compressed data can retain the temperature information of the original thermal imaging data based on the correspondence between the grayscale and the temperature, and there is no need to perform temperature detection again after parsing the encoded data, thereby improving the temperature detection efficiency.
[0066] In one embodiment, based on the above step S220, format conversion is performed on the thermal imaging data stream according to a preset lossless grayscale mapping relationship to obtain a target data stream in a color coding format, which may include:
[0067] Determine a conversion type of a target data stream to be converted; wherein the conversion type includes a black-hot image type, a white-hot image type, and a pseudo-color image type; according to the conversion type, determine a lossless grayscale mapping relationship that corresponds in advance to the conversion type; according to the determined lossless grayscale mapping relationship, perform format conversion on the thermal imaging data stream to obtain a target data stream in a color-coded format.
[0068] In this embodiment, different lossless grayscale mapping relationships can be selected for different conversion types. If the thermal imaging image needs to be converted into a black-hot image or a white-hot image, the conversion type is a black-hot image type or a white-hot image type; if the thermal imaging image needs to be converted into a pseudo-color image, the conversion type is a pseudo-color image type. In this embodiment, different lossless grayscale mapping relationships are set for different conversion types, which can facilitate lossless format conversion while avoiding affecting the visual effect of the converted image.
[0069] In one embodiment, according to the conversion type, determining the lossless grayscale mapping relationship pre-corresponding to the conversion type may include:
[0070] When the conversion type of the target data stream is a black-hot image type or a white-hot image type, the lossless grayscale mapping relationship is: different grayscale values in the original data format of the same grayscale value in the color encoding format correspond to different chromaticity values in the color encoding format.
[0071] That is, when the conversion type is a black-hot image type or a white-hot image type, multiple pixel grayscale values in the original thermal imaging image can correspond to the same Y value in the YUV value. On this basis, the UV values corresponding to different pixel grayscale values are adjusted so that different pixel grayscale values correspond to different UV values. Among them, the UV value can be adjusted within a preset limited correction range, and the correction range is an empirical value, for example, the correction range can be 0 to 4 different positive and negative values. In this way, multiple pixel grayscale values corresponding to the same Y value can correspond to different UV values, so as to facilitate the distinction of pixels of different grayscales and realize lossless grayscale mapping. Since the image brightness (grayscale value) has a greater impact on the visual effect of the image, while the chromaticity has a relatively unobvious impact on the visual effect of the image. Therefore, in this embodiment, multiple pixel grayscale values in the raw format correspond to the same Y value and correspond to different UV values, which can reduce the impact on the visual effect of the image, so that the grayscale value in the raw format corresponds to the YUV value in the color coding format. Since the grayscale value is proportional to the temperature value, in this form, the impact on the visual effect of the YUV data can be reduced and the temperature information can be retained.
[0072] Additionally, in one embodiment, according to the conversion type, determining the lossless grayscale mapping relationship pre-corresponding to the conversion type may include:
[0073] When the conversion type of the target data stream is a pseudo-color image type, the lossless grayscale mapping relationship is: different grayscale values in the original data format correspond to different color coding combination values in the color coding format.
[0074] When it is necessary to convert a thermal image into a pseudo-color image, when setting the lossless grayscale mapping relationship, each grayscale value in the thermal image in the raw format can correspond to a YUV combination value. Among them, similar grayscales can be mapped to similar YUV combination values. In addition, the thermal image can be first converted into a black thermal image or a white thermal image, and then the black thermal image or the white thermal image can be converted into a pseudo-color image.
[0075] In one embodiment, format conversion of the thermal imaging data stream according to a preset lossless grayscale mapping relationship to obtain a target data stream in a color coding format may include:
[0076] The thermal imaging data stream is format-converted according to a preset lossless grayscale mapping relationship to obtain an initial conversion data stream whose conversion type is a black-hot image type or a white-hot image type; and the initial conversion data stream is converted into a target data stream whose conversion type is a pseudo-color image type.
[0077] Among them, the thermal imaging data stream can be format converted according to the lossless grayscale mapping relationship corresponding to the conversion type of the black heat image type or the white heat image type to obtain the initial conversion data stream. During this format conversion, different grayscale values in the raw format can correspond to the same Y value and different UV values. Afterwards, the initial conversion data stream is converted into a target data stream of the pseudo-color image type. Therefore, this embodiment can achieve lossless mapping of grayscale during format conversion, thereby retaining temperature information.
[0078] Additionally, in one embodiment, the above-mentioned preset lossless grayscale mapping relationship includes: the smaller the grayscale difference of different pixels in the original data format, the smaller the color coding value difference in the corresponding color coding format. Among them, for different pixels, the smaller the grayscale difference, the more similar the grayscale; the smaller the color coding value difference, the more similar the color. Based on this, this embodiment makes the color coding values assigned to different pixels with smaller grayscale differences closer, so that similar grayscales are mapped to similar colors, thereby improving the visual effect of the image.
[0079] In addition, in one embodiment, the above-mentioned preset lossless grayscale mapping relationship includes: the grayscale value interval with higher color sensitivity of the human eye in the original data format corresponds to more color coding values in the color coding format. Among them, since the combined value range of YUV is 256×256×256, the value range of raw format data is 0 to 16383. Therefore, the value range of YUV is much larger than the value range of raw format data. Therefore, when mapping YUV values to grayscale values in raw format, there are enough YUV values to correspond to grayscale values in raw format. Based on this, this embodiment corresponds to different grayscale value intervals and allocates YUV values of different spans. For grayscale value intervals with higher color sensitivity of the human eye, color coding values with higher granularity can be allocated; for grayscale value intervals with lower color sensitivity of the human eye, color coding values with lower granularity can be allocated. As a result, it is convenient for users to accurately observe the image after format conversion.
[0080] This embodiment also provides a video code stream decoding method. Figure 3 is a flowchart of the video code stream decoding method of this embodiment. Figure 3 As shown, the process includes the following steps:
[0081] Step S310, obtaining an infrared compression code stream, wherein the infrared compression code stream may be a data stream received by a receiver and should be compressed and encoded.
[0082] Step S320, decode the infrared compressed code stream to obtain the target data stream in color coding format, lossless grayscale mapping relationship and temperature measurement parameter information. The lossless grayscale mapping table and temperature measurement parameter information stored in the protocol header or auxiliary frame during the encoding process can be obtained during the decoding process.
[0083] Step S330, converting the target data stream into a format according to the lossless grayscale mapping relationship to obtain a thermal imaging data stream in the original data format; wherein the lossless grayscale mapping relationship has a one-to-one mapping between the pixel grayscale value in the original data format and the color coding value in the color coding format.
[0084] In this step, since the pixel grayscale value corresponds to the color coding value one by one, all pixel grayscale values in the original data format can be restored losslessly according to the lossless grayscale mapping table. And since the pixel grayscale value is proportional to the temperature information, the restored thermal imaging data stream retains the temperature information.
[0085] Step S340, determining the temperature detection information of the thermal imaging data stream according to the thermal imaging data stream and the temperature measurement parameter information. Based on the restored thermal imaging data and the temperature measurement parameter information, the temperature detection information in the thermal imaging data can be determined, thereby eliminating the need for temperature detection again.
[0086] The above steps S310 to S340 can realize lossless grayscale mapping when the data transmission format is converted based on the one-to-one correspondence between grayscale values and color coding values, thereby losslessly restoring all pixel grayscale values in the original data format in the decoding stage based on the correspondence between grayscale and temperature, thereby retaining the temperature information, eliminating the need to perform temperature detection again after parsing the encoded data, thereby improving the temperature detection efficiency.
[0087] Figure 4 is a flowchart of another video code stream encoding method of this embodiment. Figure 4 As shown, the video code stream encoding method includes the following steps:
[0088] Step S401, obtaining a thermal imaging data stream in raw data format; wherein, an infrared thermal imaging image in raw format is obtained from the thermal imaging raw data code stream, thereby obtaining a thermal imaging data stream in raw data format.
[0089] Step S402, determining a lossless grayscale mapping table according to a conversion type; wherein the corresponding lossless grayscale mapping table is determined according to a conversion type of a target data stream to be converted, and the conversion types include a black-hot image type, a white-hot image type, and a pseudo-color image type.
[0090] Step S403, according to the determined lossless grayscale mapping table, the thermal imaging data stream is converted into a lossless format, and the converted target data stream is output; wherein the converted target data stream is in a color coding format. In the lossless grayscale mapping table, the pixel grayscale value in the original data format is mapped one-to-one with the color coding value in the color coding format.
[0091] Step S404, encoding and compressing the target data stream, and outputting an infrared compressed code stream; wherein the infrared compressed code stream is a visible and temperature-measurable infrared video code stream.
[0092] The above steps S401 to S404 can realize lossless grayscale mapping when converting the format of data transmission based on the one-to-one correspondence between grayscale values and color coding values, so that the encoded and compressed data can retain the temperature information of the original thermal imaging data based on the correspondence between grayscale and temperature, thereby eliminating the need to perform temperature detection again after parsing the encoded data, thereby improving the temperature detection efficiency.
[0093] Figure 5 is a flowchart of another video code stream decoding method of this embodiment. Figure 5 As shown, the video code stream decoding method includes the following steps:
[0094] Step S501, obtaining an infrared compressed code stream; wherein the infrared compressed code stream is a visible and temperature-measurable infrared video code stream.
[0095] Step S502, decoding the infrared compressed code stream to obtain a target data stream; wherein the target data stream is in a color coding format.
[0096] Step S503, determining the lossless grayscale mapping table corresponding to the target data stream; wherein the lossless grayscale mapping table can be determined according to the conversion type corresponding to the target data stream, or according to the lossless grayscale mapping table stored in the protocol header or the auxiliary frame during the encoding process. In the lossless grayscale mapping table, the pixel grayscale value in the original data format is mapped one-to-one with the color coding value in the color coding format.
[0097] Step S504, performing lossless format conversion on the target data stream according to the determined lossless grayscale mapping table, and outputting a thermal imaging data stream in the original data format;
[0098] Step S505: output a temperature matrix stream according to the temperature measurement parameter information and the thermal imaging data stream to obtain a temperature detection result. Specifically, the thermal imaging data stream can be temperature-converted according to the temperature measurement parameter information and a preset conversion relationship between grayscale value and temperature to obtain a temperature detection result.
[0099] The above steps S501 to S505 can realize lossless grayscale mapping when converting the format of data transmission based on the one-to-one correspondence between grayscale values and color coding values, so that the encoded and compressed data can retain the temperature information of the original thermal imaging data based on the correspondence between grayscale and temperature, thereby eliminating the need to perform temperature detection again after parsing the encoded data, thereby improving the temperature detection efficiency.
[0100] In this embodiment, a video code stream encoding device is also provided, which is used to implement the above embodiments and preferred implementation modes, and the descriptions that have been made will not be repeated. The terms "module", "unit", "subunit", etc. used below can implement a combination of software and / or hardware of predetermined functions. Although the devices described in the following embodiments are preferably implemented in software, the implementation of hardware, or a combination of software and hardware, is also possible and conceivable.
[0101] Figure 6 is a structural block diagram of the video code stream encoding device 60 of this embodiment. Figure 6 As shown, the video code stream encoding device 60 includes: a thermal imaging acquisition module 62, a color coding conversion module 64 and an encoding module 66; wherein:
[0102] The thermal imaging acquisition module 62 is used to acquire the thermal imaging data stream in the original data format; the color coding conversion module 64 is used to convert the format of the thermal imaging data stream according to a preset lossless grayscale mapping relationship to obtain a target data stream in a color coding format; wherein the pixel grayscale value in the original data format in the lossless grayscale mapping relationship is mapped one-to-one to the color coding value in the color coding format; the encoding module 66 is used to encode the target data stream, the lossless grayscale mapping relationship and the temperature measurement parameter information to obtain an infrared compressed code stream.
[0103] In this embodiment, a video code stream decoding device is also provided, which is used to implement the above-mentioned embodiments and preferred implementation modes, and the descriptions that have been made will not be repeated. The terms "module", "unit", "subunit", etc. used below can implement a combination of software and / or hardware of predetermined functions. Although the devices described in the following embodiments are preferably implemented in software, the implementation of hardware, or a combination of software and hardware, is also possible and conceivable.
[0104] Figure 7 FIG. 7 is a structural block diagram of the video code stream decoding device 70 of this embodiment. Figure 7 As shown, the video code stream decoding device 70 includes: a compression acquisition module 72, a decoding module 74, a grayscale conversion module 76 and a temperature measurement module 78; wherein:
[0105] The compression acquisition module 72 is used to obtain the infrared compression code stream; the decoding module 74 is used to decode the infrared compression code stream to obtain the target data stream in the color coding format, the lossless grayscale mapping relationship and the temperature measurement parameter information; the grayscale conversion module 76 is used to convert the format of the target data stream according to the lossless grayscale mapping relationship to obtain the thermal imaging data stream in the original data format; wherein the pixel grayscale value in the original data format in the lossless grayscale mapping relationship is mapped one-to-one with the color coding value in the color coding format; the temperature measurement module 78 is used to determine the temperature detection information of the thermal imaging data stream according to the thermal imaging data stream and the temperature measurement parameter information.
[0106] It should be noted that the above modules can be functional modules or program modules, and can be implemented by software or hardware. For modules implemented by hardware, the above modules can be located in the same processor; or the above modules can be located in different processors in any combination.
[0107] It should be understood that the specific embodiments described herein are only used to explain the application, rather than to limit it. Based on the embodiments provided in this application, all other embodiments obtained by ordinary technicians in this field without creative work are within the protection scope of this application.
[0108] It should be noted that the user information (including but not limited to user device information, user personal information, etc.) and data (including but not limited to data used for analysis, stored data, displayed data, etc.) involved in this application are all information and data authorized by the user or fully authorized by all parties.
[0109] Obviously, the drawings are only some examples or embodiments of the present application. For ordinary technicians in the field, the present application can also be applied to other similar situations based on these drawings without creative work. In addition, it is understandable that although the work done in this development process may be complicated and lengthy, for ordinary technicians in the field, certain changes in design, manufacturing or production based on the technical content disclosed in this application are only conventional technical means and should not be regarded as insufficient content disclosed in this application.
[0110] The term "embodiment" in this application refers to a specific feature, structure or characteristic described in conjunction with the embodiment that can be included in at least one embodiment of the present application. The appearance of this phrase in various locations in the specification does not necessarily mean the same embodiment, nor does it mean that it is mutually exclusive with other embodiments and is independent or optional. It is clearly or implicitly understood by those of ordinary skill in the art that the embodiments described in this application can be combined with other embodiments without conflict.
[0111] The above-mentioned embodiments only express several implementation methods of the present application, and the descriptions thereof are relatively specific and detailed, but they cannot be understood as limiting the scope of patent protection. It should be pointed out that, for a person of ordinary skill in the art, several variations and improvements can be made without departing from the concept of the present application, and these all belong to the scope of protection of the present application. Therefore, the scope of protection of the present application shall be subject to the attached claims.
Claims
1. A video code stream encoding method, characterized in that: include: Get thermal imaging data stream in raw data format; The thermal imaging data stream is format-converted according to a preset lossless grayscale mapping relationship to obtain a target data stream in a color coding format; wherein the pixel grayscale value in the original data format and the color coding value in the color coding format are mapped one-to-one in the lossless grayscale mapping relationship; The target data stream, the lossless grayscale mapping relationship and the temperature measurement parameter information are encoded to obtain an infrared compressed code stream; wherein: The step of converting the thermal imaging data stream into a format according to a preset lossless grayscale mapping relationship to obtain a target data stream in a color coding format includes: Determine a conversion type of a target data stream to be converted; wherein the conversion type includes a black-hot image type, a white-hot image type, and a pseudo-color image type; When the conversion type of the target data stream is a black-hot image type or a white-hot image type, the lossless grayscale mapping relationship is: Different grayscale values in the original data format for the same grayscale value in the color coding format correspond to different chromaticity values in the color coding format; According to the determined lossless grayscale mapping relationship, the thermal imaging data stream is format converted to obtain a target data stream in a color coding format.
2. The video code stream encoding method according to claim 1, characterized in that: The method further comprises: When the conversion type of the target data stream is a pseudo-color image type, the lossless grayscale mapping relationship is: Different grayscale values in the original data format correspond to different color coding combination values in the color coding format.
3. The video code stream encoding method according to claim 1, characterized in that: The step of converting the thermal imaging data stream into a format according to a preset lossless grayscale mapping relationship to obtain a target data stream in a color coding format includes: Performing format conversion on the thermal imaging data stream according to a preset lossless grayscale mapping relationship to obtain an initial conversion data stream of a conversion type of a black-hot image type or a white-hot image type; The initial conversion data stream is converted into a target data stream whose conversion type is a pseudo color image type.
4. The video code stream encoding method according to any one of claims 1 to 3, characterized in that: The preset lossless grayscale mapping relationship includes: the smaller the grayscale difference of different pixels in the original data format is, the smaller the color coding value difference in the corresponding color coding format is.
5. The video code stream encoding method according to any one of claims 1 to 3, characterized in that: The preset lossless grayscale mapping relationship includes: a grayscale value interval with higher color sensitivity of the human eye in the original data format corresponds to more color coding values in the color coding format.
6. A video code stream decoding method, characterized in that: include: Get infrared compressed code stream; Decoding the infrared compressed code stream to obtain a target data stream in a color coding format, a lossless grayscale mapping relationship, and temperature measurement parameter information; According to the lossless grayscale mapping relationship, the target data stream is format-converted to obtain a thermal imaging data stream in the original data format; wherein the pixel grayscale value in the original data format and the color coding value in the color coding format are mapped one-to-one in the lossless grayscale mapping relationship; wherein, when the conversion type of the target data stream is a black-hot image type or a white-hot image type, the lossless grayscale mapping relationship is: Different grayscale values in the original data format for the same grayscale value in the color coding format correspond to different chromaticity values in the color coding format; The temperature detection information of the thermal imaging data stream is determined according to the thermal imaging data stream and the temperature measurement parameter information.
7. A video code stream encoding device, characterized in that: include: Thermal imaging acquisition module, color coding conversion module and coding module; wherein: The thermal imaging acquisition module is used to acquire the thermal imaging data stream in raw data format; The color coding conversion module is used to convert the format of the thermal imaging data stream according to a preset lossless grayscale mapping relationship to obtain a target data stream in a color coding format; wherein the pixel grayscale value in the original data format and the color coding value in the color coding format in the lossless grayscale mapping relationship are mapped one-to-one; The encoding module is used to perform code stream encoding on the target data stream, the lossless grayscale mapping relationship and the temperature measurement parameter information to obtain an infrared compressed code stream; wherein: The step of converting the thermal imaging data stream into a format according to a preset lossless grayscale mapping relationship to obtain a target data stream in a color coding format includes: Determine a conversion type of a target data stream to be converted; wherein the conversion type includes a black-hot image type, a white-hot image type, and a pseudo-color image type; When the conversion type of the target data stream is a black-hot image type or a white-hot image type, the lossless grayscale mapping relationship is: Different grayscale values in the original data format for the same grayscale value in the color coding format correspond to different chromaticity values in the color coding format; According to the determined lossless grayscale mapping relationship, the thermal imaging data stream is format converted to obtain a target data stream in a color coding format.
8. A video code stream decoding device, characterized in that: include: Compression acquisition module, decoding module, grayscale conversion module and temperature measurement module; wherein: The compression acquisition module is used to acquire infrared compression code stream; The decoding module is used to decode the infrared compressed code stream to obtain the target data stream in the color coding format, the lossless grayscale mapping relationship and the temperature measurement parameter information; The grayscale conversion module is used to perform format conversion on the target data stream according to the lossless grayscale mapping relationship to obtain a thermal imaging data stream in the original data format; wherein the pixel grayscale value in the original data format and the color coding value in the color coding format are mapped one-to-one in the lossless grayscale mapping relationship; wherein, when the conversion type of the target data stream is a black-hot image type or a white-hot image type, the lossless grayscale mapping relationship is: Different grayscale values in the original data format for the same grayscale value in the color coding format correspond to different chromaticity values in the color coding format; The temperature measurement module is used to determine the temperature detection information of the thermal imaging data stream according to the thermal imaging data stream and the temperature measurement parameter information.
