Sinclair Town #02
31 декабря 1994 |
|
Beginners - the basic methods of image scaling: Approximation undertones.
Approximation of a semitone. Do not be afraid of this name. The essence of this method very simple. Yet at the dawn of the capitalist system (not in our Russian), this method was used for the manufacture of textiles products. What is this algorithm approximation undertones? First, consider the method presentation of information, called the configuration. It is based on the fact that some pixels are combined into configuration (usually in the form of lattices, an example Fig. 1). Further, the entire image on the screen is constructed using only the configuration data points. For example, consider several configurations (square lattice 2 * 2.3 * 3, rectangular lattice 3 * 2). Need to choose the configuration very carefully, because otherwise may have unwanted Fine-scale structure. Not should be chosen, for example, structures such as horizontal lines and such as vertical lines. Figure 2 shows an example of an unfortunate choice of configurations. Thus, each configuration ( lattice) consists of a number of pixels and the number of pixels in the lattice increases with with the level of intensity ( level of the shaded configuration). Moreover, when the size of the lattice M * N number of possible levels intensity is equal to M * N +1, and accordingly, the value set configurations will be also M * N +1 configuration. That's all you need to know on the configuration. Now, about the method approximation. Thus, we define (can use already given methods), the intensity for each point representing a grid of 4 * 4 pixel (For screen sizes: 128 * 96 points for a set of configurations 2 * 2 or 64 * 48 pixels, for a set of 4 * 4). Then we get the proper intensity of the configuration of points (for example, using thresholds) and depict it on screen. So the whole screen costs. IMPROVING THE THRESHOLD OF METHODS. It is evident that the use of configurations leads to a loss spatial resolution instead of improving the visual. Can I somehow select a method to get some compromise? You can, if we use the revised threshold methods. Let us examine two of them: A) The method of Floyd-Steinberg; B) The method of excitation; Consider them in more detail: METHOD Floyd-Steinberg. In a simple threshold method, considered in the previous section, there is loss of detail and texture of a weak image. This is especially noticeable for hair and folds of clothing, as well as its texture. Small details are lost here due to large output errors intensity for each pixel. That is, we obtain a total intensity of 13, and threshold value for the pixel painting, we had 10. In Finally we got an error e = 1310 = 3. In the method of Floyd-Steinberg error itself is distributed to surrounding pixels according to the law, narisovanomu Figure 3. Thus, if the processing point (0, 0) we have error equal to 8, then the error distributed at the point (0, 1) and (1, 0) will be equal to 3, and at the point (1, 1) is e = 2. In calculating the intensities for these points to their total intensity will be added value get an error. Next, we process the point (0, 1) get an error on this for the points (1, 1) we add to the previously obtained. Etc. Fig.3 Distribution of the error. Distribution of errors improves view image details, as lost only minimal information. From the software point of view This algorithm requires buffer equal to the height of the screen when passage points from the top down. The main drawback - the need for real calculations. But this method can be used with coarse integer calculations, although it may lose all their charm. Method of excitation. This method does not require any real calculation and availability buffer. It was noted that if in the image introduces a certain kind of random error, which is added to the total intensity of a point to comparing it with threshold value, the image on the screen is improved. In this case, adding an entirely arbitrary error does not lead to the desired result. Need a matrix corresponding to the following requirements: Matrix obtained by the following items: size 2 * 2: 0 2 (Matrix of Lima) 3 1 (not p). size 4 * 4: 0 8 February 1910 12 4 14 6 3 11 1 9 15 7 13 5 Furthermore, these matrices in a staggered procedure adds to the image.
Other articles:
Similar articles:
В этот день... 21 November