The computer was easy to use.

Source: Internet
Author: User

In the Second World War, apart from being loaded with powerful bombs, American bombers often had to assemble a computer, the calculation of the plane's flight direction and the parabolic jump is inseparable from this machine. However, the world's first electronic computer was invented after the end of World War II. The "computer" carried on the bomber was actually a large box containing a lot of gear, the computation capability of this Bulky Box is far inferior to the Casio calculator in today's hands. It is better to use it than to use it. The biggest concern of these mechanical computer designers is that one or two of the many gear parts in the machine may not be able to get lost, it would be too much trouble to mistakenly throw a bomb to your position. When bombers fly around, will the constant shaking make the machine malfunction a worry for many people. But this guy got on the plane, but people accidentally found that not only were there no problems, but the calculation results were more accurate and confusing than when they were on the ground, do these machines have a special liking for roller coasters? After people know the machine's "strange problem", they simply install the vibrator in the ground machine to let them gently shake and work while enjoying the feeling of flying on the ground, they will not only fall asleep, but also work better.

Why do these computers like to sit on a gray machine without being dizzy? After research, it is found that in terms of precision, these mechanical gadgets certainly cannot be compared with the current computer, and the computation cannot calculate many digits after the decimal point, which is often rounded down. For example, when a computer completes a task, a parameter is multiplied five times. The exact value of this parameter is 5.4, but the computer can only use an integer, 5.4 had to be rounded to 5 every time. The correct result should be 5.4*5.4*5.4*5.4*5.4*4591.65 =, however, the calculation result is only 5*5*5*5*5 = 3125. There is a small error between the two, because the value after each rounding is "shorter" than the correct value ", when the errors are combined several times, they become larger and larger. When the machine is shaking, it will produce some extra small errors, but it will not make it worse. 5.4 may be shaken to 5.5, 5.6, and 6 if it is rounded off, of course, it may also be shaken to 5.3 or 5.2. Although the shaking error is completely random, but 5.4 is closer to 5, so the final change is more likely to be 5. Suppose that 5.4 of the five times is 5, the calculation result is 5x5x5x6x6 = 4500, which is much more accurate than 3125. Of course, the "Shake" must be mild and cannot be too powerful. If 5.4 turns to 10, it will be totally unreliable.

In these machines, a small random shaking error is added to eliminate the large computer rounding error. This technique is called dithering technology, it is a wonderful idea to attack the virus.

Although the mechanical computer has been eliminated in a few years, dithering technology has been used. Recently, images, videos, and sounds displayed on various digital products also need to be shaken from time to time.

Many people must have played such a game when they were young. They made a small disc with cardboard, and red and yellow on the disc alternate. Then they put a small pillar in the middle of the disc, what do you see when you rotate a small disc as quickly as a gyro? Yes, the small disc is neither red nor yellow, but a red or yellow two-color fast "shift" Flashing in front of your eyes, being "changed to" orange in the middle.

If a video is played in a limited color, for example, only red and yellow can be displayed, but orange cannot be displayed (of course, there will be no devices that are so backward today, however, when there are hundreds or thousands of colors, the orange part of the video can only be rounded to 5 as 5.4, to see which one is closer, it can be regarded as red or yellow. The video needs to play 24 images quickly every second. However, the eyes cannot respond and you may see continuous images. We can also add some "jitter" to make the screen color red and yellow appear alternately. When the display is yellow, it also flashes red twice. When the display is red, it also flashes yellow twice, each random occurrence. If we want to show "Dark orange", we will make the screen show a larger probability of red, and show more times on average per second. If we want to show light orange, we will make the screen show a larger probability of yellow, "color" in this way ". Just like a small disc, the dithering that quickly changes the image can fool your eyes and create extra colors like dark orange, orange, and light orange that are not in the picture.

A video can display new colors. What should I do with a static image? Dithering also plays a role. Take the black and white pictures for example. This is a normal black and white photo with black, white, and gray elements of different shades.

Now, if you only have two paint brushes, black and white, there is no gray paint brush. Can you still draw the effect of this image? If we only show the light gray in the image in white, and turn the dark gray in the image into black, the image will unfortunately become the following:

The effect is terrible.

Let's take a look at the picture below.

Looks like OK! The color depth is variable. It doesn't look like only black and white. But a closer look, there is no gray element in it, just like the previous figure, only black points and white points.

Compared with the second image, we performed dithering in the third image, added some white spots in the black area, and added some black spots in the white area, areas with a large proportion of black spots can be dark gray, while areas with more white spots can be light gray. We have changed the magic, and we can draw images with only black spots and white spots.

There is also a better quality dithering image, the middle of the Ms Lena ghost is actually only white and black, there is no middle color, whether you do not believe it.

After reading the black-and-white and grayscale photos, let's take a look at the colored photos.

There are six images, and the picture in the top left corner is of the magic horse color? Red and blue. Which image in the bottom right corner is of the magic horse color? Purple. Wrong! The bottom right corner of the picture only has red and blue. The red squares and blue squares in the six pictures become smaller in turn. At the end of the six pictures, red and blue will disappear, it is equivalent to "blending" red and blue dots into purple. In a dynamic video, different colors are displayed at different time points, and dithering can be changed to a non-existent color in front of your eyes; in a static image, dithering is a small dot of different colors in different locations to create a color illusion.

In the following three pictures, the first picture is a normal image. In the second picture, the number of colors that can be used is greatly reduced. This cat becomes a "big face" and the picture becomes blurred. In the third screenshot, we used dithering technology. Although there are as many colors as the second one, it looks quite comfortable.

In addition to deceiving your eyes in an image, dithering can also fool your ears in sound. If the amplitude of a piece of music is rounded down at each time point, the original music will be mixed with noises of other frequencies, affecting the effect. If we add a small error to the amplitude of each time point, the noise generated by this rounding will be weakened and balanced. On the surface, the method of reducing the sound quality will make the sound effect better.

 

 

----------------- Create high-qualityArticleFor more information, thank you ---------------

To create high-quality articles, please RecommendationCome on .... Thank you. Please pay attention to my subsequent articles, which will be even better.

Sina Weibo: http://weibo.com/baiyang26

The wine ghost official blog: http://www.ibaiyang.org [recommended to use Google Reader subscription]

Pour wine into the official Douban: http://www.douban.com/people/baiyang26/

If you want to repost this blog,Please specify the source

If you have any comments or suggestions on this article,Leave a message

Related Article

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.