A method for quickly transmitting video images for a recorder, a recorder and a system

By combining the frequency information of gray value and run length through Hilbert curve and Huffman coding table, the problem of low efficiency in converting the image run length coding result into binary is solved, and the video image transmission speed and compression efficiency are improved.

CN118555410BActive Publication Date: 2024-10-11SHENZHEN BAFANGTONGDA TECH CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202411009235.7
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2024-07-26
Publication Date
2024-10-11
Estimated Expiration
2044-07-26

AI Technical Summary

Technical Problem

It is difficult for the existing technology to effectively convert the run-length encoding result of the image into a binary form, resulting in a slow video image transmission speed.

Method used

Arrange the pixel gray values ​​of the video frame into a sequence through the Hilbert curve, perform run length encoding, and use the Huffman coding table to encode the encoding results. Combine the frequency information of the gray value and run length to construct the encoding object and shorten the encoding results. The length of the binary sequence.

Benefits of technology

It improves the transmission speed of video images, improves the compression efficiency of Huffman coding, ensures that grayscale values ​​and run lengths with high frequencies are allocated short codes, and small frequencies are allocated long codes, optimizing the transmission speed.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN118555410B_ABST
    Figure CN118555410B_ABST
Patent Text Reader

Abstract

The present invention relates to the field of image transmission technology, and in particular to a method for fast transmission of video images for a recorder, a recorder and a system, wherein the method comprises: arranging the grayscale values ​​of all pixel points of an I frame in a video into a grayscale value sequence through a Hilbert curve, sorting the grayscale values ​​and the run lengths according to the first frequency of each grayscale value and the second frequency of each run length in the run-length encoding result of the grayscale value sequence, taking the sorted kth grayscale value and the kth run length as the kth encoding object, taking the first frequency of the sorted kth grayscale value and the sum of the second frequency of the kth run length as the third frequency of the kth encoding object, constructing a Huffman coding table according to the third frequencies of all encoding objects, encoding the run-length encoding result according to the Huffman coding table, taking the obtained encoding result as the encoding result of the I frame, and transmitting. The present invention improves the transmission speed of the video collected by the recorder.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the field of image transmission technology, and more specifically, to a method for quickly transmitting video images for a recorder, a recorder and a system. Background Art

[0002] Dash Cam is a device installed inside a vehicle to record video and audio during driving. It plays an important role in vehicle safety, management and evidence protection. With the advancement of technology and the growth of market demand, its functions and application scenarios are constantly expanding and improving.

[0003] The video files collected by the recorder are usually very large. If the uncompressed video is directly transmitted, a lot of bandwidth and time will be consumed. The compressed video is less affected by jitter, packet loss and other problems during network transmission, and is easier to transmit stably on the network. Since the images in the video have local similarities, the run length of the grayscale value in the image is very long, so the image can be compressed through run-length encoding.

[0004] Considering that the video is ultimately transmitted in binary form, the run-length encoding result of the image needs to be further converted into binary form before transmission.

[0005] In summary, there is an urgent need for a method for converting the run-length encoding result of an image into a binary form to increase the transmission speed of the video image. Summary of the invention

[0006] In order to solve the above-mentioned technical problem of urgently needing a method for converting the run-length encoding result of an image into a binary form to increase the transmission speed of the video image, the present invention provides solutions in the following aspects.

[0007] In a first aspect, the present invention provides a method for fast transmission of video images for a recorder, comprising: collecting video through a recorder; arranging the grayscale values ​​of all pixel points of an I frame in the video into a grayscale value sequence through a Hilbert curve; performing run-length coding on the grayscale value sequence to obtain a run-length coding result; counting the first frequency of each grayscale value and the second frequency of each run length in the run-length coding result; sorting all grayscale values ​​in order from large to small according to the first frequency; sorting all run lengths in order from large to small according to the second frequency; taking the sorted kth grayscale value and the sorted kth run length as the kth coding object, and taking the sum of the first frequency of the sorted kth grayscale value and the second frequency of the kth run length as the third frequency of the kth coding object; constructing a Huffman coding table according to the third frequencies of all coding objects, encoding the run-length coding result according to the Huffman coding table, taking the obtained coding result as the coding result of the I frame, and transmitting it.

