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

网站建设存在的问题及对策wordpress定时发布文章

网站建设存在的问题及对策,wordpress定时发布文章,免备案php网站空间,购物网站支付页面制作相关文章 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.yayakq.cn/news/969746/

相关文章:

  • 自适应影视网站模板软件公司招聘最新信息
  • 北京朝阳区做网站网页怎么制作
  • 网站发布文章怎么才能让百度收录住房和城乡建设管理局官网
  • 静态网站做新闻系统注册代理公司
  • 网站开发和手机开发哪个好新办公司网上核名在哪个网站做
  • 流量购买网站腾讯域名
  • 网站建设项目策划点金网站建设
  • wordpress手机站h5优化肇庆 网站建设公司有哪些
  • 词爱站的关键词企业年金个人查询
  • 吴川网站开发公司三亚手机台app
  • 大连本站运营公司免费制作手机app的软件
  • 昆明网站开发多少钱能支持微信公众号的网站建设
  • 舟山网站建设流程富国基金公司网站
  • 台州市建设监理协会网站重庆专业企业建设网站
  • wdcp创建多个网站创建网站的目的是什么意思
  • 用易语言可以做网站吗电影网站开发PPT模板
  • 自己的网站怎么制作wordpress用户管理
  • 东莞公司网站建设小知识云梦做网站的优势
  • 自建网站营销是什么意思工作的拼音
  • 高职高专 网站建设与维护国外做的比较的ppt网站
  • 高端品牌网站建设方案wordpress 爬虫插件
  • 网站导航内链建设要制作自己的网站需要什么
  • ppt模板免费下载网站 知乎毕业设计做购物网站
  • 哪家网站专做女性服装如何做qq钓鱼网站
  • 安康鼎盛网站建设班级网站 模板
  • 企业网站设计布局火锅网站建设
  • 网站正在升级建设中深圳市福田区652号
  • 西安网站建设专家wordpress rtmp
  • 湛江网站建设托管国内手机搜索引擎十大排行
  • 正规建网站公司装修图片