How to set up smartphones and PCs. Informational portal
  • home
  • Safety
  • Fourier processing of digital images. What is a discrete image? and what is hardware resolution

Fourier processing of digital images. What is a discrete image? and what is hardware resolution

Analog and discrete provision of graphic information A person is able to perceive and store information in the form of images (visual, sound, tactile, gustatory and olfactory). Visual images can be saved in the form of images (drawings, photographs, etc.), and sound images can be recorded on records, magnetic tapes, laser disks, and so on.

Information, including graphic and sound, can be presented in analog or discrete form. With an analog representation, a physical quantity takes on an infinite set of values, and its values ​​change continuously. In a discrete representation, a physical quantity takes on a finite set of values, and its value changes abruptly.

Let's give an example of analog and discrete information representation. The position of the body on an inclined plane and on a staircase is set by the values ​​of the X and Y coordinates.When a body moves along an inclined plane, its coordinates can take on an infinite set of continuously changing values ​​from a certain range, and when moving along a staircase, only a certain set of values, and changing abruptly


An example of an analogue representation of graphic information can be, for example, a painting canvas, the color of which changes continuously, and discrete - an image printed using an inkjet printer and consisting of separate dots of different colors. An example of analog storage of sound information is a vinyl record (the sound track changes its shape continuously), and discrete storage is an audio CD (the sound track of which contains areas with different reflectivity).

Conversion of graphic and audio information from analog to discrete form is carried out by sampling, that is, dividing a continuous graphic image and a continuous (analog) audio signal into separate elements. In the process of sampling, coding is performed, that is, the assignment of each element to a specific value in the form of a code.

Sampling is the transformation of continuous images and sound into a set of discrete values ​​in the form of codes.

Sound in computer memory

Basic concepts: audio adapter, sampling frequency, register capacity, sound file.

The physical nature of sound is vibrations in a certain frequency range, transmitted by a sound wave through air (or other elastic medium). The process of converting sound waves to binary code in the computer's memory: sound wave -> microphone -> alternating electric current -> audio adapter -> binary code -> computer memory .

The process of reproducing sound information stored in the computer memory:
computer memory -> binary code -> audio adapter -> alternating electric current -> speaker -> sound wave.

Audio adapter(sound card) - a special device connected to a computer designed to convert electrical vibrations of an audio frequency into a numerical binary code when inputting sound and for reverse conversion (from a numerical code to electrical vibrations) when playing sound.

While recording sound the audio adapter with a certain period measures the amplitude of the electric current and enters into the reg pp is the binary code of the obtained value. Then the resulting code from the register is rewritten into the computer's RAM. The quality of computer sound is determined by the characteristics of the audio adapter: sampling frequency and bit depth.

Sampling frequency Is the number of measurements of the input signal per second. Frequency is measured in hertz (Hz). One measurement in one second corresponds to a frequency of 1 Hz. 1000 measurements in one second -1 kilohertz (kHz). Typical frequencies of audio adapters disketation: 11 kHz, 22 kHz, 44.1 kHz, etc.

Register size- the number of bits in the audio adapter register. The bit depth determines the accuracy of the input signal measurement. The larger the digit capacity, the smaller the error of each individual conversion of the magnitude of the electrical signal into a number and vice versa. If the bit width is 8 (16), then when measuring the input signal, 2 8 = 256 (2 16 = 65536) different values ​​can be obtained. Obviously 16-bit an audio adapter encodes and reproduces sound more accurately than an 8-bit one.

Sound file- a file that stores audio information in a numerical binary form. Typically, information in audio files is compressed.

Examples of solved problems.

Example # 1.
Determine the size (in bytes) of a digital audio file whose playing time is 10 seconds at a sampling rate of 22.05 kHz and a resolution of 8 bits. The file is not compressed.

Solution.
Formula for calculating the size (in bytes) of a digital audio file (monaural sound): (sampling frequency in Hz) * (recording time in seconds) * (resolution in bits) / 8.

Thus, the file is calculated as follows: 22050 * 10 * 8/8 = 220500 bytes.

Self-study assignments

# 1. Determine the amount of memory for storing a digital audio file, the playing time of which is two minutes at a sampling rate of 44.1 kHz and a resolution of 16 bits.

# 2. The user has a memory of 2.6 MB at his disposal. You need to record a 1 minute digital audio file. What should be the sampling rate and bit depth?