[0008] Preferably, the order of the Hilbert curve is equal to a preset first value.

[0009] Preferably, the order of the Hilbert curve is equal to the optimal order.

[0010] Preferably, the method for obtaining the optimal order comprises: dividing an I frame into a plurality of superpixel blocks by a superpixel segmentation algorithm; wherein the expected size of the superpixel block in the superpixel segmentation algorithm is set to S×S, where S represents the side length of the expected size, and , c is an integer in the range of [1, Z], and Z represents the preset second value; for different expected sizes, the preference of the expected size is calculated according to the difference between the shapes of all superpixel blocks corresponding to the expected size and the expected size, and the similarity of the grayscale values ​​of the pixels in the superpixel blocks, and the preference is negatively correlated with the difference and positively correlated with the similarity; the expected size with the highest preference is recorded as W×W, W represents the side length of the expected size with the highest preference, and as the optimal order.

[0011] Preferably, the method for calculating the preference of the desired size includes: respectively obtaining the maximum inscribed rectangle and the minimum circumscribed rectangle of each superpixel block corresponding to the desired size; calculating the shape difference degree corresponding to the desired size according to the area difference between the maximum inscribed rectangle and the minimum circumscribed rectangle of all superpixel blocks corresponding to the desired size, the shape difference between the maximum inscribed rectangle and the desired size, and the shape difference between the minimum circumscribed rectangle and the desired size; calculating the grayscale similarity degree corresponding to the desired size according to the similarity of the grayscale values ​​of all pixels in the superpixel block; then the preference of the desired size satisfies the expression: ; In the formula, Y represents the preference of the expected size, Q represents the grayscale similarity corresponding to the expected size, and X represents the shape difference corresponding to the expected size. Represents an exponential function with a natural constant as its base.

[0012] Preferably, the shape difference degree corresponding to the expected size satisfies the expression:

[0013] ; Where L represents the number of all superpixel blocks corresponding to the expected size, , They represent the areas of the maximum inscribed rectangle and the minimum circumscribed rectangle of the t-th superpixel block corresponding to the expected size, respectively. , They represent the lengths of the two sides of the maximum inscribed rectangle of the t-th superpixel block corresponding to the expected size, , They respectively represent the lengths of the two sides of the minimum circumscribed rectangle of the tth superpixel block obtained corresponding to the expected size.

[0014] Preferably, the grayscale similarity corresponding to the expected size satisfies the expression: ; Where L represents the number of all superpixel blocks corresponding to the expected size, It represents the information entropy of the grayscale values ​​of all pixels in the t-th superpixel block corresponding to the expected size.

[0015] Preferably, encoding the run-length coding result according to the Huffman coding table comprises: the Huffman coding table includes codes corresponding to each coding object; and encoding the grayscale value and run length belonging to the kth coding object in the run-length coding result according to the code corresponding to the kth coding object.

[0016] In a second aspect, the present invention provides a video image fast transmission recorder for a recorder, which adopts the following technical solution:

[0017] A video image fast transmission recorder for a recorder comprises: a first module for collecting video through a recorder; arranging the grayscale values ​​of all pixel points of an I frame in a video into a grayscale value sequence through a Hilbert curve; a second module for performing run-length coding on the grayscale value sequence to obtain a run-length coding result; a third module for counting the first frequency of each grayscale value and the second frequency of each run length in the run-length coding result; sorting all grayscale values ​​in the order of first frequency from large to small; sorting all run lengths in the order of second frequency from large to small; a fourth module for taking the sorted kth grayscale value and the sorted kth run length as the kth coding object, and taking the sum of the first frequency of the sorted kth grayscale value and the second frequency of the kth run length as the third frequency of the kth coding object; and a fifth module for constructing a Huffman coding table according to the third frequencies of all coding objects, encoding the run-length coding result according to the Huffman coding table, taking the obtained coding result as the coding result of the I frame, and transmitting it.

