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

山东公司网站推广优化优化推广网站怎么做最好

山东公司网站推广优化,优化推广网站怎么做最好,网站关键字怎么写,做网站西域数码阿里云相关文章 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.khdw.cn/news/65039.html

相关文章:

  • 宜春seo网站推广怎么设置自己的网站
  • 如何做网站顶级域名企业搜索引擎优化
  • 网站开发专科毕业论文范文范文会计培训机构
  • 东莞黄页企业名录无锡网站建设优化公司
  • 建筑公司网站md0095设计风格网络服务合同
  • 网站怎么做seo、项目推广方式有哪些
  • 泰安网站建设制作电话号码网站推广工具
  • 沈阳网站制作优化沧州网站建设推广
  • 广东建设继续教育网站营销咨询公司排名前十
  • 抖音代运营报价明细网站优化北京seo
  • 网站 默认页seo网站编辑是做什么的
  • 中软国际软件培训怎么样优化大师免费版下载
  • 自己如何做独立网站网页制作免费模板
  • vps做自己的网站南宁seo推广公司
  • 网站使用mip后效果怎么样谷歌google官网
  • 高端网站建设好的公司seo去哪里学
  • 做一个网站链接怎么做系统优化app
  • 西安牛二网络科技有限公司seo怎么优化
  • wordpress 充值宁波seo公司推荐
  • Drupal对比WordPress深圳seo推广
  • 开发网站的财务分析今日百度小说排行榜
  • 做办公室的网站第一营销网
  • 设计网站推广方案友情链接是什么
  • 网站怎么做电脑系统下载长沙网站优化seo
  • 阿里自助建站平台爱站网关键词查询工具
  • 建设雅马哈摩托车官方网站2023b站推广大全
  • 做网站开发一般用什么语言b站推广平台
  • 在哪做网站专业网络营销软文范例大全800
  • 日本wifi网站网站没有友情链接
  • 购物网站建设和使用网络营销战略