No. 3. The free disk space is 5.25 MB, the sound depth of the board is 16. What is the duration of the sound of a digital audio file recorded with a sampling frequency of 22.05 kHz?

No. 4. One minute of a digital audio file takes up 1.3 MB on a disk, the bit depth of the sound card is 8. What is the sampling rate of the sound recorded?

No. 5. Two minutes of recording a digital audio file takes up 5.1 MB on a disc. The sampling rate is 22050 Hz. What is the bit depth of the audio adapter? No. 6. The amount of free memory on the disk is 0.01 GB, the bit depth of the sound card is 16. What is the duration of the sound of a digital audio file recorded with a sampling frequency of 44100 Hz?

Presentation of graphical information.

Bitmap representation.

Basic concepts: Computer graphics, pixel, raster, screen resolution, video information, video memory, graphic file, bit depth, video memory page, pixel color code, graphic primitive, graphic coordinate system.

Computer graphics- a section of informatics, the subject of which is working on a computer with graphic images (pictures, drawings, photographs, video frames, etc.).

Pixel- the smallest element of the image on the screen (dot on the screen).

Raster- a rectangular grid of pixels on the screen.

Screen resolution- the size of the raster grid, specified as a product M * N, where M is the number of dots horizontally, N is the number of dots along the vertical (number of lines).

Video information- information about the image reproduced on the computer screen, stored in the computer memory.

Video memory- random access memory that stores video information during its playback in an image on the screen.

Graphic file- a file that stores information about a graphic image.

The number of colors reproduced on the display screen (K) and the number of bits allocated in the video memory for each pixel (N) are related by the formula: K = 2 N

The quantity N is called bit depth.

Page- a video memory section containing information about one screen image (one "picture" on the screen). Several pages can be located in the video memory at the same time.

All the variety of colors on the screen is obtained by mixing three basic colors: red, blue and green. Each pixel on the screen is made up of three closely spaced elements that glow with these colors. Color displays using this principle are called RGB (Red-Green-Blue) monitors.

The code pixel colors contains information about the proportion of each base color.
If all three components have the same intensity (brightness), then 8 different colors can be obtained from their combinations (2 3). The following table shows the encoding of an 8-color palette using a 3-bit binary code. In it, the presence of the base color is indicated by one, and the absence by zero.

Binary code


TO Z WITH Color
0 0
0
Black
0 0
1
Blue
0 1 0 Green
0 1 1 Blue
1 0
0
Red
1 0
1
Pink
1 1
0
Brown
1 1
1
White

A sixteen-color palette is obtained using 4-bit pixel coding: one bit of intensity is added to the three bits of the base colors. This bit controls the brightness of all three colors at the same time. For example, if in an 8-color palette code 100 means red, then in a 16-color palette: 0100 - red, 1100 - bright red; 0110 - brown, 1110 - bright brown (yellow).

A large number of colors are obtained by separately controlling the intensity of the base colors. Moreover, the intensity can have more than two levels, if more than one bit is allocated to encode each of the basic colors.

When using a bit depth of 8 bits / pixel, the number of colors is 2 8 = 256. The bits of this code are distributed as follows: KKKZZSS.

This means that 3 bits are allocated for the red and green components, and 2 bits for the blue. Therefore, the red and green components have 2 3 = 8 levels of brightness, and the blue - 4 levels.

Vector representation.

In the vector approach, the image is considered as a collection of simple elements: straight lines, arcs, circles, ellipses, rectangles, shades, etc., which are called graphic primitives... Graphic information is data that uniquely identifies all graphic primitives that make up a drawing.

The position and shape of graphic primitives are set in graphics coordinate system related to the screen. Usually the origin is located in the upper left corner of the screen. The pixel grid matches the coordinate grid. The horizontal X-axis runs from left to right; the vertical Y-axis is from top to bottom.

A segment of a straight line is uniquely determined by specifying the coordinates of its ends; circle - center coordinates and radius; polyhedron - the coordinates of its corners, the filled area - with the boundary line and the color of the filling, etc.

Team

Action

Line to X1, Y1

Draw a line from the current position to position (X1, Y1).

Line X1, Y1, X2, Y2

Draw a line with start coordinates X1, Y1 and end coordinates X2, Y2. The current position is not set.

Circle X, Y, R

Draw a circle: X, Y - center coordinates, R - radius length in raster grid steps.

