0-value compensation solution for RGB image pixels

Source: Internet
Author: User
Tags crop image

With the development of remote sensing technology, more and more methods are available to obtain image data. The application of RGB image data is particularly outstanding. After obtaining images, data preprocessing is the first thing to bear the brunt. This is tedious and mechanized, but it is still very important. For row slices or RGB data that have undergone initial processing, there is no spectral information, and only the corresponding R, G, and B band information is available, during data pre-processing-Mosaic, color deviation and pixel 0 values may occur. However, as a geographic map production, such data results do not meet the requirements. Therefore, further post-processing is required, this includes color equalization and replacement of pixel 0 values.

This section describes how to replace or compensate a pixel value of 0. The software used is the bandmath tool under envi. The condition is used to find the position of the 0-value pixel and the value of the adjacent image element, so as to fill in the 0-value vertex.

Cause of pixel 0 after image mosaic

The image data pre-processing process is like the metadata re-sampling process. In the re-sampling process, because the original image spectral information and feature information are missing, during the mosaic re-sampling process, the loss of some information makes the Image Element value that is similar to that of the background 0 0 0 when the image is re-sampled. See 1, 2


Figure 1Multi-spectral data mosaic results

 

Figure 2 result of RGB band combination Mosaic

From the comparison between values 1 and 2, we can clearly see that the mosaic results of the multi-spectral band combination do not show the image element values with the same background value as 0, therefore, when ArcGIS ignores the background value display, the image data results are displayed normally. When the combination data is embedded in the RGB band, a value of 0 is displayed, which is the same as the value of 0 in the background. This indicates that due to the loss of band information, when the image is embedded, the spectral information is incomplete, resulting in an error in the calculation of the Image Element value during re-sampling, resulting in inconvenience in subsequent basemap production. In order to better apply the image data to production, we recommend that you use the full-band data provided by the image whenever possible during image processing, otherwise it will cause a lot of inconvenience to subsequent operations.

How to compensate/replace the negative value of a pixel with the neighboring Value

In order for the geographical map to be better applied to production and displayed to the audience, the adjacent value of the pixel with 0 value must be compensated, in this article, the basic tool bandmath in ENVI/IDL is used to restrict conditional statements for filling null values. The procedure is as follows:

1. Single-band null Filling

Use the following tools: envi> basic tools> bandmath

Input statement principle: if b1 EQ 0 then begin B1 + DN

            Endif else begin

             B1 * 1

            Endelse

In the bandmath dialog box, enter: (b1 EQ 0) * (b1 + DN) + (b1 Ne 0) * B1

B1 represents the R, G, or B channel of the image data, and DN represents the correction value that needs to be entered in the value area.

The adjacent image element of the null point pixel is R: 11, G: 0, and B: 50. Fill in the value of a single band according to the preceding solution.

2. band combination

Tools used: envi> basic tools> layer stacking>... Import band1, band2, and band3 files according to the RGB format...> Output file name and click OK.

The above operation sequence is for the case where all three bands need to input the DN value. For bands whose remediation value is 0, you can directly select the band from the original image.

Tools used: envi> basic tools> layer stacking>... Select the band according to the RGB sequence (see figure 1) and click OK. Repeat the preceding operations to select other band data...> Output file name, click OK

 

Figure 3 How to Select a band from the original image

3. Administrative border data Cropping

Tools used:

1) read the image file ENVI> File> open image file

    2) ENVI> File> open vector File> .... Availble vectors list> export lyers to ROI> select the image file to be cropped> OK ......

    3) crop the image file ENVI> basic tools> subset data via ROIs>... Select the corresponding parameter settings (see figure 2)...> Queue

    4) Batch cropping: You can repeat the preceding three steps to crop image data in other regions. After repeated operations, click: ENVI> File> ENVI Queue Manager> select all> execute selected (see figure 3.

 

           Figure 4 parameter settings                     Figure 5 batch processing page

4. Result Display

 

Figure 6 empty point compensation results

 

Note ::

Projection may occur during vector data import. If the projection coordinates of Xi'an 8 or BEIJING 54 are not set in ENVI, import these parameters, the projection settings of different bins are defined before the projection information can be correctly read.

When the preceding operations are completed, a dialog box is displayed when vector data is imported. This dialog box is used to convert a file in the shpefile format. for files in the EVF format, note the projection operation. Check whether the datum of the Data projection corresponds to the Xi'an 80 COORDINATE. If yes, click OK.

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.