Professional programming part2

05tue

wps36

Multiplied by 1.0 so int * int! = 0

today: scaling and associated computer graphics

Known: currentdataset

ask for: scaling the two directions, save path, resampling (Necessary) to output an image to the reference cycle (Inverse) method to get the original pixel

The argument is being passed inside the class: The class constructor (in need) / define a static global variables (assignment with before, statement)

Transform into buffer, rasterband readraster

dataset in → dataset out (calculated output) → three cycles (cycle forget band)

provider in rotation and has two bmp

05thu

Cut out

"Rubber banding" (as the screenshot), dynamic effects just simply cut and change readraster parameters writeraster and simple

1. The spatial extent;

2.band

Regular and irregular cut cut distinction between irregular crop the image first find the smallest rectangle, with a shape cut, we cut the pixels, (cut to achieve a shape vector data?)

Requirements: from space and band cut the required data

Known: currentdataset

Unknown: cutting requirements (rectangle coordinates (size, position determination pop MessageBox), one-dimensional array to determine cutting pass band, (mouse interaction acquired thumbnail)), seven save path argument

Interface design →

Four constructors, three mouse event function (rubber band),

temp thumbnail ready, drawing current box for replacement, mouse move would trigger a move, temp g canvas painted on a red box, determine who is great who is small (backwards), the temp with a red box attached to, restored to the base map with no red box, or see the effect of imagery

Which added function class

Window is still a class, special class

Secondary Development of Components, Controls

Constructor

05tue

Mom did not remember what the lesson, take half the time to finish the work What the hell? ? ?

A poor image, make up your own,

Histogram, or directly reflects partial light dim image, the histogram processing to improve visualization, (equalization transform) this figure is not displayed, but also to change the image linkage, ENVI histogram stretch on a canvas, in the occurrence frequency max y-axis position of that line,

Histogram equalization: count the number of pixel gray value calculated cumulative distribution → 0-1 (multiplied by 255 (tensile)) → (dimension 255 is formed in the new pixel value)

Fucking amazing, because gray 0-255 itself, the proportion of the value of each pixel in fact, is to highlight the main pixel values, giving new pixel values ​​later showed that contrast, the truth should be the case, the principle you look cold and indifferent

06thu

        public static bool Balance

            (Bitmap srcBmp, out Bitmap dstBmp)

        {

            if (srcBmp == null)

            {

                dstBmp = null;

                return false;

            }

            int [] histogramArrayR = new int [256]; // number of pixels of each gray level R

            int [] histogramArrayG = new int [256]; // number of pixels in each gray scale G

            int [] histogramArrayB = new int [256]; // number of pixels of each gray level B

            int[] tempArrayR = new int[256];

            int[] tempArrayG = new int[256];

            int[] tempArrayB = new int[256];

            byte[] pixelMapR = new byte[256];

            byte[] pixelMapG = new byte[256];

            byte[] pixelMapB = new byte[256];

            dstBmp = new Bitmap(srcBmp);

            Rectangle rt = new Rectangle(0, 0, srcBmp.Width, srcBmp.Height);

            BitmapData bmpData = dstBmp.LockBits(rt, ImageLockMode.ReadWrite, PixelFormat.Format24bppRgb);

            unsafe

            {

                // count the number of pixels in each gray level

                for (int i = 0; i < bmpData.Height; i++)

                {

                    byte* ptr = (byte*)bmpData.Scan0 +

                        i * bmpData.Stride;

                    for (int j = 0; j < bmpData.Width; j++)

                    {

                        histogramArrayB[*(ptr + j * 3)]++;

                        histogramArrayG[*(ptr + j * 3 + 1)]++;

                        histogramArrayR[*(ptr + j * 3 + 2)]++;

                    }

                }

                // Calculation of each gray level cumulative distribution function

                for (int i = 0; i < 256; i++)

                {

                    if (i != 0)

                    {

                        tempArrayB[i] = tempArrayB[i - 1] +

                            histogramArrayB[i];

                        tempArrayG[i] = tempArrayG[i - 1] +

                            histogramArrayG[i];

                        tempArrayR[i] = tempArrayR[i - 1] +

                            histogramArrayR[i];

                    }

                    else

                    {

                        tempArrayB[0] = histogramArrayB[0];

                        tempArrayG[0] = histogramArrayG[0];

                        tempArrayR[0] = histogramArrayR[0];

                    }

                    // calculate the cumulative probability function, and the value within 0 to zoom to 255

                    pixelMapB[i] = (byte)(255.0 * tempArrayB[i]

                        / (BmpData.Width * bmpData.Height) + 0.5); // add to 0.5 rounded to the nearest integer

                    pixelMapG[i] = (byte)(255.0 * tempArrayG[i]

                        / (bmpData.Width * bmpData.Height) + 0.5);

                    pixelMapR[i] = (byte)(255.0 * tempArrayR[i]

                        / (bmpData.Width * bmpData.Height) + 0.5);

                }

                // mapping transformation

                for (int i = 0; i < bmpData.Height; i++)

                {

                    byte* ptr = (byte*)bmpData.Scan0 +

                        i * bmpData.Stride;

                    for (int j = 0; j < bmpData.Width; j++)

                    {

                        *(ptr + j * 3) = pixelMapB[*(ptr + j * 3)];

                        *(ptr + j * 3 + 1) = pixelMapG[*(ptr + j * 3 + 1)];

                        *(ptr + j * 3 + 2) = pixelMapR[*(ptr + j * 3 + 2)];

                    }

                }

            }

            dstBmp.UnlockBits(bmpData);

            return true;

        }