Ellipse X1, Y1, X2, Y2

Draw an ellipse bounded by a rectangle; (X1, Y1) are the coordinates of the upper left corner, and (X2, Y2) are the coordinates of the lower right corner of this rectangle.

Rectangle X1, Y1, X2, Y2

Draw a rectangle; (X1, Y1) are the coordinates of the upper left corner, and (X2, Y2) are the coordinates of the lower right corner of this rectangle.

Paint color COLOR

Set the current drawing color.

Fill color COLOR

Set the current fill color.

Paint over X, Y, BORDER COLOR

Paint over an arbitrary closed shape; X, Y - coordinates of any point inside the closed shape, BORDER COLOR - border line color.

Examples of solved problems.

Example # 1.
To form a color, 256 shades of red, 256 shades of green and 256 shades of blue are used. How many colors can be displayed on the screen in this case?

Solution:
256*256*256=16777216.

Example No. 2.
On a screen with a resolution of 640 * 200, only two-color images are displayed. What is the minimum amount of video memory required to store an image?

Solution.
Since the bit depth of a two-color image is 1, and the video memory must at least contain one page of the image, the amount of video memory is: 640 * 200 * 1 = 128000 bits = 16000 bytes.

Example No. 3.
How much video memory is required to store four pages of an image if the bit depth is 24 and the display resolution is 800 * 600 pixels?

Solution.
To store one page, you need

800 * 600 * 24 = 11,520,000 bits = 1,440,000 bytes. For 4, respectively, 1,440,000 * 4 = 5,760,000 bytes.

Example No. 4.
The bit depth is 24. How many different shades of gray can be displayed on the screen?
Note: A shade of gray is obtained with equal values ​​of the brightness levels of all three components. If all three components have the maximum brightness level, then the color is white; the absence of all three constituents represents black.

Solution.
Since the RGB components are the same for grayscale, the depth is 24/3 = 8. We get the number of colors 2 8 = 256.

Example No. 5.
Given a raster grid 10 * 10. Describe the letter "K" with a sequence of vector commands.

Solution:
In vector representation, the letter "K" is three lines. Any line is described by indicating the coordinates of its ends in the form: LINE (X1, Y1, X2, Y2). The image of the letter "K" will be described as follows:

LINE (4,2,4,8)
LINE (5,5,8,2)
LINE (5,5,8,8)

Tasks for independent work.

# 1. How much video memory is required to store two pages of an image, assuming the display resolution is 640 * 350 pixels and the number of colors used is 16?

# 2. The amount of video memory is 1 MB. Display resolution - 800 * 600. What is the maximum number of colors that can be used if the video memory is split over two pages?

No. 3. The bit depth is 24. Describe several options for the binary representation of light gray and dark gray shades.

No. 4. On the computer screen, you need to get 1024 shades of gray. What should be the bit depth?

No. 5. For the representation of decimal digits in the postal code standard (as they say on envelopes), get a vector and raster representation. Select the size of the raster grid yourself.

No. 6. Reproduce drawings on paper using vector commands. Resolution 64 * 48.

A)
Drawing color Red
Fill Color Yellow
Circumference 16, 10, 2
Paint over 16, 10, Red
Set 16, 12
Line to 16, 23
Line to 19, 29
Line to 21, 29
Line 16, 23, 13, 29
Line 13, 29, 11, 29
Line 16, 16, 11, 12
Line 16, 16, 21, 12

B)
Drawing color Red
Fill color Red
Circumference 20, 10, 5
Circumference 20, 10, 10
Paint over 25, 15, Red
Circumference 20, 30, 5
Circumference 20, 30, 10
Paint over 28, 32, Red

A digital photograph or other raster image is an array of numbers captured by the brightness level sensors in a two-dimensional plane. Knowing that from a mathematical point of view, a thin lens performs Fourier transform of images placed in focal planes, it is possible to create image processing algorithms that are analogous to image processing of a classical optical system.

The formula for such algorithms will look like this:

  1. Z = FFT (X) - Direct 2D Fourier Transform
  2. Z ′ = T (Z) - application of a function or transparency to the Fourier transform of the image
  3. Y = BFT (Z ′) - inverse 2D Fourier transform
Fast discrete Fourier transform algorithms are used to calculate the Fourier transforms. Although the optical lens system performs the Fourier transform on the continuous range of the argument and for the continuous spectrum, when switching to digital data processing, the Fourier transform formulas can be replaced by the discrete Fourier transform formulas.

