程序師世界是廣大編程愛好者互助、分享、學習的平台,程序師世界有你更精彩!
首頁
編程語言
C語言|JAVA編程
Python編程
網頁編程
ASP編程|PHP編程
JSP編程
數據庫知識
MYSQL數據庫|SqlServer數據庫
Oracle數據庫|DB2數據庫
您现在的位置: 程式師世界 >> 編程語言 >  >> 更多編程語言 >> Python

Python remote sensing image processing application (19): GDAL +numpy batch processing of remote sensing image peripheral background values

編輯:Python

1. Problem description

Recently downloaded some remote sensing image data , These data contain a large number of peripheral background data , As shown in the figure below :

The peripheral background values are 0 value .

This article describes the use of python Batch process peripheral background , Keep only the smallest peripheral background area .

Here's the picture :

2. Realize the idea

The basic idea is as follows :

Firstly, the coordinates of the four corners of the data area in the remote sensing image are obtained , The coordinates here are represented by row and column numbers , Upper left corner (x1,y1), Upper right corner (x2,y2), The lower left corner (x3,y3), The lower right corner (x4,y4). We need to get the row and column numbers of the four corners by traversing the remote sensing data .

then , Calculate the range of four ranges according to the quadrangular coordinates , namely left,top,right,bottom value .

Method 1 : after , Obtain the coordinates of the upper left corner and the lower right corner respectively :(left,top),(right,bottom). Last read (left,top),(right,bottom) Data in scope , Rewrite and save to a new image . There is a problem with the result of this calculation , The coordinate range of the image will change . Therefore, it is not advisable , It should be calculated as the latitude and longitude coordinate range , Then cut according to the longitude and latitude range .

Method 2: Calculate the boundary range with longitude and latitude as the unit according to the above coordinate values of four points 


  1. 上一篇文章:
  2. 下一篇文章:
Copyright © 程式師世界 All Rights Reserved