it seems that the extent not to rely on single-handedly write me a complete code, much worse, much worse, oh my god ,,,,,

07tue

unsafe

c # abandon pointer,

Histogram equalization process:

Principle: cumulative distribution function based on gray, and then stretched to a probability distribution 0-255,

A loaded image is known, data structures, bubble sort, binary search

By passing the constructor

Screen coordinates and the coordinates of mathematics in turn, began to draw the horizontal axis.

There vector layer feature, coordinate (x, y) to the screen as a canvas, based on the pixel screen coordinates

Videos just a straight draw bar, and a little bit on the Y axis is painted or alternatively, for circulation, than the size of alternative max

& 07thu image sharpening smoothing filter (also considered an image intensifier)

To haze algorithm ( "")

Denoising (image filtering) Gaussian (every pixel, the appearance position specific, random noise extrema value) and pepper (black sesame random appearance position, the value of almost) traveling in pattern noise and additive noise, Note: filtering algorithms are generic template ,

Mean filtering principle: a pixel to be processed to a predetermined template, with a picture frame retention effect

Distance: Euclidean distance, chessboard distance

Noise present in the image is generated or the transmission time Zeyang Zeyang,

Most KNN few clothes, k-means process the first boundary of the spherical aberration, the reordering interpolation, and then averaged (only interpolation for comparison)

Interpolating a subscript

Pixel border width subscript why three by three is taken outside by 1,5 accordance Fifth 2

Tang Yu Peng type def, and the index value stored together

08tue

Image transformation

Fourier Transform & PCA transformation

Spatial domain (gray value) in the frequency domain →

Fourier: any continuous periodic signal can be set by a suitable combination of sinusoids (different amplitude, frequency, phase) is made. Some complete? ? nonono impossible, terrible mathematician, Laplace, Lagrange. . . . . . . . . . . . . . . . Unable to form a sinusoidal curve, a time domain, spatial domain, frequency domain with angular

Time as a reference, in another reference to observe, the world eternal, music, sound generated by the vibration changes over time, the music does not move, it concluded: in the time domain is dynamic, in the frequency domain is stationary ,

Throughout the spatial domain, and

Professional teachers is the online piece of Daniel Porter

In the first paper draw a sin (x), not necessarily standard, meaning almost on the line. It is not difficult.

Well, next draw a + sin (5x) graphics sin (3x).

Not to mention the standard non-standard, and when rising curve when you do not necessarily fall painting, right?

Well, it does not matter painting does not come out, I sin (3x) + sin (5x) curves to you, but only if you do not know the equation of the curve, now you need to sin (5x) I took to go from Turi What to see the rest yes. It is basically impossible.

But in the frequency domain it? It is very simple, nothing more than a few vertical lines only.