Implementation examples

  • Image Blur Algorithm
The implemented algorithms are part of the open source FFTTools library. Internet address: github.com/dprotopopov/FFTTools

Image Blur Algorithm

In optical systems, a focal-plane diaphragm is a simple opening in the screen. As a result of the passage of the light flux through the diaphragm, high-frequency waves (with shorter wavelengths) pass through the obstacle, and low-frequency waves (with longer wavelengths) are cut off by the screen. This increases the sharpness of the resulting image. If you replace the hole in the screen with an obstacle in the screen, the result will be a blurry image because it will be formed from the frequencies of long wavelengths.

Algorithm:

  1. Calculate the array Z ′ = T (Z), where T is the zeroing of rows and columns located in the given inner regions of the matrix-argument corresponding to high 5. frequencies (that is, zeroing of the Fourier expansion coefficients corresponding to high frequencies)

Algorithm for sharpening the image

In optical systems, a focal-plane diaphragm is a simple opening in the screen. As a result of the passage of the light flux through the diaphragm, high-frequency waves (with shorter wavelengths) pass through the obstacle, and low-frequency waves (with longer wavelengths) are cut off by the screen. This increases the sharpness of the resulting image.

Algorithm:

  1. Let X (N1, N2) be an array of image pixel brightness.
  2. Calculate Px = Average (RMS) brightness of pixels in array X
  3. Calculate Array Z = FT (X) - Direct 2D Discrete Fourier Transform
  4. Keep the value L = Z (0,0) - corresponding to the average brightness of the pixels of the original image
  5. Calculate the array Z ′ = T (Z), where T is the zeroing of rows and columns located in the given outer regions of the argument matrix corresponding to low frequencies 6. (i.e., zeroing the Fourier expansion coefficients corresponding to low frequencies)
  6. Restore the value Z '(0,0) = L - corresponding to the average brightness of the pixels of the original image
  7. Calculate Array Y = RFT (Z ′) - Inverse 2D Discrete Fourier Transform
  8. Calculate Py = mean (rms) brightness of pixels in array Y
  9. Normalize Y (N1, N2) array to average Px / Py luminance

Image scaling algorithm

In optical systems, the light flux in the focal plane of the system is the Fourier transform of the original image. The size of the image obtained at the output of the optical system is determined by the ratio of the focal distances of the objective and the eyepiece.

Algorithm:

  1. Let X (N1, N2) be an array of image pixel brightness.
  2. Calculate Px = Average (RMS) brightness of pixels in array X
  3. Calculate Array Z = FT (X) - Direct 2D Discrete Fourier Transform
  4. Calculate the array Z ′ = T (Z), where T is either adding zero rows and columns of the matrix corresponding to high frequencies, or removing rows and columns of the matrix corresponding to high frequencies to obtain the required size of the final image
  5. Calculate Array Y = RFT (Z ′) - Inverse 2D Discrete Fourier Transform
  6. Calculate Py = mean (rms) brightness of pixels in array Y
  7. Normalize Y (M1, M2) array to average Px / Py luminance
Software used
  • Microsoft Visual Studio 2013 C # - programming environment and language
  • EmguCV / OpenCV - C ++ library of structures and algorithms for image processing
  • FFTWSharp / FFTW - C ++ library implementing fast discrete Fourier transform algorithms

Image Blur Algorithm

Algorithm code

///