[0018] In a third aspect, the present invention provides a video image rapid transmission system for a recorder, which adopts the following technical solution:

[0019] A video image fast transmission system for a recorder includes: a processor and a memory, wherein the memory stores computer program instructions, and when the computer program instructions are executed by the processor, the above-mentioned video image fast transmission method for a recorder is implemented.

[0020] By adopting the above technical solution, the above-mentioned recorder uses a video image rapid transmission method to generate a computer program and store it in a memory to be loaded and executed by a processor, thereby making a terminal device based on the memory and the processor for easy use.

[0021] The beneficial effects of the present invention are:

[0022] The present invention combines the gray value and the run length into a coding object, so that the number of types of coding objects in the process Huffman coding table is reduced, thereby shortening the length of the coding result obtained when the run-length coding result is converted into a binary form through Huffman coding, that is, the length of the binary sequence, thereby improving the transmission speed of the video image;

[0023] Furthermore, when combining grayscale values ​​and run lengths into coding objects, the present invention combines grayscale values ​​and run lengths with the same sequence number after being sorted by frequency into one coding object, thereby ensuring that the length of the coding allocated to grayscale values ​​and run lengths with large frequencies is short, and the length of the coding allocated to grayscale values ​​and run lengths with small frequencies is long, thereby ensuring the compression efficiency of Huffman coding;

[0024] Furthermore, the present invention adaptively obtains the optimal order of the Hilbert curve, and arranges the grayscale values ​​of all pixels of the I frame into a grayscale value sequence according to the Hilbert curve corresponding to the optimal order, making full use of the local similarity of the I frame so that locally continuous identical grayscale values ​​in the I frame are connected together, thereby generating a grayscale value sequence with a long run, so that the run-length encoding result of the obtained grayscale value sequence is shorter, thereby improving the compression efficiency of the grayscale value sequence of the I frame through run-length encoding, and further improving the transmission speed of the video collected by the recorder. BRIEF DESCRIPTION OF THE DRAWINGS

[0025] By reading the following detailed description with reference to the accompanying drawings, the above and other objects, features and advantages of the exemplary embodiments of the present invention will become readily understood. In the accompanying drawings, several embodiments of the present invention are shown in an exemplary and non-limiting manner, and the same or corresponding reference numerals represent the same or corresponding parts, wherein:

[0026] Figure 1 is a flow chart schematically illustrating a method for quickly transmitting video images for a recorder in the present invention;

[0027] Figure 2 Schematically illustrates the paths of a first-order Hilbert curve, a second-order Hilbert curve, and a third-order Hilbert curve;

[0028] Figure 3 A system block diagram of a video image rapid transmission recorder for a recorder in the present invention is schematically shown. DETAILED DESCRIPTION

[0029] The following will be combined with the drawings in the embodiments of the present invention to clearly and completely describe the technical solutions in the embodiments of the present invention. Obviously, the described embodiments are part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by those skilled in the art without creative work are within the scope of protection of the present invention.

[0030] The specific embodiments of the present invention are described in detail below with reference to the accompanying drawings.

[0031] The embodiment of the present invention discloses a method for quickly transmitting video images for a recorder, referring to Figure 1 , including steps S1 to S3:

[0032] S1. Determine an I frame in a video captured by a recorder.

[0033] It should be noted that a dash cam is a device installed inside a vehicle to record video and audio during driving. The dash cam plays an important role in vehicle safety, management, and evidence protection. With the advancement of technology and the growth of market demand, its functions and application scenarios are constantly expanding and improving.

[0034] Specifically, I frames (Intra Picture, intra-frame coding frame), P frames (Predictive Frame, forward predictive coding frame) and B frames (Bidirectional Frame, bidirectional prediction frame) in the video captured by the recorder are determined.

