Remove invalid values for Image Data

Source: Internet
Author: User

Remove invalid values for Image Data

When using raster data, black and white borders are quite confusing. The following is ugly:

So how to deal with these problems? The method is not unique. I will list the most common methods In ArcMap TO HELP YOU "make up" the data, or, more specifically, "Cosmetic ":

 

 

Option 1 raster Calculator

What is the first thing you need to know before going to the Black edge? You can use the Identify tool to query and view data. For example, this data is 0.

At this time, you may think of setting the background color of the layer, right?

If we use only for display purposes, we can solve the problem. However, in the traditional sense, we generally understand the processing of raster data, that is to say, modify the specific value from the storage (in this example, It is 0) to Nodata.

It is often easier to process data in a single band. The most common tool isRaster Calculator. Raster Calculator can calculate the Raster layers in the current data box by using the input Python syntax expression. It is a very practical raster data processing tool. If you want to Dive InHereUnderstand how Raster Calculator works.

For example, you only need a simple expression in this requirement and use the SetNull function, as shown below:

The expression isSetNull ("RasterLayer" = 0, "RasterLayer ")

In this way, after the tool is executed, all 0 values become Nodata, And the Black edge is completely removed.

Option 2 image analysis window

Multi-band data is also subject to black borders, and the reality is often not as ideal as single-band data. It can be done with only one expression. For example, the commonly used image basemap data usually has three bands, which are represented by a group of values including the RGB three bands, for example (0,255,129 ). I usually give different solutions and suggestions based on the amount of data to be processed:

Also, the first step is to confirm what the Black edge value is? In this example, it is (0, 0, 0)

 

Image Analysis is available in the Windows menu of ArcMap. In the Processing Section of the Image Analysis window, you can assign functions or function chains to the layers in the current data box to process the raster data in real time.

In the pop-up window, right-click the fx row to insert a Function. For example, the Mask Function is used in this requirement.

Set the Mask Function. The combination of (0, 0, 0) is invalid. Why choose All instead of Any? This answer is quite explicit. At the same time, the image element value of 0 is invalid. Otherwise, it is not valid, for example (1,255, 0. Or the 0 values in each band are in the and relationship, rather than the or relationship.

In this way, the new raster layer with a function will automatically add the TOC of ArcMap, which looks like everything is fine. However, it should be noted that this layer needs to be Export to a location on the hard disk, it is still temporary data. When the layer is removed, this result will no longer exist.

Therefore, the last important step is to export data.

 

( ̄)This method is also applicable to scenarios with multiple invalid values.. For example, in addition to (0, 0), it also contains (255,255,255 ):

All we need to do is to add the raster function. In the Function Template Editor, the functions are connected sequentially, like a Chain connected by a ring, so it is called "Function Chain/Function Chain". Finally, it seems that the question is gone. Continue to see how to set invalid values:

In this way, the two groups of invalid values are removed.

Option 3 mosaic Dataset

What if the data in front of you is not one, but "a lot? This method is suitable for "many" and "many "......

The mosaic dataset of ArcGIS is an ideal and Practical Image Data Management model. It is also a good choice to "process" a large amount of raster data.

Create an embedded dataset in the geographical database and add the data to the embedded dataset. Then:

In this article, we will not go into details about the preparations before "after", but you can seeThis articleLearn about this.

In the embedded Dataset, you can use the Define Mosaic Dataset Nodata tool to Define invalid data values. <喎?http: www.bkjia.com kf ware vc " target="_blank" class="keylink"> VcD4NCjxwPjxpbWcgYWx0PQ = "here write picture description" src = "http://www.bkjia.com/uploads/allimg/160204/04034131W-15.png" title = "\"/>

In this way, invalid values are deleted in batches.

The embedded dataset itself also supports raster functions. Similar to setting function templates in the image data window, you can also set function chains to meet complex requirements.

For more information about built-in dataset functions, see this article.

In summary, raster calculators are preferred for a single band. Image Analysis windows can be used for multiple bands. If the data volume is large, mosaic datasets are recommended.

Although ArcGIS Desktop is not a platform specializing in Image Data Processing, its functions can solve common problems of image processing to a large extent. I wrote this article because many users have encountered similar problems and it makes sense to summarize them. I hope to give you some ideas. Next time you encounter such problems, try it on your own.

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.