A kind of image coding and decoding processing method based on picture element st atistical characteristic and visual characteristic
Technical field
The present invention relates to a kind of image information processing method that is used for coding and decoding video, especially statistical nature information by will analyzing original image and human eye for the visual signature of color with the amount of information that reduces the follow-up coding/decoding with improve information processing efficiency; Belong to image/video encoding and decoding technique and technical field of information processing.
Background technology
Video coding and decoding technology is to realize high-quality, storage of low-cost multi-medium data and the key of transmitting efficiently.The image coding and decoding international standard of current trend all is based on so a kind of coding theory, the coding method that the motion compensation, discrete cosine transform and the quantification that are based on the piece coupling of employing combines.International standards such as MPEG-1, MPEG-2 that International Standards Organization/International Electrotechnical Commissio first United Technologies group releases and MPEG-4 are typically arranged.The AVS national standard of China's promulgation also is to adopt similar hybrid video coding strategy: modules such as prediction, conversion, quantification and comentropy coding.
The method of these video encoding standard process informations all is that original image is divided into a certain size block of information, the piece as 8 * 8,16 * 16 piece etc. by the space.Do not have similitude between these block of informations, even therefore adopt the infra-frame prediction mode, its information prediction result can be not desirable.Can not effectively reduce frame internal information amount of redundancy.
Along with the raising that people require for picture quality, the resolution of image also improves constantly, and the corresponding information processing capacity that increases information encoding-decoding, has reduced every frame information processing speed, has promoted the requirement to transmission inromation bandwidth.
In the digitized process of information such as present image, video flowing, usually promptly redness, green, blueness are carried out digitlization respectively for three kinds of primary colours in employing, the digitlization resolution bits 8bit of every kind of primary colours, spatial resolution for a panel height picture rich in detail is a 1024*768 pixel, the complete colourful digital amount of information of piece image reaches 1024*768*3*8bit like this, i.e. 18Mbit.For Video stream information, by each seconds 25 frame calculate, each second amount of information 450Mbit, if realize the real-time video flow transmission, it will try to achieve bandwidth is very big.Therefore must find effective method, be implemented under the prerequisite that guarantees picture quality, image information is handled, reduce transinformation.JPEG, the MPGEG information encoding-decoding technology of international popular are widely used at present, but because its high patent fee has hindered development domestic and video or image processing association area.Domestic AVS technology also produces in this case.
But AVS technology and JPEG, MPGEG technical finesse mode are close, and also improve at present, and its encoding-decoding efficiency is suitable substantially, still can not satisfy the growing demand at finite bandwidth transmitted over resources video.
Summary of the invention
For solving above-mentioned video coding and decoding technology problem, propose a kind of by analyzing original image statistical nature information and human eye for the visual signature of color, and after handling as follows, the amount of information that can reduce video image greatly can guarantee simultaneously high-quality image visual effect again, improves code efficiency and promote the video information efficiency of transmission.
Principle of the present invention is based on following image statistics feature: color space only takies a very little color sub-spaces of 24 color spaces in most images in the reality or the video flowing every or the every frame information, and represent that this color sub-spaces only needs data message seldom just can show, and do not need 24 information.Adopt the Huffman encoding method to carry out encoding process for the image information that is mapped to color sub-spaces simultaneously, will improve compression efficiency does not greatly influence simultaneously picture quality.
Technical scheme of the present invention comprises
1) in information transmitting terminal, the digitized video image information data that at first will need to handle is carried out pixel quantity statistics by same grayscale information or same color information;
2) in information transmitting terminal, according to the result of pixel quantity statistics be less than for pixel quantity set the amount of pixels threshold value color with pixel quantity in this width of cloth image greater than setting amount of pixels threshold value and the color replacement the most close with it;
3) in information transmitting terminal, according to the characteristics of human eye for red, green, blue different visual sensitivitys, for pressing color distortion algorithm computation color distortion degree between each color in the image, merge into the many colors of pixel quantity less than two kinds of colors of setpoint color diversity factor threshold value for the color distortion degree;
4) in information transmitting terminal, the three primary colors information of every kind of color correspondence is carried out correspondence or adopted the Huffman variable-length encoding to carry out correspondence as expressing information with the expressing information that is less than three bytes, and the retaining color correspondence table;
5), the three primary colors information of each pixel in the image is replaced with the expressing information that is less than three bytes according to correspondence table in information transmitting terminal;
6) in information transmitting terminal, will adopting at present by expressing information and color correspondence table information, known various compression coding technologies compress processing;
7), be expressing information and color correspondence table information by the data after the decoding decompression at information receiving end;
8) at information receiving end, the color correspondence table information that receives according to the expressing information utilization that receives replaces with three primary colors information with expressing information, recovers image information.
In above-mentioned steps 1) in, be to add up by the synthetic color of three primary colors when the video image information data are carried out pixel quantity statistics by same grayscale information or same color information with each pixel.
In above-mentioned steps 2) in, according to the result of pixel quantity statistics be less than for pixel quantity set the amount of pixels threshold value color with pixel quantity in this width of cloth image greater than setting amount of pixels threshold value and the color replacement the most close with it, the permission of wherein setting the amount of pixels threshold value and being according to information loss after the image processing decides, the information loss that can tolerate is many more, it is just big more that this sets the amount of pixels threshold value, the information loss that can tolerate is few more, and it is just more little that this sets the amount of pixels threshold value.
In above-mentioned steps 3) in, according to the characteristics of human eye for red, green, blue different visual sensitivitys, for pressing color distortion algorithm computation color distortion degree between each color in the image, merge into the many colors of pixel quantity for the color distortion degree less than two kinds of colors of setpoint color diversity factor threshold value, described different visual sensitivity is for red, green, blue change color susceptibility difference different weights to be arranged in calculating according to human eye, blue weight minimum, green weight maximum, red weight is taken second place.
In above-mentioned steps 3, according to the characteristics of human eye for red, green, blue different visual sensitivitys, for pressing color distortion algorithm computation color distortion degree between each color in the image, merge into the many colors of pixel quantity for the color distortion degree less than two kinds of colors of setpoint color diversity factor threshold value, described color distortion algorithm=(absolute value * red weight of red difference)+(absolute value * green weight of green difference)+(absolute value * blue weight of blue difference).
In above-mentioned steps 4) in, the described expressing information that is less than 3 bytes is meant through described step 1), 2), 3) number of colors in the image information after handling significantly reduces, and can represent colouring information by three red, green and blue byte representations with the data message that is less than 24.
In above-mentioned steps 4) in, the variable-length encoding of described employing Huffman is carried out correspondence as expressing information and is meant the variable length information coding method that calculates a kind of optimum according to every kind of color proportion in image, certain color proportion is big more, and the figure place of its expressing information is few more.
In above-mentioned steps 4) in, the mapping table one to one of the three primary colors data message that described color correspondence table is color expressing information and corresponding color.
In above-mentioned steps 6) in, described known various compression coding technologies at present are meant disclosed international and domestic coded image data decoding algorithm, comprise the JPEG that handles still image, MPEG, the AVS of Chinese autonomous innovation that handles the continuous videos image.
In above-mentioned steps 7) and step 8) in be the reverse process decoding of coding, can realize and will decode, and recover the image information that human eye vision is felt good through the compressed image information that above-mentioned steps was handled.
Adopt image color pixels amount statistics can remove amount of pixels colouring information seldom, use the many colors of the pixel quantity close to replace, because these pixels that are replaced can not produce any vision difference with it; Human eye can not be distinguished fully for 24 colours that the red, green, blue three primary colors combine simultaneously, because the color-resolution of human eye is limited, therefore the computational methods of color distortion degree have been defined, i.e. color distortion algorithm=(absolute value * red weight of red difference)+(absolute value * green weight of green difference)+(absolute value * blue weight of blue difference).Wherein the weight of three primary colors is to have different visual sensitivitys to determine according to human eye in red, green, blueness, therefore can define different color weight.Therefore after defined color distortion value was less than certain threshold value, human eye just can not be distinguished the difference of two kinds of colors, can adopt with a kind of color and represent and can not influence visual quality for images.
Employing the invention has the beneficial effects as follows and can reduce the size of the color sub-spaces of image greatly, thereby reduces information content of image, and under identical visual image quality required, code efficiency was higher, and the complexity of algorithm and difficulty in computation increase are seldom.
Description of drawings
Fig. 1 is that the present invention adopts the image compression encoding flow chart of Huffman (Haffman) variable-length encoding mode as expressing information.
Fig. 2 is that the present invention adopts the image compression encoding flow chart of byte fixed-length coding mode as expressing information.
Fig. 3 is the decompression decoding process figure of corresponding the Huffman () variable-length encoding of the present invention mode
Fig. 4 the present invention is to the decompression decoding process figure of byte fixed-length coding mode
Embodiment
Below in conjunction with accompanying drawing and exemplifying embodiment technical scheme of the present invention is further described:
Fig. 1 is that the present invention adopts the image compression encoding flow chart of Huffman (Haffman) variable-length encoding mode as expressing information, is to realize that the present invention carries out one of implementation of compressed encoding for image.Flow processing [the 101st, the data bitmap that image digitazation is obtained based on the red, green, blue three primary colors.In flow process [102], set pixel quantity threshold value Hm and color distortion degree threshold value Cm, can adjust the value of Hm and Cm for the requirement of picture quality according to people.Hm is big more, will have the color of more low pixel quantity to be replaced in the image; Cm is big more, will have more color to merge into a kind of color owing to being taken as similar color; The amount of information of respective image will be few more, and the quality of image can be poor more; Therefore Hm and Cm are worth selection to determine according to the requirement of picture quality.In flow process [103], calculate and statistical picture in every kind of color pixel number of spots, then in flow process [104] according to the pixel quantity threshold value Hm that sets, carry out mark for pixel quantity less than the color of Hm.The most close color that adopts the color of following color distortion degree algorithm computation mark in image, can find in flow process [105].
Color distortion degree=(absolute value * red weight of red difference)+(absolute value * green weight of green difference)+(absolute value * blue weight of blue difference), wherein red weight, green weight, blue weight are to have different susceptibilitys according to human eye for three kinds of primary colours to decide, usually human eye is the most responsive for green, the respective green weight is just maximum, human eye is lower than green for the red sensitive degree, corresponding red weight is littler than green weight, and people's clothes are least responsive for blueness, corresponding blue weight minimum.Can select green weight=4 in one implementation, red weight=2, blue weight=1.
Marker color in the similar color replacement image that flow process [106] usefulness is selected, thus the color category in the image reduced.In flow process [107] by the above-mentioned shades of colour vision difference degree of handling in the image of above-mentioned color distortion algorithm computation, carrying out color then in flow process [108] merges, be the many relatively color values of pixel when the color distortion value merges these two kinds of similar color during less than the visual discrimination threshold value Cm of the human eye of setting promptly, this moment, the color category of image further reduced.Huffman (Haffman) encryption algorithm is according to the different optimum lossless coding algorithms that adopt a kind of variable-length of different information proportions, therefore in a kind of realization of the present invention, also can adopt this algorithm, promptly calculate the optimum code value of every kind of color of image according to Huffman (Haffman) encryption algorithm as the flow process among the figure [109] and flow process [110], and the correspondence table of record coding value and corresponding color tristimulus value, in flow process [111], replace the three primary colors data message of each the pixel correspondence in the image then with Huffman (Haffman) coding that calculates.This moment the image correspondence the expressing information amount well below the amount of information of original image, further the encoded radio of the image information of the coding expression that the present known image compression encoding algorithm of employing such as JPEG, MPEG, AVS etc. obtain for above-mentioned processing in flow process [112] and flow process [113] and record and corresponding color tristimulus value correspondence table information are handled and are obtained final image compression encoding data.According to the real processing results of real image, it is directly to adopt JPEG, MPEG, AVS equipressure to reduce the staff more than 4 times of code calculation that employing figure one described flow process is handled the final compression coding efficiency that obtains.
Because Huffman (Haffman) encryption algorithm calculates more complicated, the computing resource that takies is bigger, in order to reduce computation complexity, realizes another kind of flow process of the present invention such as Fig. 2.
Fig. 2 is that the present invention adopts the image compression encoding flow chart of byte fixed-length coding mode as expressing information.Be realize the present invention carry out for image compressed encoding implementation two.Flow processing [the 201st, the data bitmap that image digitazation is obtained based on the red, green, blue three primary colors.In flow process [202], set pixel quantity threshold value Hm and color distortion degree threshold value Cm, can adjust the value of Hm and Cm for the requirement of picture quality according to people.Hm is big more, will have the color of more low pixel quantity to be replaced in the image; Cm is big more, will have more color to merge into a kind of color owing to being taken as similar color; The amount of information of respective image will be few more, and the quality of image can be poor more; Therefore Hm and Cm are worth selection to determine according to the requirement of picture quality.In flow process [203], calculate and statistical picture in every kind of color pixel number of spots, then in flow process [104] according to the pixel quantity threshold value Hm that sets, carry out mark for pixel quantity less than the color of Hm.Adopt the following color distortion degree algorithm computation color of the mark the most close color that in image, can find in flow process [105].
Color distortion degree=(absolute value * red weight of red difference)+(absolute value * green weight of green difference)+(absolute value * blue weight of blue difference), wherein red weight, green weight, blue weight are to have different susceptibilitys according to human eye for three kinds of primary colours to decide, usually human eye is the most responsive for green, the respective green weight is just maximum, human eye is lower than green for the red sensitive degree, corresponding red weight is littler than green weight, and human eye is least responsive for blueness, corresponding blue weight minimum.Can select green weight=4 in one implementation, red weight=2, blue weight=1.
Marker color in the similar color replacement image that flow process [206] usefulness is selected, thus the color category in the image reduced.In flow process [207] by the above-mentioned shades of colour vision difference degree of handling in the image of above-mentioned color distortion algorithm computation, carrying out color then in flow process [208] merges, be the many relatively color values of pixel promptly when the color distortion value merges these two kinds of similar color during less than the visual discrimination threshold value Cm of the human eye of setting, this moment, the color category of image further reduced, in flow process [209], judge the color category in the processed images then, if color category is not less than 256 kinds, then needing to enter increases the visual discrimination threshold value in the flow process [210], jump to the processing of proceeding to merge color in the flow process [208] again; If color category is less than 256 kinds, then enter flow process [211] and express every kind of color of image with the byte coding, and the correspondence table of record coding value and corresponding color tristimulus value, in flow process [212], replace the three primary colors data message of each the pixel correspondence in the image then with the byte coding.This moment the image correspondence the expressing information amount well below the amount of information of original image, further the encoded radio of the image information of the coding expression that the present known image compression encoding algorithm of employing such as JPEG, MPEG, AVS etc. obtain for above-mentioned processing in flow process [213] and flow process [214] and record and corresponding color tristimulus value correspondence table information are handled and are obtained final image compression encoding data.According to the real processing results of real image, it is directly to adopt JPEG, MPEG, AVS equipressure to reduce the staff about 3 times of code calculation that employing figure two described flow processs are handled the final compression coding efficiency that obtains.
Fig. 3 is the decompression decoding process figure of corresponding Huffman (Haffman) variable-length encoding of the present invention mode.Provide the data that obtain by compressed encoding shown in Figure 1 in the realization example of the present invention decoding that decompresses among this figure and recover the flow process of image information.Flow process reads compress coding data in [301], separating encryption algorithm in the decompression of flow process [302] and the corresponding Coding Compression Algorithm of flow process [303] employing handles, and obtain with the image information of Huffman (Haffman) coding expression and the encoded radio and the corresponding color tristimulus value correspondence table of record, enter flow process [304] and flow process [305] then and the image information of expressing is replaced with tristimulus value, thereby generate 24 data bitmaps that obtain image according to encoded radio and corresponding color tristimulus value correspondence table.The family's compression and the decode procedure of view data have been finished.
Fig. 4 is the decompression decoding process figure of the present invention to byte fixed-length coding mode.Provide the data that obtain by compressed encoding shown in Figure 2 in the realization example of the present invention decoding that decompresses among this figure and recover the flow process of image information.Flow process reads compress coding data in [401], separating encryption algorithm in the decompression of flow process [402] and the corresponding Coding Compression Algorithm of flow process [403] employing handles, and obtain with the image information of byte coding expression and the encoded radio and the corresponding color tristimulus value correspondence table of record, enter flow process [404] and flow process [405] then and the image information of expressing is replaced with tristimulus value, thereby generate 24 data bitmaps that obtain image according to encoded radio and corresponding color tristimulus value correspondence table.The family's compression and the decode procedure of view data have been finished.
Image processing techniques provided by the present invention and method, effectively utilized the statistical nature and the human eye of image to come the color of image is carried out preliminary treatment for the vision sensitive features of color of image, and then adopt everybody widely used compression coding and decoding algorithm such as JPEG at present, MPEG, AVS etc. handle, under for the very little situation of picture quality influence, make compression coding efficiency than directly adopting widely used compression coding and decoding algorithm such as JPEG, MPEG, AVS etc. handle have been increased more than 3 times, and the complexity of algorithm and difficulty in computation increase are seldom, are a kind of image processing methods efficiently.By the technical method of describing among flexible use the present invention, the information Compression efficient of single image or video flowing is improved greatly.
It should be noted last that: above exemplifying embodiment is the unrestricted technical scheme of the present invention in order to explanation only, although the present invention is had been described in detail with reference to above-mentioned example, those skilled in the art is to be understood that: still can make amendment or replacement on an equal basis to the present invention, and replace any modification or the part that do not break away from the spirit and scope of the present invention, and it all should be encompassed in the middle of the claim scope of the present invention.