[0035] Furthermore, I frames, P frames and B frames are the basic units accessed by video encoders and decoders, and are used to represent the transmitted video images; among them, I frame is a complete image, while P frames and B frames record the changes relative to I frames. Therefore, without I frames, P frames and B frames cannot be decoded; P frames and B frames use inter-frame coding, that is, they simultaneously utilize spatial and temporal correlations; and I frames are reference frames for P frames and B frames, and their quality directly affects the quality of P frames and B frames in the same group. Therefore, I frames need to be losslessly compressed.

[0036] S2. The gray values ​​of all pixels of the I frame are arranged into a gray value sequence through the Hilbert curve, and the gray value sequence is run-length encoded to obtain a run-length encoding result.

[0037] It should be noted that in the field of image compression, run-length encoding is an effective compression technology. By recording the run length of consecutive identical grayscale values, the amount of data can be significantly reduced without losing image quality. The longer the run length, the more consecutive identical grayscale values ​​there are, so the compression effect is more significant. An image can be regarded as a two-dimensional discrete signal. By scanning the two-dimensional image using a space filling curve, the two-dimensional discrete signal can be converted into a one-dimensional discrete signal, that is, a one-dimensional sequence, and the image can be further processed. Different scanning methods can be used to convert the grayscale values ​​of all pixels in the I frame into a grayscale value sequence.

[0038] It should be further explained that zigzag scanning and Hilbert curve are common methods. The zigzag scanning method is to traverse all the pixels in the image in a zigzag order, starting from the upper left corner, and scanning row by row or column by column. This method has certain advantages for some images with regular distribution, but when facing images with complex grayscale value changes, it is impossible to effectively generate a long-run grayscale value sequence. In contrast, the Hilbert curve, as a space filling curve, scans the local part of the image. Since the image has local similarity, that is, there are many pixels with the same local grayscale value in the image, the Hilbert curve makes full use of the local similarity of the image, so that the local continuous grayscale values ​​in the image are connected together, thereby generating a long-run grayscale value sequence. Therefore, the use of the Hilbert curve can effectively increase the run length, thereby improving the compression effect, and the Hilbert curve algorithm is simple and easy to implement; therefore, this embodiment arranges the grayscale values ​​of all pixels of the I frame into a grayscale value sequence through the Hilbert curve.

[0039] In one embodiment, the order of the Hilbert curve is equal to a preset first value.

[0040] Among them, the specific value of the preset first value can be set according to the actual application scenario and requirements. The preset first value is required to be a positive integer. The present invention sets the preset first value to 3.

[0041] It should be noted that different images may have different complexities and different distribution characteristics of the grayscale values ​​of pixels. The larger the order of the Hilbert curve, the larger the grayscale values ​​of pixels in the local area of ​​the image are connected together. Therefore, the optimal order of the Hilbert curve determined according to the similarity of the grayscale values ​​of local pixels in the image can generate a long-run grayscale value sequence, thereby improving the compression effect.

[0042] See also Figure 2 , which shows the paths of the first-order Hilbert curve, the second-order Hilbert curve and the third-order Hilbert curve, where the numbers represent the order of the pixel points at that position.

[0043] In another embodiment, the order of the Hilbert curve is equal to the optimal order; and the method for obtaining the optimal order includes:

[0044] 1. Divide the I frame into multiple superpixel blocks through superpixel segmentation.

[0045] The expected size of the superpixel block in the superpixel segmentation algorithm is set to S×S, where S represents the side length of the expected size, and , c takes an integer in the range of [1, Z], and Z represents the preset second value.

[0046] It should be noted that the superpixel segmentation algorithm utilizes the similarity of the grayscale values ​​of local pixels in the image to divide it into multiple superpixel blocks; therefore, the characteristics of the multiple superpixel blocks obtained by dividing the I frame can reflect the complexity of the image and the distribution characteristics of the grayscale values ​​of the pixels, and then determine the optimal expected size.