/// Clear internal region of array /// /// Array of values /// Internal blind region size private static void Blind (Complex [,] data, Size size) (int n0 = data.GetLength (0); int n1 = data.GetLength (1); int n2 = data.GetLength (2); int s0 = Math. Max (0, (n0 - size.Height) / 2); int s1 = Math.Max ​​(0, (n1 - size.Width) / 2); int e0 = Math.Min ((n0 + size.Height) / 2, n0); int e1 = Math.Min ((n1 + size.Width) / 2, n1); for (int i = s0; i< e0; i++) { Array.Clear(data, i*n1*n2, n1*n2); } for (int i = 0; i < s0; i++) { Array.Clear(data, i*n1*n2 + s1*n2, (e1 - s1)*n2); } for (int i = e0; i < n0; i++) { Array.Clear(data, i*n1*n2 + s1*n2, (e1 - s1)*n2); } } /// /// Blur bitmap with the Fastest Fourier Transform /// /// Blured bitmap public Bitmap Blur (Bitmap bitmap) (using (var image = new Image (bitmap)) (int length = image.Data.Length; int n0 = image.Data.GetLength (0); int n1 = image.Data.GetLength (1); int n2 = image.Data.GetLength (2); var doubles = new double; Buffer.BlockCopy (image.Data, 0, doubles, 0, length * sizeof (double)); double power = Math.Sqrt (doubles.Average (x => x * x)); var input = new fftw_complexarray (doubles.Select (x => new Complex (x, 0)). ToArray ()); var output = new fftw_complexarray (length); fftw_plan.dft_3d (n0, n1, n2, input, output, fftw_direction. Forward, fftw_flags.Estimate) .Execute (); Complex complex = output.GetData_Complex (); var data = new Complex; var buffer = new double; GCHandle complexHandle = GCHandle.Alloc (complex, GCHandleType.Pinned); GCHandle dataHandle = GCHandle .Alloc (data, GCHandleType.Pinned); IntPtr complexPtr = complexHandle.AddrOfPinnedObject (); IntPtr dataPtr = dataHandle.AddrOfPinnedObject (); Marshal.Copy (complexPtr, buffer, 0; buffer.Length) , dataPtr, buffer.Length); Blind (data, _blind erSize); Marshal.Copy (dataPtr, buffer, 0, buffer.Length); Marshal.Copy (buffer, 0, complexPtr, buffer.Length); complexHandle.Free (); dataHandle.Free (); input.SetData (complex); fftw_plan.dft_3d (n0, n1, n2, input, output, fftw_direction.Backward, fftw_flags.Estimate) .Execute (); double array2 = output.GetData_Complex (). Select (x => x.Magnitude) .ToArray (); double power2 = Math.Sqrt (array2.Average (x => x * x)); doubles = array2.Select (x =>

Algorithm for sharpening the image

Algorithm code

///

/// Clear external region of array /// /// Array of values /// External blind region size private static void Blind (Complex [,] data, Size size) (int n0 = data.GetLength (0); int n1 = data.GetLength (1); int n2 = data.GetLength (2); int s0 = Math. Max (0, (n0 - size.Height) / 2); int s1 = Math.Max ​​(0, (n1 - size.Width) / 2); int e0 = Math.Min ((n0 + size.Height) / 2, n0); int e1 = Math.Min ((n1 + size.Width) / 2, n1); for (int i = 0; i< s0; i++) { Array.Clear(data, i*n1*n2, s1*n2); Array.Clear(data, i*n1*n2 + e1*n2, (n1 - e1)*n2); } for (int i = e0; i < n0; i++) { Array.Clear(data, i*n1*n2, s1*n2); Array.Clear(data, i*n1*n2 + e1*n2, (n1 - e1)*n2); } } /// /// Sharp bitmap with the Fastest Fourier Transform /// /// Sharped bitmap public Bitmap Sharp (Bitmap bitmap) (using (var image = new Image (bitmap)) (int length = image.Data.Length; int n0 = image.Data.GetLength (0); int n1 = image.Data.GetLength (1); int n2 = image.Data.GetLength (2); var doubles = new double; Buffer.BlockCopy (image.Data, 0, doubles, 0, length * sizeof (double)); double power = Math.Sqrt (doubles.Average (x => x * x)); var input = new fftw_complexarray (doubles.Select (x => new Complex (x, 0)). ToArray ()); var output = new fftw_complexarray (length); fftw_plan.dft_3d (n0, n1, n2, input, output, fftw_direction. Forward, fftw_flags.Estimate) .Execute (); Complex complex = output.GetData_Complex (); Complex level = complex; var data = new Complex; var buffer = new double; GCHandle complexHandle = GCHandle.Alloc (complex, GCHandleType.Pinned) ; GCHandle dataHandle = GCHandle.Alloc (data, GCHandleType.Pinned); IntPtr complexPtr = complexHandle.AddrOfPinnedObject (); IntPtr dataPtr = dataHandle.AddrOfPinnedObject (); Marsthal. buffer.Marshal. Copy (buffer, 0, dataPtr, buffer.Le ngth); Blind (data, _blinderSize); Marshal.Copy (dataPtr, buffer, 0, buffer.Length); Marshal.Copy (buffer, 0, complexPtr, buffer.Length); complexHandle.Free (); dataHandle.Free (); complex = level; input.SetData (complex); fftw_plan.dft_3d (n0, n1, n2, input, output, fftw_direction.Backward, fftw_flags.Estimate) .Execute (); double array2 = output.GetData_Complex (). Select (x => x.Magnitude) .ToArray (); double power2 = Math.Sqrt (array2.Average (x => x * x)); doubles = array2.Select (x => x * power / power2) .ToArray (); Buffer.BlockCopy (doubles, 0, image.Data, 0, length * sizeof (double)); return image.Bitmap; ))

