Camera video code stream adaptive adjustment system and method based on artificial intelligence
Through the adaptive adjustment method of camera video stream based on artificial intelligence, Huffman coding and transmission quality assessment are used to solve the problem that the real-time demand for video stream transmission in the existing technology is difficult to meet, and achieve high efficiency and high efficiency of video stream. Accurate transmission.
Patent Information
- Application Number
- CN202410626590.2
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2024-05-20
- Publication Date
- 2024-09-24
- Estimated Expiration
- 2044-05-20
AI Technical Summary
Existing video code stream TCP transmission has the problem of being difficult to meet real-time requirements in streaming media transmission scenarios. It mainly adjusts the code stream by removing redundant data, which has limitations.
Adopt an artificial intelligence-based camera video stream adaptive adjustment method, collect image data in real time for preprocessing and transmission quality assessment, and use Huffman coding for image data compression to ensure the real-time and adaptability of the video stream.
It improves the real-time and adaptability of video stream transmission and ensures the efficiency and accuracy of video streaming media in network transmission.
Smart Images

Figure 00000000_0000
Abstract
Description
Technical Field
[0001] The present invention relates to the field of image communication technology, and in particular to an artificial intelligence-based camera video code stream adaptive adjustment system and method. Background Art
[0002] With the improvement of mobile Internet technology and the popularization of mobile terminal devices, the business and scale of streaming media have increased dramatically. Video streaming is the main component of network traffic, and the video bitstream of video streaming has higher real-time requirements for network transmission quality. However, the existing video bitstream TCP transmission has many problems in streaming media transmission scenarios.
[0003] The prior art, such as Chinese patent application CN115914714A, obtains the current redundant data length and the remaining length of the receiving end container according to the current received data length and the total length of the receiving end container, and then determines whether the current redundant data length is greater than the preset redundant length. If it is greater than the preset redundant length, the redundant data packets are cleared and a corresponding instruction is sent to the sending end according to the situation that the redundant data length is greater than the preset redundant length, so that the sending end adjusts the data code stream according to the corresponding instruction, and then sends the processed data to the receiving end. If it is less than the preset redundant length, the remaining length of the receiving end container and the current first data information are returned to the sending end. This method realizes the dynamic change of the data code stream by notifying the client through the margin of data storage. The data code stream is adjusted and changed only by removing redundancy, which has great limitations. Summary of the invention
[0004] 1. Technical issues to be resolved
[0005] In view of the shortcomings of the prior art, the present invention provides a camera video stream adaptive adjustment system and method based on artificial intelligence, which has the advantages of adaptability, high efficiency, and real-time, and solves the problem that the video stream of video streaming media has a higher real-time requirement for network transmission quality.
[0006] In order to solve the technical problem that the video code stream of the above-mentioned video streaming media has a higher real-time requirement for network transmission quality, the present invention provides the following technical solutions:
[0007] The present invention discloses a method for adaptively adjusting a video code stream of a camera based on artificial intelligence, which specifically comprises the following steps:
[0008] S1, collecting image data taken by a camera in real time, and preprocessing the collected image data taken by the camera to obtain preprocessed image data taken by the camera;
[0009] S2, using dynamic adaptive streaming media technology to evaluate the transmission quality of various transmission paths for the image data captured by the pre-processed camera, determine the priority of various transmission paths, and transmit them;
[0010] When the priority transmission fails or the path transmission quality does not meet the priority transmission requirement, the image data captured by the camera is compressed and transmitted through steps S3-S5;
[0011] S3, performing image data conversion on the preprocessed image data captured by the camera to obtain converted image data captured by the camera;
[0012] S4, using Huffman coding to establish a Huffman compression matrix for the converted image data captured by the camera, and compressing the image data by establishing the Huffman compression matrix to obtain compressed image data captured by the camera;
[0013] S5. Transmit the compressed image data taken by the camera and decompress the compressed image data taken by the camera obtained after the transmission based on the Huffman compression matrix obtained after the transmission.
[0014] The present invention collects image data taken by a camera in real time, pre-processes the collected image data taken by the camera, and evaluates the transmission quality of various transmission paths through dynamic adaptive streaming media technology to formulate the priority of various transmission paths to achieve adaptive adjustment of video code streams. When priority transmission fails or the path transmission quality does not meet the priority transmission requirement, the image data taken by the camera is compressed and transmitted through the following steps. The image data taken by the camera is converted into image data after the pre-processing and the image data is compressed through Huffman coding to achieve compressed transmission of the image data taken by the camera, thereby ensuring the real-time performance of the camera video code stream transmission and improving the adaptability of the camera video code stream transmission.
[0015] Preferably, the real-time collection of image data captured by a camera and preprocessing of the collected image data captured by the camera comprises the following steps:
[0016] S11, collecting the image data captured by the camera in real time, including each pixel in the image, and representing it in RGB format;
[0017] S12, performing image enhancement on the image data captured by the camera by using a histogram equalization algorithm to obtain the image data captured by the camera after image enhancement;
[0018] S13, summarizing the image data captured by the camera after image enhancement to obtain the image data captured by the camera after preprocessing.
[0019] Preferably, the step of performing image enhancement on the image data captured by the camera by using a histogram equalization algorithm to obtain the image data captured by the camera after image enhancement comprises the following steps:
[0020] S121, based on the gray value distribution in the image data captured by the camera collected in real time, the pixel probability distribution of the image captured by the camera is calculated, and the gray value is the value of the pixel point that satisfies the condition R=G=B;
[0021] The pixel probability distribution formula of the image captured by the camera is as follows:
[0022] ;
[0023] in, represents the pixel probability of the image captured by the camera, Represents the number of pixels with gray value i, and n is the total number of pixels;
[0024] S122, constructing an image cumulative distribution function according to the calculated pixel probability distribution of the image captured by the camera;
[0025] The formula for constructing the cumulative distribution function of the image is as follows:
[0026] ;
[0027] in, represents the number of pixels with gray value i, L represents the total number of gray values in the image, n represents the total number of pixels, Represents the gray value of the kth gray value after being mapped by the cumulative distribution function;
[0028] S123, performing image enhancement on the image data captured by the camera based on the constructed image cumulative distribution function;
[0029] Specifically, the grayscale value mapped by the cumulative distribution function is multiplied by L-1 through the transformation function and rounded off so that the grayscale of the equalized image is consistent with the original image before normalization;
[0030] According to the mapping relationship between the image cumulative distribution function and the transformation function, refer to the pixels in the original image and output the image after histogram equalization;
[0031] The output image after histogram equalization is set to be the image data captured by the camera after image enhancement.
[0032] The present invention performs image enhancement on image data taken by a camera through a histogram equalization algorithm, collects the gray value distribution in the image data taken by the camera in real time, calculates the pixel probability distribution of the image taken by the camera and processes it through a cumulative distribution function to realize preprocessing of the image data taken by the camera, thereby improving the accuracy of adaptive adjustment of the camera video code stream.
[0033] Preferably, the process of evaluating the transmission quality of various transmission paths by using dynamic adaptive streaming media technology to determine the priority of various transmission paths and transmit the pre-processed image data captured by the camera comprises the following steps:
[0034] S21. Evaluate the transmission quality of various transmission paths and set priorities for various transmission paths;
[0035] S22. Classify and transmit based on the priorities of the various transmission paths.
[0036] Preferably, the step of evaluating the transmission quality of various transmission paths and formulating the priority of various transmission paths comprises the following steps:
[0037] The evaluation indicators for the transmission quality of various transmission paths include: path bandwidth , round trip delay , and packet loss rate ;
[0038] The path transmission quality evaluation formula is as follows:
[0039] ;
[0040] in, represents the transmission quality evaluation value of path j, is the influence coefficient of bandwidth on path transmission quality, represents the bandwidth of path j, Represents the sum of bandwidths of multiple transmission paths, is the impact coefficient of packet loss rate on path transmission quality, represents the packet loss rate of path j, Represents the average value of packet loss rate of multiple transmission paths, is the impact coefficient of round-trip delay on path transmission quality, represents the round trip delay of path j, Represents the average round-trip delay of multiple transmission paths;
[0041] Based on the calculated path transmission quality evaluation values, various types of paths are sorted in descending order, and path transmission quality evaluation thresholds and priorities are set;
[0042] Prioritize transmission for transmission paths with a value greater than the path transmission quality evaluation threshold, and perform compressed transmission for transmission paths with a value less than or equal to the path transmission quality evaluation threshold.
[0043] The present invention evaluates the transmission quality of various transmission paths, formulates the priority of various transmission paths, and formulates various transmission modes of image data captured by the camera by calculating the path transmission quality evaluation value, thereby ensuring the real-time performance of the image data captured by the camera.
[0044] Preferably, the image data conversion of the pre-processed image data captured by the camera comprises the following steps:
[0045] The RGB value of each point in the image data captured by the real-time camera is converted into YVU to obtain the image data captured by the camera after the conversion;
[0046] The formula for converting RGB value to YVU is as follows:
[0047] ;
[0048] Among them, R represents the red intensity of the pixel value in the image data captured by the camera, G represents the green intensity of the pixel value in the image data captured by the camera, B represents the blue intensity of the pixel value in the image data captured by the camera, Y represents the brightness of the image data captured by the camera, U represents the difference between the red part of the pixel value RGB input signal and the RGB as a whole in the image data captured by the camera, and V represents the difference between the blue part of the pixel value RGB input signal and the RGB as a whole in the image data captured by the camera.
[0049] The present invention completes the preliminary compression of the image data taken by the camera by converting the RGB value of each point in the image data taken by the camera in real time into YVU, thereby improving the real-time performance of the image data taken by the camera.
[0050] Preferably, the converted image data captured by the camera is encoded using Huffman coding to establish a Huffman compression matrix, and the image data is compressed by establishing the Huffman compression matrix, which includes the following steps:
[0051] S41, converting the converted image data captured by the camera into grayscale image data;
[0052] The converted grayscale image data is as follows:
[0053] ;
[0054] S42, performing hierarchical statistics based on the grayscale values corresponding to each pixel of the converted grayscale image to obtain the grayscale level and the number of grayscale levels corresponding to each pixel, and generating a corresponding code based on the obtained grayscale level;
[0055] S43, based on the obtained number of gray levels, generate a corresponding number of arrays, make the generated arrays correspond to the gray levels one by one, and save the pixels of the same gray level in the same array;
[0056] S44, arranging the array in descending order based on the number of pixels in the array;
[0057] S45, compressing based on the array arrangement order and establishing a Huffman compression matrix;
[0058] S46, performing Huffman coding on each pixel of the converted grayscale image, storing the Huffman compression matrix, and outputting the Huffman compression matrix;
[0059] The output Huffman compression matrix is the image data captured by the camera after compression.
[0060] Preferably, generating the corresponding code based on the obtained gray level comprises the following steps:
[0061] Since the value range of the YUV format is 0-255, set the number of gray levels to 256, numbered 0-255;
[0062] Since 256 is 2 to the eighth power, the encoding of each gray level is set to 8 bits, and the encoding of each gray level is converted into 8-bit binary for storage.
[0063] Preferably, the compressing based on the array arrangement order and establishing the Huffman compression matrix comprises the following steps:
[0064] S451, generating nodes based on each stored array and constructing a node set, each array only generates one corresponding node, and the number of pixels in the array is the weight of the corresponding node;
[0065] S452, taking out the two nodes with the smallest weights from the node set, combining them, and generating a parent node, the weight of the parent node being the sum of the weights of the two nodes;
[0066] S453, adding the generated parent node back to the node set, and executing S352 repeatedly until there is only one node in the node set;
[0067] S454, taking the only remaining node as the root node, and constructing a Huffman tree based on the combination of nodes, setting the Huffman code of the root node of the Huffman tree to 0, the Huffman code of the left subtree of the root node to 00, and the Huffman code of the right subtree of the root node to 01, and performing iterative coding based on the left subtree and the right subtree, so as to obtain a separate Huffman code for each node;
[0068] S455: Establish a Huffman compression matrix based on the obtained Huffman coding sequence of each node.
[0069] The present invention converts the image data taken by the converted camera into grayscale image data, and performs hierarchical statistics based on the grayscale values corresponding to each pixel of the converted grayscale image, generates and saves the corresponding codes, and compresses the saved codes through Huffman coding to achieve compression of the image data taken by the camera, thereby improving the real-time transmission of the image data taken by the camera.
[0070] The present invention also discloses an artificial intelligence-based camera video code stream adaptive adjustment system, comprising a camera, a path transmission quality evaluation module, an image data preprocessing module, an image data conversion module and an image data compression module;
[0071] The camera is used to capture image data in real time and transmit the captured image data to the image data preprocessing module;
[0072] The image data preprocessing module is used to preprocess the received real-time captured image data;
[0073] The path transmission quality evaluation module is used to analyze and evaluate the quality of the transmission path that can be transmitted in real time;
[0074] The image data conversion module is used to convert the image data captured in real time and transmit the converted image data to the image data compression module;
[0075] The image data compression module is used to compress the received converted image data.
[0076] (III) Beneficial effects
[0077] Compared with the prior art, the present invention provides a camera video code stream adaptive adjustment system and method based on artificial intelligence, which has the following beneficial effects:
[0078] 1. The invention collects image data taken by the camera in real time, pre-processes the collected image data taken by the camera, and evaluates the transmission quality of various transmission paths through dynamic adaptive streaming media technology to formulate the priority of various transmission paths to achieve adaptive adjustment of video code streams. When the priority transmission fails or the path transmission quality does not meet the priority transmission requirements, the image data taken by the camera is compressed and transmitted through the following steps. The image data taken by the camera is compressed and transmitted by performing image data conversion on the pre-processed image data and performing image data compression through Huffman coding, thereby ensuring the real-time transmission of the camera video code stream and improving the adaptability of the camera video code stream transmission.
[0079] 2. The invention performs image enhancement on the image data taken by the camera through the histogram equalization algorithm, collects the gray value distribution in the image data taken by the camera in real time, calculates the pixel probability distribution of the image taken by the camera and processes it through the cumulative distribution function to realize the pre-processing of the image data taken by the camera, thereby improving the accuracy of the adaptive adjustment of the camera video code stream.
[0080] 3. The invention evaluates the transmission quality of various transmission paths, formulates the priority of various transmission paths, and formulates various transmission methods for the image data taken by the camera by calculating the path transmission quality evaluation value, thereby ensuring the real-time nature of the image data taken by the camera.
[0081] 4. The invention completes the preliminary compression of the image data taken by the camera by converting the RGB value of each point in the image data taken by the camera into YVU in real time, thereby improving the real-time performance of the image data taken by the camera.
[0082] 5. The invention converts the image data taken by the camera into grayscale image data, and performs hierarchical statistics based on the grayscale values corresponding to each pixel of the converted grayscale image, generates and saves the corresponding codes, and compresses the saved codes through Huffman coding, thereby improving the real-time transmission of the image data taken by the camera. BRIEF DESCRIPTION OF THE DRAWINGS
[0083] Figure 1 The present invention is a schematic diagram of the process structure of the artificial intelligence camera video code stream adaptive adjustment method. DETAILED DESCRIPTION
[0084] 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 only 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 ordinary technicians in this field without creative work are within the scope of protection of the present invention.
[0085] The present invention discloses a method for adaptively adjusting a video code stream of a camera based on artificial intelligence, which specifically comprises the following steps:
[0086] S1, collecting image data taken by a camera in real time, and preprocessing the collected image data taken by the camera to obtain preprocessed image data taken by the camera;
[0087] Collecting image data captured by a camera in real time and preprocessing the collected image data captured by the camera includes the following steps:
[0088] S11, collecting the image data captured by the camera in real time, including each pixel in the image, and representing it in RGB format;
[0089] S12, performing image enhancement on the image data captured by the camera by using a histogram equalization algorithm to obtain the image data captured by the camera after image enhancement;
[0090] Performing image enhancement on the image data captured by the camera by using a histogram equalization algorithm to obtain the image data captured by the camera after image enhancement includes the following steps:
[0091] S121, based on the gray value distribution in the image data captured by the camera collected in real time, the pixel probability distribution of the image captured by the camera is calculated, and the gray value is the value of the pixel point that satisfies the condition R=G=B;
[0092] The pixel probability distribution formula of the image captured by the camera is as follows:
[0093] ;
[0094] in, represents the pixel probability of the image captured by the camera, Represents the number of pixels with gray value i, and n is the total number of pixels;
[0095] S122, constructing an image cumulative distribution function according to the calculated pixel probability distribution of the image captured by the camera;
[0096] The formula for constructing the cumulative distribution function of the image is as follows:
[0097] ;
[0098] in, represents the number of pixels with gray value i, L represents the total number of gray values in the image, n represents the total number of pixels, Represents the gray value of the kth gray value after being mapped by the cumulative distribution function;
[0099] S123, performing image enhancement on the image data captured by the camera based on the constructed image cumulative distribution function;
[0100] Specifically, the grayscale value mapped by the cumulative distribution function is multiplied by L-1 through the transformation function and rounded off so that the grayscale of the equalized image is consistent with the original image before normalization;
[0101] The transformation function formula is as follows:
[0102] ;
[0103] in, Indicates about The transformation function of
[0104] According to the mapping relationship between the image cumulative distribution function and the transformation function, refer to the pixels in the original image and output the image after histogram equalization;
[0105] The output image after histogram equalization is set to be the image data captured by the camera after image enhancement;
[0106] S13, summarizing the image data captured by the camera after image enhancement to obtain the image data captured by the camera after preprocessing;
[0107] S2, using dynamic adaptive streaming media technology to evaluate the transmission quality of various transmission paths for the image data captured by the pre-processed camera, determine the priority of various transmission paths, and transmit them;
[0108] The transmission of image data captured by a real-time camera through dynamic adaptive streaming technology includes the following steps:
[0109] S21. Evaluate the transmission quality of various transmission paths and set priorities for various transmission paths;
[0110] The evaluation indicators for the transmission quality of various transmission paths include: path bandwidth , round trip delay , and packet loss rate ;
[0111] The path transmission quality evaluation formula is as follows:
[0112] ;
[0113] in, represents the transmission quality evaluation value of path j, is the influence coefficient of bandwidth on path transmission quality, represents the bandwidth of path j, Represents the sum of bandwidths of multiple transmission paths, is the impact coefficient of packet loss rate on path transmission quality, represents the packet loss rate of path j, Represents the average value of packet loss rate of multiple transmission paths, is the impact coefficient of round-trip delay on path transmission quality, represents the round trip delay of path j, Represents the average round-trip delay of multiple transmission paths;
[0114] Further, based on the calculated path transmission quality evaluation values, various types of paths are arranged in descending order, and path transmission quality evaluation thresholds and priorities are set;
[0115] Prioritize transmission for transmission paths with a value greater than the path transmission quality evaluation threshold, and perform compressed transmission for transmission paths with a value less than or equal to the path transmission quality evaluation threshold;
[0116] S22, performing classified transmission based on the priorities of various transmission paths;
[0117] When the priority transmission fails or the path transmission quality does not meet the priority transmission requirement, the image data captured by the camera is compressed and transmitted through steps S3-S5;
[0118] S3, performing image data conversion on the preprocessed image data captured by the camera to obtain converted image data captured by the camera;
[0119] Performing image data conversion on the pre-processed image data captured by the camera includes the following steps:
[0120] Convert the RGB value of each point in the image data captured by the real-time camera into YVU to obtain the converted image data captured by the camera;
[0121] The formula for converting RGB value to YVU is as follows:
[0122] ;
[0123] Wherein, R represents the red intensity of the pixel value in the image data captured by the camera, G represents the green intensity of the pixel value in the image data captured by the camera, B represents the blue intensity of the pixel value in the image data captured by the camera, Y represents the brightness of the image data captured by the camera, U represents the difference between the red part of the pixel value RGB input signal and the RGB as a whole in the image data captured by the camera, and V represents the difference between the blue part of the pixel value RGB input signal and the RGB as a whole in the image data captured by the camera;
[0124] S4, using Huffman coding to establish a Huffman compression matrix for the converted image data captured by the camera, and compressing the image data by establishing the Huffman compression matrix to obtain compressed image data captured by the camera;
[0125] The converted image data captured by the camera is encoded using Huffman coding to establish a Huffman compression matrix. The image data is compressed by establishing the Huffman compression matrix, which includes the following steps:
[0126] S41, converting the converted image data captured by the camera into grayscale image data;
[0127] The converted grayscale image data is as follows:
[0128] ;
[0129] S42, performing hierarchical statistics based on the grayscale values corresponding to each pixel of the converted grayscale image to obtain the grayscale level and the number of grayscale levels corresponding to each pixel, and generating a corresponding code based on the obtained grayscale level;
[0130] Generating the corresponding code based on the grayscale includes the following steps:
[0131] Since the value range of the YUV format is 0-255, set the number of gray levels to 256, numbered 0-255;
[0132] Since 256 is 2 to the eighth power, the encoding of each gray level is set to 8 bits, and the encoding of each gray level is converted into 8-bit binary for storage;
[0133] S43, based on the obtained number of gray levels, generate a corresponding number of arrays, make the generated arrays correspond to the gray levels one by one, and save the pixels of the same gray level in the same array;
[0134] S44, arranging the array in descending order based on the number of pixels in the array;
[0135] S45, compressing based on the array arrangement order and establishing a Huffman compression matrix;
[0136] Compression based on the array arrangement order and establishment of the Huffman compression matrix include the following steps:
[0137] S451, generating nodes based on each stored array and constructing a node set, each array only generates one corresponding node, and the number of pixels in the array is the weight of the corresponding node;
[0138] S452, taking out the two nodes with the smallest weights from the node set, combining them, and generating a parent node, the weight of the parent node being the sum of the weights of the two nodes;
[0139] S453, adding the generated parent node back to the node set, and executing S352 repeatedly until there is only one node in the node set;
[0140] S454, taking the only remaining node as the root node, and constructing a Huffman tree based on the combination of nodes, setting the Huffman code of the root node of the Huffman tree to 0, the Huffman code of the left subtree of the root node to 00, and the Huffman code of the right subtree of the root node to 01, and performing iterative coding based on the left subtree and the right subtree, so as to obtain a separate Huffman code for each node;
[0141] S455, establishing a Huffman compression matrix based on the obtained Huffman coding sequence of each node;
[0142] S46, performing Huffman coding on each pixel of the converted grayscale image, storing the Huffman compression matrix, and outputting the Huffman compression matrix;
[0143] The output Huffman compression matrix is the image data captured by the camera after compression;
[0144] S5, transmitting the compressed image data taken by the camera and decompressing the compressed image data taken by the camera obtained after the transmission based on the Huffman compression matrix obtained after the transmission;
[0145] The present invention also discloses an artificial intelligence-based camera video code stream adaptive adjustment system, comprising a camera, a path transmission quality evaluation module, an image data preprocessing module, an image data conversion module and an image data compression module;
[0146] The camera is used to capture image data in real time and transmit the captured image data to the image data preprocessing module;
[0147] The image data preprocessing module is used to preprocess the received real-time captured image data;
[0148] The path transmission quality evaluation module is used to analyze and evaluate the quality of the transmission path that can be transmitted in real time;
[0149] The image data conversion module is used to convert the image data captured in real time and transmit the converted image data to the image data compression module;
[0150] The image data compression module is used to compress the received converted image data.
[0151] Although embodiments of the present invention have been shown and described, it will be appreciated by those skilled in the art that various changes, modifications, substitutions and variations may be made to the embodiments without departing from the principles and spirit of the present invention, and that the scope of the present invention is defined by the appended claims and their equivalents.
Claims
1. A method for adaptively adjusting camera video stream based on artificial intelligence. It is characterized in that The following steps are involved: S1, collecting image data taken by a camera in real time, and preprocessing the collected image data taken by the camera to obtain preprocessed image data taken by the camera; The real-time collection of image data captured by the camera and preprocessing of the collected image data captured by the camera include the following steps: S11, collecting the image data captured by the camera in real time, including each pixel in the image, and representing it in RGB format; S12, performing image enhancement on the image data captured by the camera by using a histogram equalization algorithm to obtain the image data captured by the camera after image enhancement; specifically comprising: S121, calculating the pixel probability distribution of the image captured by the camera based on the gray value distribution in the image data captured by the camera collected in real time; S122, constructing an image cumulative distribution function according to the calculated pixel probability distribution of the image captured by the camera; The formula for constructing the cumulative distribution function of the image is as follows: ; in, represents the number of pixels with gray value i, L represents the total number of gray values in the image, n represents the total number of pixels, Represents the gray value of the kth gray value after being mapped by the cumulative distribution function; S123, performing image enhancement on the image data captured by the camera based on the constructed image cumulative distribution function; The grayscale value after the cumulative distribution function is mapped is multiplied by L-1 through the transformation function and rounded off to make the grayscale of the equalized image consistent with the original image before equalization; According to the mapping relationship between the image cumulative distribution function and the transformation function, refer to the pixels in the original image and output the image after histogram equalization; The output image after histogram equalization is set to be the image data captured by the camera after image enhancement; S13, summarizing the image data captured by the camera after image enhancement to obtain the image data captured by the camera after preprocessing; S2, using dynamic adaptive streaming media technology to evaluate the transmission quality of various transmission paths for the image data captured by the pre-processed camera, determine the priority of various transmission paths, and transmit them; When the priority transmission fails or the path transmission quality does not meet the priority transmission requirement, the image data captured by the camera is compressed and transmitted through steps S3-S5; Step S2 specifically includes the following steps: S21. Evaluate the transmission quality of various transmission paths and set priorities for various transmission paths; S22, performing classified transmission based on the priorities of various transmission paths; When the priority transmission fails or the path transmission quality does not meet the priority transmission requirement, the image data captured by the camera is compressed and transmitted through steps S3-S5; In step S21, the evaluation of the transmission quality of various transmission paths and the formulation of the priority of various transmission paths include the following steps: The evaluation indicators for the transmission quality of various transmission paths include: path bandwidth , round trip delay and packet loss rate ; The path transmission quality evaluation formula is as follows: ; in, represents the transmission quality evaluation value of path j, is the influence coefficient of bandwidth on path transmission quality, represents the bandwidth of path j, Represents the sum of bandwidths of multiple transmission paths, is the impact coefficient of packet loss rate on path transmission quality, represents the packet loss rate of path j, Represents the average value of packet loss rate of multiple transmission paths, is the impact coefficient of round-trip delay on path transmission quality, represents the round-trip delay of path j, Represents the average round-trip delay of multiple transmission paths; Based on the calculated path transmission quality evaluation values, various paths are sorted in descending order, and path transmission quality evaluation thresholds and priorities are set; Prioritize transmission for transmission paths with a value greater than the path transmission quality evaluation threshold, and perform compressed transmission for transmission paths with a value less than or equal to the path transmission quality evaluation threshold; S3, performing image data conversion on the preprocessed image data captured by the camera to obtain converted image data captured by the camera; S4, using Huffman coding to establish a Huffman compression matrix for the converted image data captured by the camera, and compressing the image data by establishing the Huffman compression matrix to obtain compressed image data captured by the camera; S5. Transmit the compressed image data taken by the camera and decompress the compressed image data taken by the camera obtained after the transmission based on the Huffman compression matrix obtained after the transmission.
2. According to the method for adaptively adjusting the video code stream of a camera based on artificial intelligence in claim 1, It is characterized in that The image data captured by the camera after the conversion is obtained and the Huffman compression matrix is established by Huffman coding. The image data is compressed by establishing the Huffman compression matrix, which includes the following steps: S41, converting the converted image data captured by the camera into grayscale image data; The converted grayscale image data is as follows: ; S42, performing hierarchical statistics based on the grayscale values corresponding to each pixel of the converted grayscale image to obtain the grayscale level and the number of grayscale levels corresponding to each pixel, and generating a corresponding code based on the obtained grayscale level; S43, based on the obtained number of gray levels, generate a corresponding number of arrays, make the generated arrays correspond to the gray levels one by one, and save the pixels of the same gray level in the same array; S44, arranging the array in descending order based on the number of pixels in the array; S45, compressing based on the array arrangement order and establishing a Huffman compression matrix; S46, performing Huffman coding on each pixel of the converted grayscale image, storing the Huffman compression matrix, and outputting the Huffman compression matrix; The output Huffman compression matrix is the image data captured by the camera after compression.
3. According to the method for adaptively adjusting the video code stream of a camera based on artificial intelligence as described in claim 2, It is characterized in that The generating of the corresponding code based on the obtained gray level comprises the following steps: Since the value range of the YUV format is 0-255, set the number of gray levels to 256, numbered 0-255; Since 256 is 2 to the eighth power, the encoding of each gray level is set to 8 bits, and the encoding of each gray level is converted into 8-bit binary for storage.
4. According to the method for adaptively adjusting the video code stream of a camera based on artificial intelligence in claim 3, It is characterized in that The method of compressing based on the array arrangement order and establishing the Huffman compression matrix comprises the following steps: S451, generating nodes based on each stored array and constructing a node set, each array only generates one corresponding node, and the number of pixels in the array is the weight of the corresponding node; S452, taking out the two nodes with the smallest weights from the node set, combining them, and generating a parent node, the weight of the parent node being the sum of the weights of the two nodes; S453, adding the generated parent node back to the node set, and executing S452 repeatedly until there is only one node in the node set; S454, taking the only remaining node as the root node, and constructing a Huffman tree based on the combination of nodes, setting the Huffman code of the root node of the Huffman tree to 0, the Huffman code of the left subtree of the root node to 00, and the Huffman code of the right subtree of the root node to 01, and performing iterative coding based on the left subtree and the right subtree, so as to obtain a separate Huffman code for each node; S455: Establish a Huffman compression matrix based on the obtained Huffman coding sequence of each node.
5. An artificial intelligence-based camera video stream adaptive adjustment system, used to implement the artificial intelligence-based camera video stream adaptive adjustment method according to any one of claims 1 to 4, It is characterized in that It includes a camera, a path transmission quality evaluation module, an image data preprocessing module, an image data conversion module and an image data compression module; The camera is used to capture image data in real time and transmit the captured image data to the image data preprocessing module; The image data preprocessing module is used to preprocess the received real-time captured image data; The path transmission quality evaluation module is used to analyze and evaluate the quality of the transmission path that can be transmitted in real time; The image data conversion module is used to convert the image data captured in real time and transmit the converted image data to the image data compression module; The image data compression module is used to compress the received converted image data.
