Compression and recovery of images

Source: Internet
Author: User

How is an image digitized? Start with a picture of a toy duck.


First, the picture is divided into small pieces, each with a number to represent a color. If the image is pure black and white, then each block is represented by only 1 or 0. If the image is 16 colors, each block is represented by a 4-bit binary number, because 2^4=16, that is, the 4-bit binary has 16 combinations, each combination represents a color on the line. True Color bitmap of each small block, are composed of different levels of red and green blue combination of three colors, each color has 2^8 levels, so there are 2^24 colors, so each small block needs 24 bits of binary number to represent.


As you can see, the more colorful the digital image is, the more you need to record the number of binary digits longer. In addition, the more dense, the larger the total amount of data on a graph, in this case the duck picture is divided into 11x14=154 block, according to the true color bitmap to calculate, the total data volume is 154x24=3696 bit. These small lattice is obviously too big, can not show the details of the picture, the actual lattice to be much more dense, for example, 1024x768, this is everyone familiar with the display resolution.


Look at this ski map, the human body color changes relatively large, and the sky and snow color is very monotonous, you can imagine that the value of each small lattice color should also be very close, the bottom right of the original data is 8 adjacent lattice color data, due to two adjacent lattice data difference is very small, So you can use the first format data as the second lattice data of the predicted value, after the actual measurement, the real value and the difference between the predicted value, and use this difference to represent the color of the second lattice. So, the actual record is the third line difference. But when recovering data, with the previous value plus the difference, is the current color value, as long as there is the base value of the first bit, the following color value can be a snowball one by one to find out.

Use the difference to record color, just a lot of simple subtraction operation, in the restoration and then add back, the data is not a small loss, so called Lossless compression , if the very few difference is completely discarded, in the restoration of a lattice of color information represents the color of many lattice around, The compression rate is higher, but the small difference between the lattice is lost, and this method is lossy compression .


bitmaps are independent records of each lattice , so the amount of data is very large, this is the BMP format, and after the above prediction difference operation, it becomes lossy compression format, JPG format is one of them. The two images with the same image quality are much smaller in JPG format than BMP. JPG is lossy compression, but the loss of picture quality is very small. JPG format is very intelligent, for example, the above has a large area of similar color landscape to give a greater compression rate, and the very lively crowd to give a smaller compression rate.

Above said only static image, and video image compression More, a second video will switch dozens of pictures, and most of these pictures are the same, the acquisition is each is independent mining, the generated AVI format data is very large, not only each picture itself can be compressed, more important is the amplitude and amplitude can also be compressed , which forms the MPEG format with a much smaller amount of data. You can also use the RM format with a higher compression rate, RM format is not much better than MPEG, but the amount of data is much smaller and more convenient for online transmission.


Different video, the similarity between amplitude and amplitude is different, Korean drama similarity is very large, do not say a second, even a few minutes in the actors are sitting on the couch, in addition to the mouth every picture is basically the same, for this kind of video can use a larger compression rate, and the dynamic is very strong action movies, the use of smaller compression rate, This format is RMVB. Unlike RM format, its compression rate is variable, VB is the meaning of variable bit rate. RMVB is more advanced than RM, RMVB video with the same amount of data will be clearer than RM video, while video with the same definition will have a smaller amount of data in RMVB format.

once the lossy compression, the data is missing, the image quality is difficult to recover, but this is not impossible , there is a key concept-apriori information. For example, this beautiful black and white photos of the lips, to compress into this grayscale, there are five possible color legends on the right, but through a priori information (prior information is what we have known before) know that the beauty of the lips can not be green, blue and purple, only the lower right red, it will be reduced to red on the right.

Each group of piano chords is composed of no more than five pure notes, the total number of these permutations is still quite a few, but fortunately according to the prior information we know that only a very small number of combinations are often present, the vast majority of the combination is basically will not appear, if we get a set of ambiguous combinations, It is the same as the similarity of a certain combination that is not always present, and we do not hesitate to assume that it is the usual combination.

Of course, in fact, it is not the regular appearance of the combination, but the basic will not appear in the combination, this possibility can not be ruled out, as the Republic of the beautiful woman really has a pair of blue lips, we rely on a priori information to make the judgment on the Cup, but this is not the way.
Today's NMR technology can only get rough images in a short period of time, but we know that each small piece of the organ and the adjacent parts of the correlation is very strong, and we have a lot of prior information on these organs, which can help us to restore the beautiful picture of the ROC, in the rough image to restore high-quality images , the credibility can also be very high.



For more discussion and communication about image engineering& Computer vision, stay tuned for this blog and Sina Weibo songzi_tea



Compression and recovery of images

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.