Image scaling algorithm

Algorithm code

///

/// Copy arrays /// /// Input array /// Output array private static void Copy (Complex [,] input, Complex [,] output) (int n0 = input.GetLength (0); int n1 = input.GetLength (1); int n2 = input.GetLength (2); int m0 = output.GetLength (0); int m1 = output.GetLength (1); int m2 = output.GetLength (2); int ex0 = Math.Min (n0, m0) / 2; int ex1 = Math.Min (n1 , m1) / 2; int ex2 = Math.Min (n2, m2); Debug.Assert (n2 == m2); for (int k = 0; k< ex2; k++) { for (int i = 0; i <= ex0; i++) { for (int j = 0; j <= ex1; j++) { int ni = n0 - i - 1; int nj = n1 - j - 1; int mi = m0 - i - 1; int mj = m1 - j - 1; output = input; output = input; output = input; output = input; } } } } /// /// Resize bitmap with the Fastest Fourier Transform /// /// Resized bitmap public Bitmap Stretch (Bitmap bitmap) (using (var image = new Image (bitmap)) (int length = image.Data.Length; int n0 = image.Data.GetLength (0); int n1 = image.Data.GetLength (1); int n2 = image.Data.GetLength (2); var doubles = new double; Buffer.BlockCopy (image.Data, 0, doubles, 0, length * sizeof (double)); double power = Math.Sqrt (doubles.Average (x => x * x)); var input = new fftw_complexarray (doubles.Select (x => new Complex (x, 0)). ToArray ()); var output = new fftw_complexarray (length); fftw_plan.dft_3d (n0, n1, n2, input, output, fftw_direction. Forward, fftw_flags.Estimate) .Execute (); Complex complex = output.GetData_Complex (); using (var image2 = new Image (_newSize)) (int length2 = image2.Data.Length; int m0 ​​= image2.Data.GetLength (0); int m1 = image2.Data.GetLength (1); int m2 = image2.Data.GetLength (2); var complex2 = new Complex; var data = new Complex; var data2 = new Complex; var buffer = new double; GCHandle complexHandle = GCHandle.Alloc (complex, GCHandleType.Pinned); GCHandle dataHandle = GCHandle.Alloc (data, GCHandleType.Pinned ); IntPtr complexPtr = complexHandle.AddrOfPinnedObject (); IntPtr dataPtr = dataHandle.AddrOfPinnedObject (); Marshal.Copy (complexPtr, buffer, 0, buffer.Length); Marshal.Copy (buffer, 0, dataLength); buffer complexHandle.Free (); dataHandle.Free (); Copy (data, data2); buffer = new double; complexHandle = GCHandle.Alloc (complex2, GCHandleType.Pinned); dataHandle = GCHandle.Alloc (data2, GCHandleType.Pinned); complexPtr = complexHandle.AddrOfPinnedObject (); dataPtr = dataHandle.AddrOfPinnedObject (); Marshal.Copy (dataPtr, buffer, 0, buffer.Length); Marshal.Copy (buffer, 0, complexPtr, buffer.Length); complexHandle.Free (); dataHandle.Free (); var input2 = new fftw_complexarray (complex2); var output2 = new fftw_complexarray (length2); fftw_plan.dft_3d (m0, m1, m2, input2, output2, fftw_direction.Backward, fftw_flags.Estimate) .Execute (); double array2 = output2.GetData_Complex (). Select (x => x.Magnitude) .ToArray (); double power2 = Math.Sqrt (array2.Average (x => x * x)); double doubles2 = array2.Select (x => x * power / power2) .ToArray (); Buffer.BlockCopy (doubles2, 0, image2.Data, 0, length2 * sizeof (double)); return image2.Bitmap; )))

