- 博客(6)
- 收藏
- 关注
原创 用数组形式修改rgb某一点的像素值
首先,将RGB转换为三维数组,并将红绿蓝三通道分别提取出来,同时获取图片的高度与宽度。image = Image.open(src_file)# print(type(image))img = np.array(image) # 将图片转换成数组形式print(img.shape) # 数组形式的图片是hwcimg_red = img[:, :, 0]img_green = img[:, :, 1]img_blue = img[:, :, 2]height, width = img_
2021-10-10 16:34:25
508
原创 中值滤波-多通道
from PIL import Imageimport numpy as npfrom matplotlib import pyplot as pltfrom numpy.compat.py3k import npy_load_moduledef median_filter(in_file: str, out_file: str, filter_size: int): image = Image.open(in_file) img = np.array(image) p.
2021-10-10 16:10:23
504
原创 python使用外部.shp进行水陆掩膜
进行掩膜需要了解:读shp、读tif、掩膜提取、最后掩膜取反1、读shp、读tif、掩膜提取在arcgis中,可以直接读shp、读tif,因此我们整个水陆掩膜在arcgis自带的python2.7中实现。关于如何用python在arcgis中实现相应操作,下面给出示例:选择相应操作-点击工具帮助-代码示例这样我们就可以很快地学习相应操作以及原理,至于批量化就使用for循环即可。可参考下面链接的博客进行批量操作:使用arcgis按掩膜批量处理MODIS.tif数据提取研究区.shp边界的pyt
2021-07-02 21:26:14
3242
3
原创 python批量处理海面温度(.nc)数据
新手初学python,想用博客记录一下研究方向海洋遥感对于海importnumpyasnpimportmatplotlib.pyplotaspltimportcartopy.crsasccrsimportcartopy.featureascfeaturefromcartopy.mpl.tickerimportLongitudeFormatter,LatitudeFormatterimportnetCDF4asncf1=nc....
2021-06-18 16:10:32
4710
1
空空如也
空空如也
TA创建的收藏夹 TA关注的收藏夹
TA关注的人