[0047] 2. For different expected sizes, the preference of the expected size is calculated based on the difference between the shapes of all superpixel blocks corresponding to the expected size and the expected size, and the similarity of the grayscale values ​​of the pixels in the superpixel blocks. The preference is negatively correlated with the difference and positively correlated with the similarity.

[0048] Then the preferred degree of the expected size satisfies the expression:

[0049]

[0050] In the formula, Y represents the preference of the expected size, Q represents the grayscale similarity corresponding to the expected size, and X represents the shape difference corresponding to the expected size. Represents an exponential function with a natural constant as its base.

[0051] It should be noted that the greater the grayscale similarity Q corresponding to the expected size, the more pixels with the same grayscale value in the superpixel blocks divided according to the expected size, and when the Hilbert curve is set according to the order obtained by the expected size and the I frame is scanned, the scanning is performed according to the local features in the I frame. The greater the run length of the grayscale value sequence composed of the grayscale value sequence of all the pixels of the I frame, the better the compression effect, and the greater the preference for the expected size; the smaller the shape difference X corresponding to the expected size, the greater the run length of the grayscale value sequence composed of the grayscale value sequence of all the pixels of the I frame when the Hilbert curve is used to scan the I frame according to the order obtained by the expected size, the more the scanning is performed according to the local features in the I frame, and the better the compression effect, and the greater the preference for the expected size.

[0052] The method for calculating the preference of the desired size includes: respectively obtaining the maximum inscribed rectangle and the minimum circumscribed rectangle of each superpixel block corresponding to the desired size; calculating the shape difference degree corresponding to the desired size according to the area difference of the maximum inscribed rectangle and the minimum circumscribed rectangle of all superpixel blocks corresponding to the desired size, the shape difference between the maximum inscribed rectangle and the desired size, and the shape difference between the minimum circumscribed rectangle and the desired size; and calculating the grayscale similarity degree corresponding to the desired size according to the similarity of the grayscale values ​​of all pixels in the superpixel block.

[0053] Among them, the shape difference degree corresponding to the expected size satisfies the expression:

[0054] ;

[0055] Where X represents the degree of shape difference corresponding to the expected size, L represents the number of all superpixel blocks obtained corresponding to the expected size, , They represent the areas of the maximum inscribed rectangle and the minimum circumscribed rectangle of the t-th superpixel block corresponding to the expected size, respectively. , They represent the lengths of the two sides of the maximum inscribed rectangle of the t-th superpixel block corresponding to the expected size, , They respectively represent the lengths of the two sides of the minimum circumscribed rectangle of the tth superpixel block obtained corresponding to the expected size.

[0056] It should be noted that It is the ratio of the area of ​​the maximum inscribed rectangle and the minimum circumscribed rectangle of the t-th superpixel block corresponding to the expected size. The closer the value is to 1, the more regular the shape of the superpixel block is. Therefore, The larger it is, the greater the degree of shape difference corresponding to the expected size; Represents the difference between the shape of the maximum inscribed rectangle of the t-th superpixel block obtained corresponding to the expected size and the expected size. The larger the value, the greater the degree of difference in the shape corresponding to the expected size. It represents the difference between the shape of the minimum bounding rectangle of the tth superpixel block obtained corresponding to the expected size and the expected size. The larger the value, the greater the degree of difference in the shape corresponding to the expected size.

[0057] The grayscale similarity corresponding to the expected size satisfies the expression:

[0058]

[0059] In the formula, Q represents the grayscale similarity corresponding to the expected size, L represents the number of all superpixel blocks obtained corresponding to the expected size, represents the information entropy of the grayscale values ​​of all pixels in the t-th superpixel block corresponding to the expected size, Represents an exponential function with a natural constant as its base.

[0060] It should be noted that information entropy The larger the value is, the more chaotic the distribution of the grayscale values ​​of all pixels in the superpixel block is, and the smaller the grayscale similarity corresponding to the expected size is.

[0061] 3. The expected size with the highest preference is recorded as W×W, where W represents the side length of the expected size with the highest preference. as the optimal order.

