说明

做无人机数据。

流程

1、获取jpg的经纬度信息,只需要第一张图像的即可。
2、两张图像寻找相似匹配点,得到转换矩阵,得到第二张影像相对于第一张影像的位置信息。
3、拼接两张影像,计算两张影像共同区域中有影像和无影像的区域,保留其有影像的区域,并且裁剪掉两张都无影像的区域。
4、再赋予最初的经纬度坐标信息。

代码

先写了两张影像拼成一张图的方法。

"""
输入的拼接图像需要分辨率,坐标系,以及表现形式保持一致
"""
def data_combine(data1,data2,output_dir):""":param data1: 输入影像1:param data2: 输入影像2:param output_dir: 输出影像"""gtif_driver = gdal.GetDriverByName("GTiff")im1 = gdal.Open(data1)im2 = gdal.Open(data2)im1_width = im1.RasterXSize  # 栅格矩阵的列数im1_height = im1.RasterYSize  # 栅格矩阵的行数im2_width = im2.RasterXSizeim2_height = im2.RasterYSizeim_bands = im1.RasterCount  # 波段数ori_transform_1 = im1.GetGeoTransform()  # 坐标ori_transform_2 = im2.GetGeoTransform()print(ori_transform_1, ori_transform_2)base_band1 = []for j in range(0, im_bands):in_band = im1.GetRasterBand(j + 1)base_band1.append(in_band)base_band2 = []for j in range(0, im_bands):in_band = im2.GetRasterBand(j + 1)base_band2.append(in_band)# 输入数据的左上角坐标和右下角坐标im1_x1 = ori_transform_1[0]im1_y1 = ori_transform_1[3]im1_x2 = ori_transform_1[0] + im1_width * ori_transform_1[1]im1_y2 = ori_transform_1[3] - im1_height * ori_transform_1[1]im2_x1 = ori_transform_2[0]im2_y1 = ori_transform_2[3]im2_x2 = ori_transform_2[0] + im2_width * ori_transform_2[1]im2_y2 = ori_transform_2[3] - im2_height * ori_transform_2[1]# 输出图像的长宽new_width = int((max(im1_x2, im2_x2) - min(im1_x1, im2_x1)) / ori_transform_1[1])new_height = int((min(im1_y2, im2_y2) - max(im1_y1, im2_y1)) / ori_transform_1[5])# 创建新图new_image = gtif_driver.Create(output_dir, new_width, new_height, im_bands,base_band1[0].DataType)#  设置新的坐标系分辨率new_transform = (min(im1_x1, im2_x1), ori_transform_1[1], ori_transform_1[2], max(im1_y1, im2_y1), ori_transform_1[4],ori_transform_1[5])# 设置裁剪出来图的原点坐标new_image.SetGeoTransform(new_transform)# 设置SRS属性(投影信息)new_image.SetProjection(im1.GetProjection())array1 = []array2 = []for i in base_band1:array1.append(i.ReadAsArray(0, 0, im1_width, im1_height))for i in base_band2:array2.append(i.ReadAsArray(0, 0, im2_width, im2_height))new_array = np.zeros(((im_bands, new_height, new_width)))print(new_array.shape)# 图像赋值chang1 = int((im1_x1 - min(im1_x1, im2_x1)) / ori_transform_1[1])kuang1 = int((max(im1_y1, im2_y1) - im1_y1) / ori_transform_1[1])for k in range(im_bands):for i in range(new_height):for j in range(new_width):if i >= kuang1 and j >= chang1:try:new_array[k, i, j] = array1[k][(i - kuang1), (j - chang1)]except:passchang2 = int((im2_x1 - min(im1_x1, im2_x1)) / ori_transform_1[1])kuang2 = int((max(im1_y1, im2_y1) - im2_y1) / ori_transform_1[1])for k in range(im_bands):for i in range(new_height):for j in range(new_width):if i >= kuang2 and j >= chang2:try:if array2[k][i - kuang2, j - chang2] == 0:passelse:new_array[k, i, j] = array2[k][i - kuang2, j - chang2]except:passfor j in range(im_bands):new_image.GetRasterBand(j + 1).WriteArray(new_array[j])

实际使用后发现存在很多问题

  1. 最大的问题是无人机数据都是JPG格式的,不能用gdal的方法来读取里面的坐标信息。、
  2. 其次就是按照坐标信息拼出来的结果会存在断层感。