So many seemingly impossible in the time domain of mathematical operations, on the contrary it is easy in the frequency domain. This is where the need Fourier transform. In particular, the removal of some specific frequency component from a curve, this is called filtering in engineering, is one of the most important concepts in signal processing, only in the frequency domain can be easily done.

Besides a more important, but uses slightly more complex - solving differential equations. (This bit difficult, not read can skip directly to this) I do not have too much the importance of differential equations introduced. All walks of life to use. But solving differential equations but it is a very troublesome thing. Because in addition to calculate addition, subtraction, but also to calculate the differential calculus. The Fourier transform you can make differential and integral in the frequency domain becomes multiplication and division, university mathematics moment there is no change elementary school arithmetic.

Fourier analysis of course there are other more important uses, as we talk with the mention.

08thu

laoshishuodishizhoule

datasetin get first band

The band read a byte [] years,

The two-dimensional Fourier transform byte [] Parameters

And then generating a phase, amplitude,

Generate bmp paste into

        /// <summary>

        /// The band images, the image acquisition amplitude dimensional Fourier transform

        /// </summary>

        /// <param name = "ds"> input image </ param>

        /// <param name = "bandIndex"> Band No. </ param>

        /// <returns> band in the frequency domain amplitude image </ returns>

        private Bitmap getAmplitudeBitmap(Dataset ds, int bandIndex)

        {

            // Declare image data buffer, the size of the image width * height

            // get the first call GetRasterBand band bandIndex

            // read data to the band buffer

            // declare FT_Complex type of imaginary array, the size of the image width * height

            // call the two-dimensional fast Fourier transform, the need for coordinate displacement. The imaginary array incoming image buffer, a Fourier transform return

            // declare temporary array

            // array of imaginary variable transformation, and taking the amplitude coefficients, assigned to a temporary array

            // temporary array gradation drawing

            // find the maximum and minimum values

            // proportionality coefficient, stretched to a temporary array 0-255

            // Create Bitmap, the size of the image width * height, the value of the stretched filled Pixel

            // Create a Bitmap return

        }

11tue

A main filter component (PCA)

How to get the mask image? ? ? ? ? ? ? ? ? ? ? ? ? ?

11thu

Remote sensing image classification

Supervised classification / unsupervised classification / classification post-processing /

Supervised classification steps:

1. Select training samples;

2. Choose the appropriate classification algorithm;

Calculating the distance of the center pixel with the class,

3. Evaluation classification; (porphyroclasts combined expansion of corrosion)

Interface design: there are pictures, lack of sample (interactive), Threshold

Supervised classification algorithms: minimum distance discrimination / probability discriminant function / parallel hexagon discrimination method (first-come ratio) / maximum likelihood method /

Advantages and disadvantages: can decide the classification, control the selection of the sample, but subjective, linked with the classification accuracy,

Picturebox attached at a panel, set properties AutoScroll, autoSize picturebox property set, so that images can be realized depending on the actual size of the window changes size image, and can automatically appear slider, sliding window panel;

wps37

The constructor is to obtain

Of the displayed image classification, rather than to classify all seven bands

Azimuth frequency domain filtering of the filter frequency

c # garbage collection mechanism, the pointer is not destroyed has not been released, memory is occupied, or an access violation or memory leaks,

Their status of being occupied, to define a memory cycle, a regular release, improve the stability of the code, the disadvantage is

Pointer flexibility to bring instability

dispose()

flushcashe () This can not be deleted,

Clearance required skill points:

New energy projects, correctly cited gdal library, able to analyze problems, split into conventional treatment step, the treatment step into the code, debugging

After compiling and linking generate app.config

Profile,

dll dynamic link library

Java: jr package jdk / jre development kits / cross-platform runtime environment

API interface

Cross-Platform, Standard C

gdal path to go along with exe

wps38

Classes and Objects

A class contains member properties and member functions

hey man

Your image enhancement, image transformation, image classification has a problem, work out all bugs

Topics in the end is what? ? Is the study of the relationship between surface temperature and vegetation coverage, what does it matter? ? Or quantitative,

B yourself

B YOUESELF

YES THATS RIGHT DEFINITALLY RIGHT

Guess you like

Origin www.cnblogs.com/heikejingxiao/p/11269411.html