[0062] It should be noted that the optimal order of the Hilbert curve is adaptively obtained, and the grayscale values ​​of all pixels of the I frame are arranged to form a grayscale value sequence according to the Hilbert curve corresponding to the optimal order, so that the local similarity of the I frame is fully utilized, so that the locally continuous and identical grayscale values ​​in the I frame are connected together, thereby generating a long-run grayscale value sequence, so that the run-length encoding result of the obtained grayscale value sequence is shorter, thereby improving the compression efficiency of the grayscale value sequence of the I frame through run-length encoding, and then improving the transmission speed of the video collected by the recorder.

[0063] S3. Encode the run-length encoding result according to the Huffman coding table, use the obtained encoding result as the encoding result of the I frame, and transmit it.

[0064] It should be noted that Huffman coding is a conventional method for converting binary form. The compression efficiency of Huffman coding depends on the number of types of coding objects. When compressing the coding objects through Huffman coding: the more types of coding objects there are, the longer the coding length is required to distinguish these different coding objects. The longer the coding length is, the larger the amount of data that needs to be transmitted, and therefore the slower the transmission speed; the fewer types of coding objects there are, the shorter the coding length is required to distinguish these different coding objects. The shorter the coding length is, the smaller the amount of data that needs to be transmitted, and therefore the faster the transmission speed.

[0065] It should be further explained that when the run-length coding result is directly converted into binary form through Huffman coding, the coding objects include all grayscale values ​​and all run lengths in the run-length coding result, and the number of types of coding objects is large. Therefore, when the run-length coding result is converted into binary form through Huffman coding, the length of the obtained coding result, i.e., the binary sequence, is longer. At this time, the transmission speed of the video image is lower.

[0066] It should be further explained that the present embodiment considers merging each grayscale value with each run length as a new coding object. For example, the grayscale value 200 and the run length 7 are taken as a new coding object, and the sum of the frequency of the grayscale value 200 and the frequency of the run length 7 are taken as the frequency of a new coding object. When Huffman coding is subsequently performed, a Huffman coding table is constructed according to the frequency of the new coding object, and then the grayscale value 200 and the run length 7 in the run coding result are encoded according to the coding of the new coding object. By reducing the number of types of coding objects, the length of the binary sequence, that is, the coding result obtained when the run coding result is converted into binary form through Huffman coding, is shortened, thereby improving the transmission speed of the video image.

[0067] Specifically, the first frequency of each grayscale value and the second frequency of each run length in the run-length encoding result are counted; all grayscale values ​​are sorted in descending order according to the first frequency; all run lengths are sorted in descending order according to the second frequency; the sorted kth grayscale value and the sorted kth run length are used as the kth encoding object, and the sum of the first frequency of the sorted kth grayscale value and the second frequency of the kth run length is used as the third frequency of the kth encoding object.

[0068] It should be noted that Huffman coding is encoded according to the frequency distribution of the coding object. The coding object with a larger frequency is assigned a shorter code length, and the coding object with a smaller frequency is assigned a longer code length, thereby achieving compression. In order to ensure the compression efficiency of Huffman coding, when combining grayscale values ​​and run lengths into coding objects, grayscale values ​​and run lengths with the same sequence number after sorting by frequency are combined into one coding object, thereby ensuring that the grayscale values ​​and run lengths with a large frequency are assigned a short code length, and the grayscale values ​​and run lengths with a small frequency are assigned a long code length, thereby ensuring the compression efficiency of Huffman coding.

[0069] Further, a Huffman coding table is constructed according to the third frequency of all coding objects, wherein the Huffman coding table includes the codes corresponding to each coding object; the run-length coding result is encoded according to the Huffman coding table, including: encoding the grayscale value and the run length belonging to the k-th coding object in the run-length coding result according to the code corresponding to the k-th coding object; and the Huffman coding result of the obtained run-length coding result is used as the coding result of the I frame and transmitted.