Signals arrive in the information processing system, as a rule, in a continuous form. For computer processing of continuous signals, it is necessary, first of all, to convert them into digital ones. For this, the operations of sampling and quantization are performed.

Image sampling

Sampling Is the transformation of a continuous signal into a sequence of numbers (samples), that is, the representation of this signal in some finite-dimensional basis. This view consists in projecting a signal to a given basis.

The most convenient from the point of view of the organization of processing and the natural way of sampling is the presentation of signals in the form of a sample of their values ​​(samples) in separate, regularly spaced points. This method is called rasterization, and the sequence of nodes at which samples are taken is raster... The interval through which the values ​​of the continuous signal are taken is called sampling step... The value inverse to the step is called sampling rate,

An essential question arising in the course of sampling: with what frequency to take samples of the signal in order to be able to restore it from these samples? Obviously, if samples are taken too rarely, then they will not contain information about a rapidly changing signal. The rate of change of a signal is characterized by the upper frequency of its spectrum. Thus, the minimum allowable sampling interval is related to the highest frequency of the signal spectrum (inversely proportional to it).

For the case of uniform sampling, it is true Kotelnikov's theorem published in 1933 in the work “On the bandwidth of ether and wire in telecommunications”. It says: if a continuous signal has a frequency-limited spectrum, then it can be completely and unambiguously reconstructed from its discrete samples taken with a period, i.e. with frequency.

Signal recovery is carried out using the function ... Kotelnikov proved that a continuous signal that satisfies the above criteria can be represented as a series:

.

This theorem is also called the sampling theorem. The function is also called counting function or Kotelnikov, although this type of interpolation series was studied by Whitaker in 1915. The counting function has an infinite extent in time and reaches its maximum value, equal to one, at the point relative to which it is symmetrical.

Each of these functions can be viewed as a response to an ideal low pass filter(LPF) on the delta pulse arriving at the moment of time. Thus, to restore a continuous signal from its discrete samples, they must be passed through the corresponding low-pass filter. It should be noted that such a filter is non-causal and physically unrealizable.

The given ratio means the possibility of accurate reconstruction of signals with a limited spectrum from the sequence of their samples. Limited spectrum signals- these are signals, the Fourier spectrum of which is nonzero only within a limited portion of the definition domain. Optical signals can be attributed to them, because The Fourier spectrum of images obtained in optical systems is limited due to the limited size of their elements. The frequency is called Nyquist frequency... This is the cutoff frequency above which there should be no spectral components in the input signal.

Quantizing images

In digital image processing, the continuous dynamic range of luminance values ​​is divided into a number of discrete levels. This procedure is called quantization... Its essence lies in the transformation of a continuous variable into a discrete variable that takes a finite set of values. These values ​​are called quantization levels... In the general case, the transformation is expressed by a step function (Fig. 1). If the intensity of the image sample belongs to the interval (i.e., when ), then the original sample is replaced by the quantization level, where quantization thresholds... It is assumed that the dynamic range of brightness values ​​is limited and equal.

Rice. 1. Function describing quantization

The main task in this case is to determine the values ​​of the thresholds and quantization levels. The simplest way to solve this problem is to divide the dynamic range into equal intervals. However, this is not the best solution. If the intensity values ​​of most of the image samples are grouped, for example, in the "dark" region and the number of levels is limited, then it is advisable to quantize unevenly. In the "dark" region, you should quantize more often, and less often in the "light" region. This will reduce the quantization error.

In digital image processing systems, they strive to reduce the number of levels and quantization thresholds, since the amount of information required to encode an image depends on their number. However, with a relatively small number of levels in a quantized image, false contours may appear. They arise as a result of an abrupt change in the brightness of the quantized image and are especially noticeable in the gentle areas of its change. False contours significantly degrade the visual quality of an image, since human vision is especially sensitive to contours. With uniform quantization, typical images require at least 64 levels.

To tell and show by the example of Pascal: 1) What is absolute and what is it for? 2) What is asm and what is it for? 3) What is

constructor and destructor and what is it for?

4) What is implementation and what is it for?

5) Name the modules Pascal (in the Uses line, for example crt) and what capabilities does this module provide?

6) What is the type of the variable: pointer (Pointer)

7) And lastly: what does the @, #, $, ^ symbol mean

1. What is an object? 2. What is a system? 3. What is the common name of an object? Give an example. 4. What is a single object name? Give an example. 5.

