当前位置: 首页 > news >正文

怎样建设的网站好优化好排名朝阳区seo搜索引擎优化怎么样

怎样建设的网站好优化好排名,朝阳区seo搜索引擎优化怎么样,wordpress去掉头像,上国外网站用什么dns相关文章 PIL,OPENCV之间的转换关系_pil cvtcolor(image)_番茄就要炒鸡蛋的博客-CSDN博客 python GDAL和PIL图像转换_gdal.readasarray和pil_llc的足迹的博客-CSDN博客 一、原始数据 二、分别读取数据 1、gdal读取的array 2、pil读取的array 三、 gdal转pil image …

相关文章

PIL,OPENCV之间的转换关系_pil cvtcolor(image)_番茄就要炒鸡蛋的博客-CSDN博客

python GDAL和PIL图像转换_gdal.readasarray和pil_llc的足迹的博客-CSDN博客

一、原始数据

二、分别读取数据

1、gdal读取的array 

2、pil读取的array

 

三、 gdal转pil

image= np.rollaxis(image , 0, 3)

 转换结果

总的代码 

用gdal库读取tif影像并填充边缘,并根据窗口大小滑动裁剪裁剪

​
def clip_picture(file_path,a):slide_window = 1024  # 大的滑动窗口step_length = 1024sat_list = os.listdir(file_path) for file in sat_list:Image_Path = os.path.join(file_path,file)image=gdal.Open(Image_Path)width = image.RasterXSizeheight = image.RasterYSize# image = Image.open(Image_Path)# width = image.size[0]  # 获取图像的宽# height = image.size[1]  # 获取图像的高right_fill = step_length - (width % step_length)bottom_fill = step_length - (height % step_length)width_path_number = int((width + right_fill) / step_length)  # 横向切成的小图的数量height_path_number = int((height + bottom_fill) / step_length)  # 纵向切成的小图的数量#print(width_path_number, height_path_number)# image = np.array(image)image=image.ReadAsArray()if a=='tif':image= np.rollaxis(image , 0, 3)image = cv2.copyMakeBorder(image, top=0, bottom=bottom_fill, left=0, right=right_fill,borderType=cv2.BORDER_CONSTANT, value=0)image = cv2.copyMakeBorder(image, top=step_length // 2, bottom=step_length // 2, left=step_length // 2,right=step_length // 2,borderType=cv2.BORDER_CONSTANT, value=0)  # 填充1/2步长的外边框# 2.将膨胀后的大图按照滑窗裁剪tar = './dataset/train/'target=tarimage_crop_addr = target  # 图像裁剪后存储的文件夹# image = Image.fromarray(image)  # 将图片格式从numpy转回PILimage=Image.fromarray(np.uint8(image))l = 0if a=='tif':for j in range(height_path_number):for i in range(width_path_number):box = (i * step_length, j * step_length, i * step_length + slide_window, j * step_length + slide_window)small_image = image.crop(box)small_image.save(image_crop_addr + file[:-4] + '({},{})@{:04d}_sat.tif'.format(j, i, l), quality=95)l = l + 1if a=='png':for j in range(height_path_number):for i in range(width_path_number):box = (i * step_length, j * step_length, i * step_length + slide_window, j * step_length + slide_window)small_image = image.crop(box)small_image.save(image_crop_addr + file[:-4] + '({},{})@{:04d}_mask.png'.format(j, i, l), quality=95)l = l + 1​

http://www.tj-hxxt.cn/news/124387.html

相关文章:

  • 游戏开发需要学什么大学专业百度seo原理
  • 做网站时背景图片浮动刷关键词怎么刷
  • 网站群建设指导意见大型网站建设方案
  • 做盗链电影网站怎么样厦门谷歌seo公司有哪些
  • 做网站里面内容编写2023最火的十大新闻
  • 注册公司在哪个网站系统谷歌下载
  • 做网站的例子推广计划书怎么写
  • 三明市建设局网站百度2022年版本下载
  • 药监局网站建设方案怎么做网站教程
  • 旅游网站开发的结论seo网络营销推广公司
  • 企业网站seo价格武汉大学人民医院精神科
  • 公司网站建设推广方案网站推广seo是什么
  • 宁晋做网站上海网络排名优化
  • 威客做的比较好的网站广告推广赚钱在哪接
  • 专做中医教学网站一个平台怎么推广
  • 高尔夫 wordpress网络推广的优化服务
  • 广州网站制作企业企业培训内容
  • 镇江网站建设工作室宁波网站建设推广公司价格
  • 自己做副业可以抢哪个网站电脑版百度网盘
  • 拌合站建站方案广州网络营销推广公司
  • 二级域名网站价格站长工具一区
  • 在百度怎么做网站和推广产品推广图片
  • 网站目录做外链北京网站优化服务
  • 陕西做网站公司哪家好青岛seo网站排名
  • 建设部执业注册网站网络推广专员所需知识
  • 外国一些做环保袋的网站公司官网模板
  • 自己做装修网站产品怎么做市场推广
  • 怎么通过做网站挣钱宁德市属于哪个省
  • 如何编辑html网页关键词排名优化公司成都
  • 网站建设公司推广企业网站优化哪家好