[0070] It should be noted that the present invention combines grayscale values ​​and run-lengths into coding objects, thereby reducing the number of types of coding objects in the process Huffman coding table, thereby shortening the length of the coding result, i.e., the binary sequence, obtained when the run-length coding result is converted into binary form through Huffman coding, thereby improving the transmission speed of the video image.

[0071] The embodiment of the present invention also discloses a video image fast transmission recorder for a recorder, referring to Figure 3 , including the first to fifth modules:

[0072] The first module is used to collect video through a recorder; the grayscale values ​​of all pixels in the I frame of the video are arranged into a grayscale value sequence through the Hilbert curve;

[0073] The second module is used to perform run-length coding on the gray value sequence to obtain a run-length coding result;

[0074] The third module is used to count the first frequency of each gray value and the second frequency of each run length in the run-length encoding result; sort all gray values ​​in the order of the first frequency from large to small; and sort all run lengths in the order of the second frequency from large to small;

[0075] The fourth module is used to use the sorted k-th gray value and the sorted k-th run length as the k-th encoding object, and use the sum of the first frequency of the sorted k-th gray value and the second frequency of the k-th run length as the third frequency of the k-th encoding object;

[0076] The fifth module is used to construct a Huffman coding table according to the third frequency of all coding objects, encode the run-length coding result according to the Huffman coding table, use the obtained coding result as the coding result of the I frame, and transmit it.

[0077] The embodiment of the present invention further discloses a video image rapid transmission system for a recorder, including a processor and a memory, wherein the memory stores computer program instructions, and when the computer program instructions are executed by the processor, a video image rapid transmission method for a recorder according to the present invention is implemented.

[0078] The above system also includes other components well known to those skilled in the art, such as a communication bus and a communication interface, and their configuration and functions are known in the art, so they will not be described in detail here.

[0079] In the description of this specification, "plurality" or "several" means at least two, such as two, three or more, etc., unless otherwise clearly and specifically defined.

[0080] Although this specification has shown and described a number of embodiments of the present invention, it will be apparent to those skilled in the art that such embodiments are provided by way of example only. Those skilled in the art will conceive of many modifications, changes and alternatives without departing from the ideas and spirit of the present invention. It should be understood that in the practice of the present invention, alternatives to the embodiments of the present invention described herein may be employed.

Claims

1. A method for quickly transmitting video images for a recorder, characterized in that: include: Collect video through a recorder; The grayscale values ​​of all pixels in the I frame of the video are arranged into a grayscale value sequence using the Hilbert curve; The order of the Hilbert curve is equal to the optimal order; The method for obtaining the optimal order includes: dividing an I frame into a plurality of superpixel blocks by a superpixel segmentation algorithm; wherein the expected size of the superpixel block in the superpixel segmentation algorithm is set to S×S, where S represents the side length of the expected size, and , c takes an integer in the range of [1, Z], and Z represents a preset second value; for different expected sizes, the preference of the expected size is calculated based on the difference between the shapes of all superpixel blocks corresponding to the expected size and the expected size, as well as the similarity of the grayscale values ​​of the pixels in the superpixel blocks. The preference is negatively correlated with the difference and positively correlated with the similarity. The expected size with the highest preference is recorded as W×W, where W represents the side length of the expected size with the highest preference. As the optimal order; Perform run-length encoding on the gray value sequence to obtain a run-length encoding result; Counting the first frequency of each gray value and the second frequency of each run length in the run-length encoding result; sorting all gray values ​​in descending order of the first frequency; and sorting all run lengths in descending order of the second frequency; The kth gray value and the kth run length after sorting are used as the kth encoding object, and the sum of the first frequency of the kth gray value and the second frequency of the kth run length after sorting is used as the third frequency of the kth encoding object; A Huffman coding table is constructed according to the third frequencies of all coding objects, the run-length coding result is encoded according to the Huffman coding table, and the obtained coding result is used as the coding result of the I frame and transmitted.