Give an example of a natural system 6. Give an example of a technical system 7. Give an example of a mixed system. 8. Give an example of an intangible system. 9. What is a classification? 10. What is a feature class?

1.23 question - list the modes of operation of subd access:

Creating a table in design mode;
-creating a table using a wizard;
-creating a table by entering data.

2. What is vector format?

3.Can the following be attributed to service programs:
a) disk maintenance programs (copying, disinfecting, formatting, etc.)
b) compression of files on disks (archivers)
c) fight against computer viruses and much more.
I myself think that answer B is right or not?

4. what relates to the properties of the algorithm (a. Discreteness, b. Efficiency c. Mass character, d. Definiteness, d. Feasibility and comprehensibility) - here I think that all the options are correct. Right or wrong?

7 Easy Multiple Choice Test

13. The clock frequency of the processor is:

A. the number of binary operations performed by the processor per unit of time

B. the number of pulses generated in one second that synchronize the operation of computer nodes

C. the number of possible processor accesses to RAM per unit of time

D. the speed of information exchange between the processor and input / output devices

14.Specify the minimum required set of devices for the computer:

A. printer, system unit, keyboard

B. processor, RAM, monitor, keyboard

C. processor, streamer, hard drive

D. monitor, system unit, keyboard

15. What is a microprocessor?

A. integrated microcircuit, which executes commands arriving at its input and controls

Computer work

B. a device for storing those data that are often used in work

C. device for outputting text or graphic information

D. alphanumeric data output device

16. User interaction with the software environment is carried out using:

A. operating system

B. file system

C. applications

D. file manager

17. The user can directly control the software from

With the help:

A. operating system

B. GUI

C. user interface

D. file manager

18. Methods of storing data on a physical medium is determined by:

A. operating system

B. application software

C. file system

D. file manager

19. Graphical environment on which objects and controls of the Windows system are displayed,

Created for the convenience of the user:

A. hardware interface

B. user interface

C. desktop

D. programming interface

20. The speed of your computer depends on:

A. CPU clock speed

B. the presence or absence of a connected printer

C. Organization of the operating system interface

D. external storage space

Analog and discrete image. Graphic information can be presented in analog or discrete form. An example of an analog image is a painting canvas, the color of which changes continuously, and an example of a discrete image, a drawing printed using an inkjet printer, consisting of separate dots of different colors. Analog (oil painting). Discrete.

Slide 11 from presentation "Coding and processing of information"... The size of the archive with the presentation is 445 KB.

Informatics grade 9

summaries of other presentations

Forking Algorithms - IF condition, THEN action. What do we know. Lesson structure. Forking algorithm. Follow the algorithm and fill in the table. A student who scored from 85 to 100 points, inclusive, passes to the second round of the competition. Enter the number of points and determine if he made it to the second round. Find the largest number between a and b. Write a program in a programming language. A branching algorithm is an algorithm in which, depending on a condition, either one or another sequence of actions is performed.

"Creation of Artificial Intelligence" - The Simulation Approach. Approaches to building artificial intelligence systems. An evolutionary approach. Artificial Intelligence. Can cohabit with many people, helping to cope with personal problems. Structural approach. Logical approach. Development problems. Development prospects and areas of application.

Cyclic programs - Digit. Loop with precondition. Find the amount. Loop with postcondition. Loop with parameter. Euclid's Algorithm. Cyclic programs. Find the sum of natural numbers. Cycle concept. An initial fee. Tabulation function. Calculate. Example. Dividers. Informatics. Find the number of numbers. Find. Find the number of three-digit natural numbers. Three-digit numbers. Find the set of values ​​of the function. Dollar conversion table.

"What is Email" - Sender. E-mail address. Email history. The issue of the emergence of e-mail. The structure of the letter. Mail routing. Letter. Email. Copy. Date. X-mailer. Email. How email works.

"Working with e-mail" - E-mail address. Mailbox. Email protocol. File-sharing network. Separation of addresses. Benefits of email. Mail clients. The inventor of email. The address. Email. Software for working with e-mail. How email works. Teleconference. Mail server. File exchange.

"Processing in Photoshop" - Cool guys. How to distinguish a fake. Raster and vector images. Introduction. Top places. Adobe Photoshop program. Retouching. Photoshop contests. Brightness correction. My friends. The practical part. Similar programs. Main part. Design. Unusual animals. Montage of several images.

Top related articles