因此结合网上读取JPG坐标的方法,以及图像的相似点匹配的方法,从新修改。

将某个文件夹下的图像按名称顺序拼接(相邻两张图必须存在一定重合处,否则找不到相似点

之后的图像经纬度不能超过第一张图



代码如下

import cv2
import numpy as np
import os
import time
import re
import exifread
import math
from osgeo import gdal,osrclass Stitcher:# 两图拼接函数def Stitch(self, images, ratio=0.75, reprojThresh=4.0):# 获取输入图片(imageB, imageA) = images# 检测A、B图片的SIFT关键特征点,并计算特征描述子(kpsA, featuresA) = self.detectAndDescribe(imageA)(kpsB, featuresB) = self.detectAndDescribe(imageB)# 匹配两张图片的所有特征点,返回匹配结果M = self.matchKeypoints(kpsA, kpsB, featuresA, featuresB, ratio, reprojThresh, method=method)# 如果返回结果为空,没有匹配成功的特征点,退出算法if M is None:print("youwenti")return None# 否则,提取匹配结果# H是3x3视角变换矩阵(matches, H, status) = M# 将图片A进行视角变换,result是变换后图片result = cv2.warpPerspective(imageA, H, (imageA.shape[1] + imageB.shape[1], imageA.shape[0] + imageB.shape[0]))# 将图片B传入result图片最左端print(imageB.shape[0],imageB.shape[1])start = time.time()# result[0:imageB.shape[0], 0:imageB.shape[1]] = imageBfor i in range(imageB.shape[0]):for j in range(imageB.shape[1]):if imageB[i,j][0] != 0:result[i,j] = imageB[i,j]# 图像太大了,做个像素值判断maxX = imageB.shape[0]maxY = imageB.shape[1]for i in range(int(imageB.shape[0]*3/4),result.shape[0]):for j in range(int(imageB.shape[1]*3/4),result.shape[1]):# print(result[i,j])if result[i,j][0] != 0:if i > maxX:maxX = iif j > maxY:maxY = jend = time.time()print(end - start)result = result[0:maxX, 0:maxY]return (result)def detectAndDescribe(self, image):# 将彩色图片转换成灰度图gray = cv2.cvtColor(image, cv2.COLOR_BGR2GRAY)# 建立SIFT生成器descriptor = cv2.xfeatures2d.SIFT_create()# 检测SIFT特征点,并计算描述子(kps, features) = descriptor.detectAndCompute(gray, None)# 将结果转换成NumPy数组kps = np.float32([kp.pt for kp in kps])# 返回特征点集,及对应的描述特征return (kps, features)def matchKeypoints(self, kpsA, kpsB, featuresA, featuresB, ratio, reprojThresh):  # Flann匹配# 建立Flann匹配器FLANN_INDEX_KDTREE = 1index_params = dict(algorithm=FLANN_INDEX_KDTREE, trees=5)search_params = dict(checks=50)flann = cv2.FlannBasedMatcher(index_params, search_params)rawMatches = flann.knnMatch(featuresA, featuresB, k=2)matches = []for m in rawMatches:# 当最近距离跟次近距离的比值小于ratio值时,保留此匹配对if len(m) == 2 and m[0].distance < m[1].distance * ratio:# 存储两个点在featuresA, featuresB中的索引值matches.append((m[0].trainIdx, m[0].queryIdx))# 当筛选后的匹配对大于4时,计算视角变换矩阵if len(matches) > 4:# 获取匹配对的点坐标ptsA = np.float32([kpsA[i] for (_, i) in matches])ptsB = np.float32([kpsB[i] for (i, _) in matches])# 计算视角变换矩阵(H, status) = cv2.findHomography(ptsA, ptsB, cv2.RANSAC, reprojThresh)# 返回结果return (matches, H, status)# 如果匹配对小于4时,返回Nonereturn Nonedef find_GPS_image(pic_path):GPS = {}date = ''with open(pic_path, 'rb') as f:tags = exifread.process_file(f)for tag, value in tags.items():if re.match('GPS GPSLatitudeRef', tag):GPS['GPSLatitudeRef'] = str(value)elif re.match('GPS GPSLongitudeRef', tag):GPS['GPSLongitudeRef'] = str(value)elif re.match('GPS GPSAltitudeRef', tag):GPS['GPSAltitudeRef'] = str(value)elif re.match('GPS GPSLatitude', tag):try:match_result = re.match('\[(\w*),(\w*),(\w.*)/(\w.*)\]', str(value)).groups()Latitude = int(match_result[0]), int(match_result[1]), int(match_result[2])except:deg, min, sec = [x.replace(' ', '') for x in str(value)[1:-1].split(',')]Latitude = latitude_and_longitude_convert_to_decimal_system(deg, min, sec)elif re.match('GPS GPSLongitude', tag):try:match_result = re.match('\[(\w*),(\w*),(\w.*)/(\w.*)\]', str(value)).groups()Longitude = int(match_result[0]), int(match_result[1]), int(match_result[2])except:deg, min, sec = [x.replace(' ', '') for x in str(value)[1:-1].split(',')]Longitude = latitude_and_longitude_convert_to_decimal_system(deg, min, sec)return Longitude,Latitudedef latitude_and_longitude_convert_to_decimal_system(*arg):"""经纬度转为小数, param arg::return: 十进制小数"""return float(arg[0]) + ((float(arg[1]) + (float(arg[2].split('/')[0]) / float(arg[2].split('/')[-1]) / 60)) / 60)# x,y经纬度, from_epsg, to_epsg分别代表你原始的坐标系EPSG和你要转化的EPSG
def xy2proj(x, y, from_epsg, to_epsg):source = osr.SpatialReference()source.ImportFromEPSG(from_epsg)target = osr.SpatialReference()target.ImportFromEPSG(to_epsg)ct = osr.CoordinateTransformation(source, target)coords = ct.TransformPoint(x, y)#输出为转换好的经纬度return coords[0],coords[1]
# EPSG:32650 WGS 84 / UTM zone 50N
# EPSG:4326 WGS 84 -- WGS84 - World Geodetic System 1984, used in GPS# 主程序
## 先读第一张图的坐标信息,第一张图作为起始图,其坐标一定要位于最左上角,所以图像命名要按名称顺序修改后,将第一张图的坐标信息读取出来,等拼接图像完成后再赋给拼接后的图
path = r"J:\42"
first_path = r"J:\42\DJI_0527.JPG" # 第一张左上角图路径
lon1,lat1 = find_GPS_image(first_path) # 得到它的左上角经纬度
drx1,dry1 = xy2proj(lat1, lon1,4326,32650) # 将经纬度转换成投影坐标
print("将经纬度:",lon1,lat1,"转换成投影坐标:",drx1,dry1)
output_dir = r"J:\42\output.dat"
dpi = 0.06995 # 图像分辨率,可以通过无人机高程和焦距等算出,我这里直接给## 读取拼接图片
while True:path_list =[]for _ in os.listdir(path):path_list.append(path+ "\\"+_)if len(path_list) == 1: # 只有一张图了,可以出图了img = cv2.imread(path_list[0], 1)new_width = img.shape[0]new_height = img.shape[1]im_bands = 3# 创建新图gtif_driver = gdal.GetDriverByName("GTiff")new_image = gtif_driver.Create(output_dir, new_height, new_width, im_bands,1)#  设置新的坐标系分辨率new_transform = (drx1, dpi, 0.0, dry1, -0.0,dpi*(-1))# 设置裁剪出来图的原点坐标new_image.SetGeoTransform(new_transform)# 设置SRS属性(投影信息)这里直接给投影信息pro = 'PROJCS["WGS 84 / UTM zone 50N",GEOGCS["WGS 84",DATUM["WGS_1984",SPHEROID["WGS 84",6378137,298.257223563,AUTHORITY["EPSG","7030"]],AUTHORITY["EPSG","6326"]],PRIMEM["Greenwich",0],UNIT["Degree",0.0174532925199433]],PROJECTION["Transverse_Mercator"],PARAMETER["latitude_of_origin",0],PARAMETER["central_meridian",117],PARAMETER["scale_factor",0.9996],PARAMETER["false_easting",500000],PARAMETER["false_northing",0],UNIT["Meter",1],AXIS["Easting",EAST],AXIS["Northing",NORTH]]'new_image.SetProjection(pro)for j in range(im_bands):new_image.GetRasterBand(j + 1).WriteArray(img[:,:,j])break # 可以结束了,跳出循环imageA =cv2.imread(path_list[0], 1)imageB =cv2.imread(path_list[1], 1)print("开始拼接:  " + path_list[1])# 把图片拼接成全景图stitcher = Stitcher()result = stitcher.Stitch([imageA, imageB])# 删除已拼接的2张图os.remove(path_list[0])os.remove(path_list[1])# 将拼接结果以第二张图的名称命名cv2.imwrite(path_list[1],result)

缺陷:

  1. 第一就是拼接图的第一张坐标(经纬度)必须在左上角。
  2. 根据相似匹配,连续的图必须有重合部分。
  3. 没有空三校正,对于一些形变可能效果不好。
  4. 效率较低。

更新内容

1、由于需要不断的计算有无影像区域和裁剪,因此效率很低,去掉这些内容,不使用cv2.warpPerspective方法。直接计算所有匹配点的位置平均差值来计算相对位置信息。效率会提高,消耗资源也会少些。
2、不用从左上角开始,需要从左边开始。

更新代码

import cv2
import numpy as np
import os
import time
import re
import exifread
import math
from osgeo import gdal,osrclass Stitcher:# 两图拼接函数def Stitch(self, images, ratio=0.75, reprojThresh=4.0):# 获取输入图片(imageB, imageA) = images# 检测A、B图片的SIFT关键特征点,并计算特征描述子(kpsA, featuresA) = self.detectAndDescribe(imageA)(kpsB, featuresB) = self.detectAndDescribe(imageB)# 匹配两张图片的所有特征点,返回匹配结果M = self.matchKeypoints(kpsA, kpsB, featuresA, featuresB, ratio, reprojThresh)# 如果返回结果为空,没有匹配成功的特征点,退出算法if M is None:print("两张图不存在共同点")return None# 否则,提取匹配结果# H是3x3视角变换矩阵(matches, H, status) = M# 生成匹配图片_height,_weight = self.Matche_point(kpsA, kpsB, matches, status)# _height:imageB与imageA宽度之差# _weight:imageB与imageA长度之差if _weight > 0:if _height < 0: # B图不在最上(分以下两种情况)if imageB.shape[1] < (imageA.shape[1] + _weight):new_image = np.zeros((imageB.shape[0]-_height ,imageA.shape[1]+_weight, 3), dtype="uint8")print('''———————————————————————————|imageA                     |———————————————————+————————————————————————   ||imageB             |                        |  ||                    ————————————————————————+——|                                            |————————————————————————————————————————————''')if imageB.shape[1] >= (imageA.shape[1] + _weight):new_image = np.zeros((imageB.shape[0] - _height, imageB.shape[1], 3), dtype="uint8")print('''—————————————————————|imageA               |———————————————————+—————————————————————+——|imageB             |                     |  ||                    —————————————————————   ||                                            |————————————————————————————————————————————''')new_image[-_height:imageB.shape[0]-_height, 0      :imageB.shape[1]        ] = imageBnew_image[0       :imageA.shape[0]        , _weight:_weight+imageA.shape[1]] = imageAelse: # 正常情况(分以下四种情况)if imageB.shape[0] < (imageA.shape[0] + _height) and imageB.shape[1] < (imageA.shape[1] + _weight):new_image = np.zeros((imageA.shape[0] + _height, imageA.shape[1] + _weight, 3), dtype="uint8")print('''————————————————————————————————————|imageB                              ||               —————————————————————+——————|              |imageA               |      |——————————————+—————————————————————       ||                            |————————————————————————————''')if imageB.shape[0] >= (imageA.shape[0] + _height) and imageB.shape[1] < (imageA.shape[1] + _weight):new_image = np.zeros((imageB.shape[0], imageA.shape[1] + _weight, 3), dtype="uint8")print('''————————————————————————————————————|imageB         —————————————————————|——————|              |imageA               |      ||              |                     |      ||              |                     |      ||               —————————————————————+—————————————————————————————————————————''')if imageB.shape[0] < (imageA.shape[0] + _height) and imageB.shape[1] >= (imageA.shape[1] + _weight):new_image = np.zeros((imageA.shape[0] + _height, imageB.shape[1], 3), dtype="uint8")print('''———————————————————————————————————————————|imageB                                     ||               —————————————————————       ||              |imageA               |      |——————————————+—————————————————————+——————|                     |—————————————————————''')if imageB.shape[0] >= (imageA.shape[0] + _height) and imageB.shape[1] >= (imageA.shape[1] + _weight):new_image = np.zeros((imageB.shape[0], imageB.shape[1], 3), dtype="uint8")print('''———————————————————————————————————————————|imageB                                     ||               —————————————————————       ||              |imageA               |      ||               —————————————————————       ||                                           |———————————————————————————————————————————''')new_image[0      :imageB.shape[0]        , 0      :imageB.shape[1]        ] = imageBnew_image[_height:imageA.shape[0]+_height, _weight:imageA.shape[1]+_weight] = imageAreturn (new_image)else:print("第一张图不在最左")return Nonedef detectAndDescribe(self, image):# 将彩色图片转换成灰度图gray = cv2.cvtColor(image, cv2.COLOR_BGR2GRAY)# 建立SIFT生成器descriptor = cv2.xfeatures2d.SIFT_create()# 检测SIFT特征点,并计算描述子(kps, features) = descriptor.detectAndCompute(gray, None)# 将结果转换成NumPy数组kps = np.float32([kp.pt for kp in kps])# 返回特征点集,及对应的描述特征return (kps, features)def matchKeypoints(self, kpsA, kpsB, featuresA, featuresB, ratio, reprojThresh):  # Flann匹配# 建立Flann匹配器FLANN_INDEX_KDTREE = 1index_params = dict(algorithm=FLANN_INDEX_KDTREE, trees=5)search_params = dict(checks=50)flann = cv2.FlannBasedMatcher(index_params, search_params)rawMatches = flann.knnMatch(featuresA, featuresB, k=2)matches = []for m in rawMatches:# 当最近距离跟次近距离的比值小于ratio值时,保留此匹配对if len(m) == 2 and m[0].distance < m[1].distance * ratio:# 存储两个点在featuresA, featuresB中的索引值matches.append((m[0].trainIdx, m[0].queryIdx))# 当筛选后的匹配对大于4时,计算视角变换矩阵if len(matches) > 4:# 获取匹配对的点坐标ptsA = np.float32([kpsA[i] for (_, i) in matches])ptsB = np.float32([kpsB[i] for (i, _) in matches])# 计算视角变换矩阵(H, status) = cv2.findHomography(ptsA, ptsB, cv2.RANSAC, reprojThresh)# 返回结果return (matches, H, status)# 如果匹配对小于4时,返回Nonereturn Nonedef Matche_point(self, kpsA, kpsB, matches, status):ave_weight = []ave_height = []for ((trainIdx, queryIdx), s) in zip(matches, status):# 当点对匹配成功时,获取匹配点坐标if s == 1:# 匹配对ptA = (int(kpsA[queryIdx][0]), int(kpsA[queryIdx][1]))ptB = (int(kpsB[trainIdx][0]), int(kpsB[trainIdx][1]))ave_weight.append(ptB[0]-ptA[0])ave_height.append(ptB[1]-ptA[1])# 根据所有的匹配点,求位置差的均值_weight = int(sum(ave_weight)/len(ave_weight))_height = int(sum(ave_height)/len(ave_height))# print(weight,height)return [_height,_weight]def find_GPS_image(pic_path):GPS = {}date = ''with open(pic_path, 'rb') as f:tags = exifread.process_file(f)for tag, value in tags.items():if re.match('GPS GPSLatitudeRef', tag):GPS['GPSLatitudeRef'] = str(value)elif re.match('GPS GPSLongitudeRef', tag):GPS['GPSLongitudeRef'] = str(value)elif re.match('GPS GPSAltitudeRef', tag):GPS['GPSAltitudeRef'] = str(value)elif re.match('GPS GPSLatitude', tag):try:match_result = re.match('\[(\w*),(\w*),(\w.*)/(\w.*)\]', str(value)).groups()Latitude = int(match_result[0]), int(match_result[1]), int(match_result[2])except:deg, min, sec = [x.replace(' ', '') for x in str(value)[1:-1].split(',')]Latitude = latitude_and_longitude_convert_to_decimal_system(deg, min, sec)elif re.match('GPS GPSLongitude', tag):try:match_result = re.match('\[(\w*),(\w*),(\w.*)/(\w.*)\]', str(value)).groups()Longitude = int(match_result[0]), int(match_result[1]), int(match_result[2])except:deg, min, sec = [x.replace(' ', '') for x in str(value)[1:-1].split(',')]Longitude = latitude_and_longitude_convert_to_decimal_system(deg, min, sec)return Longitude,Latitudedef latitude_and_longitude_convert_to_decimal_system(*arg):"""经纬度转为小数, param arg::return: 十进制小数"""return float(arg[0]) + ((float(arg[1]) + (float(arg[2].split('/')[0]) / float(arg[2].split('/')[-1]) / 60)) / 60)# x,y经纬度, from_epsg, to_epsg分别代表你要转化的EPSG
def xy2proj(x, y, from_epsg, to_epsg):source = osr.SpatialReference()source.ImportFromEPSG(from_epsg)target = osr.SpatialReference()target.ImportFromEPSG(to_epsg)ct = osr.CoordinateTransformation(source, target)coords = ct.TransformPoint(x, y)#输出为转换好的经纬度return coords[0],coords[1]
# EPSG:32650 WGS 84 / UTM zone 50N
# EPSG:4326 WGS 84 -- WGS84 - World Geodetic System 1984, used in GPS# 主程序
if __name__ == "__main__":# # 输入数据文件夹路径path = r"J:\42"# # 输出数据文件路径output_dir = r"J:\42\output.dat"# # 图像的地物分辨率dpi = 0.06995# # 设置SRS属性(投影信息)pro = 'PROJCS["WGS 84 / UTM zone 50N",GEOGCS["WGS 84",DATUM["WGS_1984",SPHEROID["WGS 84",6378137,298.257223563,AUTHORITY["EPSG","7030"]],AUTHORITY["EPSG","6326"]],PRIMEM["Greenwich",0],UNIT["Degree",0.0174532925199433]],PROJECTION["Transverse_Mercator"],PARAMETER["latitude_of_origin",0],PARAMETER["central_meridian",117],PARAMETER["scale_factor",0.9996],PARAMETER["false_easting",500000],PARAMETER["false_northing",0],UNIT["Meter",1],AXIS["Easting",EAST],AXIS["Northing",NORTH]]'# # 获取所有图像的经纬度lon = []lat = []for _ in os.listdir(path):lon1,lat1 = find_GPS_image(path+ "\\"+_)lon.append(lon1)lat.append(lat1)print('经度',lon,'纬度',lat)drx1, dry1 = xy2proj(lat[0], lon[0], 4326, 32650)# 读取拼接图片while True:path_list =[]for _ in os.listdir(path):path_list.append(path+ "\\"+_)if len(path_list) == 1: # 只有一张图了,可以出图了img = cv2.imread(path_list[0], 1)new_width = img.shape[0]new_height = img.shape[1]im_bands = 3# 创建新图gtif_driver = gdal.GetDriverByName("GTiff")new_image = gtif_driver.Create(output_dir, new_height, new_width, im_bands,1)#  设置新的坐标系分辨率new_transform = (drx1, dpi, 0.0, dry1, -0.0,dpi*(-1))# 设置裁剪出来图的原点坐标new_image.SetGeoTransform(new_transform)new_image.SetProjection(pro)for j in range(im_bands):new_image.GetRasterBand(j + 1).WriteArray(img[:,:,j])print("拼接完成")breakimageA =cv2.imread(path_list[0], 1)imageB =cv2.imread(path_list[1], 1)print("开始拼接:  " + path_list[1])# 把图片拼接成全景图stitcher = Stitcher()result = stitcher.Stitch([imageA, imageB])if result is None:break# 删除已拼接的2张图os.remove(path_list[0])os.remove(path_list[1])cv2.imwrite(path_list[1],result)del path_listdel imageAdel imageBdel result

运行结果(图像太大不展示,效率提升两倍多):

用gdal做遥感影像拼接相关推荐

  1. gdal进行遥感影像读写_如何使用遥感影像进行矿物勘探

    gdal进行遥感影像读写 Meet Jose Manuel Lattus, a geologist from Chile. In the latest Soar Cast, he discusses ...

  2. 基于c语言的遥感图像处理,基于GDAL的遥感影像显示(C#版)

    在matlab中实现遥感影像和shp文件的结合显示 clc;close all;clear; road=shaperead('boston_roads.shp'); %读取shape文件 figure ...

  3. python/gdal处理遥感影像(读取、投影转换、裁剪、建立图像金字塔等)

    python/gdal处理遥感影像(读取.投影转换.裁剪.建立图像金字塔等) gdal库简单介绍 python使用gdal 一.安装python环境 二.安装gdal库 三.使用gdal处理遥感影像 ...

  4. Python地学分析 — GDAL对遥感影像重投影

    欢迎关注博主的微信公众号:"智能遥感". 该公众号将为您奉上Python地学分析.爬虫.数据分析.Web开发.机器学习.深度学习等热门源代码. 本人的GitHub代码资料主页(持续 ...

  5. 8影像计算ndvi landsat_使用GDAL读取遥感影像的信息

    读取影像数据集的元数据 GDAL已经提供了足够方便的函数,可以读取影像的一些元数据信息, 从而方便对数据进行处理.GDAL一般是以字典的形式对元数据进行组织的, 但是对于不同的栅格数据类型,元数据的类 ...

  6. 原创程序|基于GDAL的遥感影像批量处理工具介绍(三)

    本文主要介绍基于C#+GDAL-Python实用工具开发的遥感影像批量处理工具,该工具目前主要包括影像批量切片生成KML文件和影像批量切片生成Tiles文件.该工具.Net框架版本为4.0,GDAL版 ...

  7. 【文献阅读】用GAN来做遥感图像的变化检测(M. A. Lebedev等人,ISPRS,2018)

    一.背景 文章题目:<Change Detection In Remote Sensing Images Using Conditional Adversarival Networks> ...

  8. python 遥感影像拼接

    python实现遥感影像的拼接 from osgeo import gdal, gdalconstdef RasterMosaic():inputrasfile1 = gdal.Open(" ...

  9. gis影像格式img转为ecw_ecw格式遥感影像拼接时会有影像吗

    满意答案 ArcGIS是能够支持*.tif格式的! 以下是ArcGIS所支持的所有栅格格式,你可以考虑将你的数据转换为以下任何一种格式,都支持. Rasters: ADRG Image (.IMG) ...

最新文章

  1. VMware 虚拟化编程(5) — VixDiskLib 虚拟磁盘库详解之一
  2. QQ登录的那些坑(如何开发qq登陆功能)
  3. 【Tensorflow】io 操作
  4. 汉字转拼音(c#) -转载
  5. Web安全——正方教务系统自主选课非正常退课解决方案(危险操作,仅用于学习)
  6. SqlBulkCopy加了事务真的会变快吗?
  7. python +appium实现原理_python_appium使用原理
  8. leetcode1353. 最多可以参加的会议数目(贪心算法)
  9. C语言课后习题(45)
  10. new jQuery.common
  11. SpringBoot集成Redis来实现缓存技术方案
  12. xdroid on linux 黑屏,常见问题及解决方案
  13. 升级工作环境并支持C++17
  14. 静态路由配置全面详解,静态路由快速入门指南
  15. MacOs使用IDEA自带的maven教程
  16. 李开复针对马加爵事件写给中国学生的一封信
  17. Newtonsoft.Json.JsonConvert.SerializeObject()
  18. HTML入门---慕课网
  19. 【Demo3d】Visual类对象操作常用方法
  20. 2011-MVP-OpenDay“聚首云端 智领未来”

热门文章

  1. Leetcode Hot100不熟练题目 72. 编辑距离
  2. 胖虎白话学习设计模式之依赖倒置原则(Dependence Inversion Principle)
  3. [计算机-好软推荐]证件照制作的利器,不会PS也没有关系
  4. 分享微信公众号运营助手,可以在手机上回复粉丝留言
  5. Substance Designer 基础 Blend 节点
  6. Bruno组件使用对比
  7. FileReader和BufferedReader的区别
  8. 什么是FLV格式,及FLV格式如何应用
  9. 基于人工智能的智慧校园助手(springboot+springcloud+redis+vue+vant ui+element ui+mysql+Elasticsearch+RabbitMQ项目)
  10. python中range()函数