2. The method for quickly transmitting video images for a recorder according to claim 1, wherein: The method for calculating the preference of the desired size includes: Obtain the maximum inscribed rectangle and the minimum circumscribed rectangle of each superpixel block corresponding to the desired size respectively; Calculate the shape difference degree corresponding to the expected size based on the area difference between the maximum inscribed rectangle and the minimum circumscribed rectangle of all superpixel blocks obtained corresponding to the expected size, the shape difference between the maximum inscribed rectangle and the expected size, and the shape difference between the minimum circumscribed rectangle and the expected size; According to the similarity of the grayscale values ​​of all pixels in the superpixel block, the grayscale similarity corresponding to the expected size is calculated; Then the preference of the expected size satisfies the expression: ; In the formula, Y represents the preference of the desired size, Q represents the grayscale similarity corresponding to the desired size, and X represents the shape difference corresponding to the desired size. Represents an exponential function with a natural constant as its base.

3. The method for quickly transmitting video images for a recorder according to claim 2, wherein: The shape difference degree corresponding to the expected size satisfies the expression: ; Where L represents the number of all superpixel blocks obtained corresponding to the desired size, 、 They represent the areas of the maximum inscribed rectangle and the minimum circumscribed rectangle of the t-th superpixel block corresponding to the expected size, 、 They represent the lengths of the two sides of the maximum inscribed rectangle of the t-th superpixel block corresponding to the expected size, 、 They represent the lengths of the two sides of the minimum bounding rectangle of the t-th superpixel block corresponding to the expected size.

4. The method for quickly transmitting video images for a recorder according to claim 2, wherein: The grayscale similarity corresponding to the expected size satisfies the expression: ; Where L represents the number of all superpixel blocks corresponding to the desired size, It represents the information entropy of the grayscale values ​​of all pixels in the t-th superpixel block corresponding to the expected size.

5. The method for rapid transmission of video images for a recorder according to claim 1, characterized in that: The step of encoding the run-length encoding result according to the Huffman coding table includes: The Huffman coding table includes the codes corresponding to each coding object; According to the code corresponding to the k-th coding object, the grayscale value and run length belonging to the k-th coding object in the run-length coding result are encoded.

6. A video image fast transmission recorder for a recorder, characterized in that: include: The first module is used to collect video through a recorder; The grayscale values ​​of all pixels in the I frame of the video are arranged into a grayscale value sequence using the Hilbert curve; The order of the Hilbert curve is equal to the optimal order; the method for obtaining the optimal order includes: dividing the I frame into multiple superpixel blocks by superpixel segmentation algorithm; wherein the expected size of the superpixel block in the superpixel segmentation algorithm is set to S×S, where S represents the side length of the expected size, and , c takes an integer in the range of [1, Z], and Z represents a preset second value; for different expected sizes, the preference of the expected size is calculated based on the difference between the shapes of all superpixel blocks corresponding to the expected size and the expected size, as well as the similarity of the grayscale values ​​of the pixels in the superpixel blocks. The preference is negatively correlated with the difference and positively correlated with the similarity. The expected size with the highest preference is recorded as W×W, where W represents the side length of the expected size with the highest preference. As the optimal order; The second module is used to perform run-length encoding on the gray value sequence to obtain a run-length encoding result; The third module is used to count the first frequency of each gray value and the second frequency of each run length in the run-length encoding result; sort all gray values ​​in descending order of the first frequency; and sort all run lengths in descending order of the second frequency; a fourth module, configured to use the sorted kth grayscale value and the sorted kth run length as the kth encoding object, and use the sum of the first frequency of the sorted kth grayscale value and the second frequency of the kth run length as the third frequency of the kth encoding object; The fifth module is used to construct a Huffman coding table according to the third frequency of all coding objects, encode the run-length coding result according to the Huffman coding table, use the obtained coding result as the coding result of the I frame, and transmit it.

7. A video image rapid transmission system for a recorder, characterized in that: include: A processor and a memory, wherein the memory stores computer program instructions, and when the computer program instructions are executed by the processor, a method for quickly transmitting video images for a recorder according to any one of claims 1 to 5 is implemented.