easyidp.geotiff.GeoTiff¶
- class easyidp.geotiff.GeoTiff(file_path: str | Path | None = None, imarray: ndarray | None = None, header: dict | None = None, mask: ndarray | None = None)¶
A easy GeoTiff class warpped on rasterio
- __init__(file_path: str | Path | None = None, imarray: ndarray | None = None, header: dict | None = None, mask: ndarray | None = None)¶
The method to initialize the GeoTiff class
- 参数:
tif_path (None| str | pathlib.Path, optional) -- the path to geotiff file, by default None, specify if need to open existing geotiff file
imarray (np.ndarray) -- The pixel data of GeoTIFF if format of (height, width, bands)
header (dict) -- The profile / meta information of geotiff file, including size, bands, CRS, etc
Transparent_layer (None | int, optional) -- the transparent or alpha layer of given GeoTiff file, by default None | None: no alpha layer | 0-x : specific alpha layer | -1 : the last layer
示例
>>> import easyidp as idp >>> test_data = idp.data.TestData() >>> dom = idp.GeoTiff(test_data.pix4d.lotus_dom)
Methods
__init__([file_path, imarray, header, mask])The method to initialize the GeoTiff class
convert_from_affine([target_bounds])Convert from affine rotation storage to standard storage.
Convert from standard storage to affine rotation storage.
crop_polygon(polygon_hv[, is_geo, ...])从 GeoTIFF 中裁剪给定的多边形
crop_rectangle(left, top, w, h[, is_geo, ...])从 GeoTIFF 图像文件中提取矩形区域裁剪。
crop_rois(roi[, is_geo, save_folder, ...])通过给定的 <ROI> 对象,从 GeoTIFF 中裁剪多个具有多边形和多边形名称的 ROI
crop_shapely_polygon(shapely_polygon[, ...])Crop a given polygon from geotiff, the base function of cropping geotiff
geo2pixel(polygon_hv[, return_index])Convert geo coordinate (lon, lat) to geotiff pixel coordinate (horizontal, vertical).
has_data()Check if the geotiff has data
open(tif_path)打开并获取 GeoTIFF 的元信息(头文件)
pixel2geo(polygon_hv)Convert geotiff pixel coordinate or index (horizontal, vertical) to geo coordinate (x, y).
point_query(points_hv[, is_geo])获取给定点的像素值
polygon_math([polygon_hv, is_geo, kernel])计算给定多边形内的值
save(save_path[, overwrite, apply_mask, ...])Save GeoTiff as tiff file with proper nodata/mask handling.
set_mask_polygon(polygon[, is_geo])Set mask from polygon coordinates.
Attributes
快速访问
self.header['crs'],请通过header字典更改值快速访问
self.header['dim'],请通过header字典更改值Check if this GeoTiff has an alpha channel.
快速访问
self.header['height'],请通过header字典更改值Access to the pixel values in the type of numpy ndarray
Boolean mask where True indicates valid (non-nodata) pixels.
Get the mask as polygon coordinates.
Get mask polygon in geo coordinates.
Get mask polygon in pixel coordinates.
快速访问
self.header['nodata'],请通过header字典更改值快速访问
self.header['scale'],请通过header字典更改值快速访问
self.header['tie_point'],请通过header字典更改值Check if this GeoTiff uses affine rotation storage.
快速访问
self.header['width'],请通过header字典更改值The file path of current GeoTiff, pathlib.Path object
GeoTIFF 的元信息
- convert_from_affine(target_bounds: tuple | None = None) GeoTiff¶
Convert from affine rotation storage to standard storage.
Returns a NEW GeoTiff object with the rotated imarray transformed back to axis-aligned coordinates, with a mask for the valid region. The original object is not modified.
- 参数:
target_bounds (tuple, optional) -- (min_x, min_y, max_x, max_y) for the output image bounds. If None, uses the bounding box of mask_polygon.
- 返回:
New GeoTiff object in standard mode. Returns self if already standard.
- 返回类型:
- 抛出:
ValueError -- If no mask polygon is available for conversion.
示例
>>> gtiff = idp.GeoTiff('affine_file.tif') >>> gtiff.use_affine True >>> standard_gtiff = gtiff.convert_from_affine() >>> standard_gtiff.use_affine False >>> gtiff.use_affine # Original unchanged True
- convert_to_affine() GeoTiff¶
Convert from standard storage to affine rotation storage.
Returns a NEW GeoTiff object with imarray aligned to the mask polygon rectangle, and transform including rotation. The original object is not modified.
Requires mask_polygon to be a valid rectangle (4 vertices, 90° angles).
- 返回:
New GeoTiff object in affine mode. Returns self if already affine.
- 返回类型:
- 抛出:
ValueError -- If no mask polygon is set or polygon is not a valid rectangle.
示例
>>> gtiff = idp.GeoTiff('input.tif') >>> gtiff.set_mask_polygon(rect_coords, is_geo=True) >>> affine_gtiff = gtiff.convert_to_affine() >>> affine_gtiff.use_affine True >>> gtiff.use_affine # Original unchanged False
- crop_polygon(polygon_hv, is_geo=True, save_path: str | Path | None = None, return_geotiff: bool = False, use_affine: bool = False)¶
从 GeoTIFF 中裁剪给定的多边形
- 参数:
polygon_hv (numpy nx2 array) -- (horizontal, vertical) points
is_geo (bool, optional) -- 给定的多边形是 imarray 上的像素坐标还是地理坐标(默认)
save_path (str | pathlib.Path, optional) -- 如果指定,将裁剪结果保存为 *.tif 文件,默认不保存
return_geotiff (bool, optional) -- if specify to True, will return idp.GeoTiff object instead of ndarray
use_affine (bool, optional) -- if True, use affine rotation storage for cropped results (only if ROI is a rectangle). Forces return_geotiff=True.
- 返回:
裁剪后的 numpy 像素数组
- 返回类型:
imarray_out
示例
Prepare data:
>>> import easyidp as idp >>> test_data = idp.data.TestData() # prepare geotiff >>> dom = idp.GeoTiff(test_data.pix4d.lotus_dom) # prepare polygon >>> roi = idp.ROI(test_data.shp.lotus_shp, name_field=0) >>> roi = roi[0] >>> roi.change_crs(dom.crs) >>> roi array([[ 368017.7565143 , 3955511.08102276], [ 368019.70190232, 3955511.49811902], [ 368020.11263046, 3955509.54636219], [ 368018.15769062, 3955509.13563382], [ 368017.7565143 , 3955511.08102276]])
Use this function:
>>> imarray = dom.crop_polygon(roi, is_geo=True) >>> imarray.shape (320, 319, 4)
如果你想将之前的结果保存为新的 GeoTIFF:
>>> save_tiff = "path/to/save/cropped.tif" >>> imarray = obj.crop_polygon(polygon_hv, is_geo=True, save_path=save_tiff)
- crop_rectangle(left: int, top: int, w: int, h: int, is_geo: bool = True, save_path: str | Path | None = None, return_geotiff: bool = False, use_affine: bool = False)¶
从 GeoTIFF 图像文件中提取矩形区域裁剪。
(0,0) o-------------------------- | ^ | | top | v | <-------> o=============o ^ | left |<---- w ---->| | | | | h | | | | | o=============o v
- 参数:
top (int) -- 所需裁剪区域左上角的坐标。
left (int) -- 所需裁剪区域左上角的坐标。
h (int) -- 所需裁剪高度。
w (int) -- 所需裁剪宽度。
is_geo (bool, optional) -- 给定的多边形是 imarray 上的像素坐标还是地理坐标(默认)
save_path (str | pathlib.Path, optional) -- 如果指定,将裁剪结果保存为 *.tif 文件
return_geotiff (bool, optional) -- if specify to True, will return idp.GeoTiff object instead of ndarray
use_affine (bool, optional) -- if True, use affine rotation storage for cropped results (only if ROI is a rectangle). Forces return_geotiff=True.
- 返回:
提取的裁剪区域。
- 返回类型:
ndarray
示例
>>> import easyidp as idp >>> test_data = idp.data.TestData() >>> obj = idp.GeoTiff(test_data.pix4d.lotus_dom) >>> out = obj.crop_rectangle(left=434, top=918, w=320, h=321, is_geo=False) >>> out.shape (321, 320, 4)
备注
不建议在不指定参数的情况下使用:
crop_rectiange(434, 918, 320, 321)很难知道确切的顺序
- crop_rois(roi, is_geo=True, save_folder=None, return_geotiff: bool = False, use_affine: bool = False)¶
通过给定的 <ROI> 对象,从 GeoTIFF 中裁剪多个具有多边形和多边形名称的 ROI
- 参数:
roi (easyidp.ROI | dict) -- 由 easyidp.ROI() 创建的 <ROI> 对象,或包含多个多边形的字典。如果只需要裁剪具有 ndarray 坐标的单个多边形,请使用 GeoTiff.crop_polygon()。
is_geo (bool, optional) -- 给定的多边形是 imarray 上的像素坐标还是地理坐标(默认)
save_folder (str, optional) -- 保存裁剪图像的文件夹,使用 ROI 索引作为文件名,默认 "",表示不保存。
return_geotiff (bool, optional) -- if specify to True, will return idp.GeoTiff object in dictionary values instead of ndarray. Note that if use_affine=True, this will be forced to True.
use_affine (bool, optional) -- if True, use affine rotation storage for cropped results (only if ROI is a rectangle). Forces return_geotiff=True.
- 返回:
The dictionary with key=id and value=ndarray data (or GeoTiff object)
- 返回类型:
dict,
示例
Prepare data:
>>> import easyidp as idp >>> test_data = idp.data.TestData() # prepare dom geotiff >>> dom = idp.GeoTiff(test_data.pix4d.lotus_dom) # prepare several ROIs >>> roi = idp.ROI(test_data.shp.lotus_shp, name_field=0) >>> roi = roi[0:3] # only use 3 for quick example >>> roi.change_crs(obj.crs) # transform to the same CRS like DOM {0: array([[ 368017.7565143 , 3955511.08102276], [ 368019.70190232, 3955511.49811902], [ 368020.11263046, 3955509.54636219], [ 368018.15769062, 3955509.13563382], [ 368017.7565143 , 3955511.08102276]]), 1: array([[ 368018.20042946, 3955508.96051697], [ 368020.14581791, 3955509.37761334], [ 368020.55654627, 3955507.42585654], [ 368018.601606 , 3955507.01512806], [ 368018.20042946, 3955508.96051697]]), 2: array([[ 368018.64801755, 3955506.84956301], [ 368020.59340644, 3955507.26665948], [ 368021.00413502, 3955505.31490271], [ 368019.04919431, 3955504.90417413], [ 368018.64801755, 3955506.84956301]])}
Use this function:
>>> out_dict = obj.crop_rois(roi) {"N1W1": array[...], "N1W3": array[...], ...} >>> out_dict["N1W1"].shape (320, 319, 4)
如果你想自动将 GeoTIFF 结果保存到特定文件夹:
>>> tif_out_folder = "./cropped_geotiff" >>> os.mkdir(tif_out_folder) >>> out_dict = obj.crop_rois(roi, save_folder=tif_out_folder)
- crop_shapely_polygon(shapely_polygon: Polygon, save_path: str | Path | None = None, return_geotiff: bool = False, use_affine: bool = False)¶
Crop a given polygon from geotiff, the base function of cropping geotiff
- 参数:
shapely_polygon (shapely.geometry.Polygon) -- The polygon to crop, in geo coordinate
save_path (str, optional) -- 如果指定,将裁剪结果保存为 *.tif 文件
return_geotiff (bool, optional) -- if specify to True, will return idp.GeoTiff object instead of ndarray
use_affine (bool, optional) -- if True, use affine rotation storage for cropped results (only if ROI is a rectangle). Forces return_geotiff=True.
- 返回类型:
idp.GeoTiff object
- property crs¶
快速访问
self.header['crs'],请通过header字典更改值
- property dim¶
快速访问
self.header['dim'],请通过header字典更改值
- file_path¶
The file path of current GeoTiff, pathlib.Path object
>>> dom.file_path PosixPath('/Users/<user>/Library/Application Support/easyidp.data/data_for_tests/pix4d/lotus_tanashi_full/hasu_tanashi_20170525_Ins1RGB_30m_transparent_mosaic_group1.tif')
- geo2pixel(polygon_hv: ndarray, return_index=False) ndarray¶
Convert geo coordinate (lon, lat) to geotiff pixel coordinate (horizontal, vertical). A warpper of rasterio.io.DatasetReader.transform() and rasterio.io.DatasetReader.index()
- 参数:
points_hv (numpy nx2 array) -- [horizontal, vertical] points
return_index (bool, default false) -- 如果为 false:将获得浮点坐标 -> (23.5, 27.8) 如果为 true:将获得整数像素索引 -> (23, 27)
- 返回类型:
The ndarray pixel position of these points (horizontal, vertical)
示例
Prepare data:
>>> import easyidp as idp >>> test_data = idp.data.TestData() # prepare the roi data >>> roi = idp.ROI(test_data.shp.lotus_shp, name_field=0) >>> dom = idp.GeoTiff(test_data.pix4d.lotus_dom) >>> roi.change_crs(dom.crs) >>> roi_test = roi[111] array([[ 368051.75902187, 3955484.68169527], [ 368053.70441367, 3955485.09879908], [ 368054.11515079, 3955483.14704415], [ 368052.16020711, 3955482.73630818], [ 368051.75902187, 3955484.68169527]])
Use this function:
>>> roi_test_pixel = dom.geo2pixel(roi_test) array([[5043.01515811, 4551.90714551], [5306.6183839 , 4495.38901391], [5362.27381938, 4759.85445164], [5097.37630191, 4815.50973136], [5043.01515811, 4551.90714551]])
- property has_alpha: bool¶
Check if this GeoTiff has an alpha channel.
This property reads the colorinterp (color interpretation) from the GeoTiff header to determine if an alpha mask is present. The colorinterp field is extracted from the TIFF metadata by rasterio, which maps to the GDAL/TIFF PHOTOMETRIC and EXTRASAMPLES tags.
- 返回:
True if the GeoTiff has an alpha band, False otherwise.
- 返回类型:
bool
示例
>>> import easyidp as idp >>> test_data = idp.data.TestData() >>> dom = idp.GeoTiff(test_data.pix4d.lotus_dom) >>> dom.has_alpha True >>> dsm = idp.GeoTiff(test_data.pix4d.lotus_dsm) >>> dsm.has_alpha False
- has_data() bool¶
Check if the geotiff has data
- header¶
GeoTIFF 的元信息
>>> dom.header {'height': 5752, 'width': 5490, 'dim': 4, 'nodata': 0, 'dtype': dtype('uint8'), 'scale': [0.00738, 0.00738], 'tie_point': [368014.54157, 3955518.2747700005], 'crs': <Derived Projected CRS: EPSG:32654> Name: WGS 84 / UTM zone 54N Axis Info [cartesian]: - E[east]: Easting (metre) - N[north]: Northing (metre) Area of Use: - name: Between 138°E and 144°E, northern hemisphere between equator and 84°N, onshore and offshore. Japan. Russian Federation. - bounds: (138.0, 0.0, 144.0, 84.0) Coordinate Operation: - name: UTM zone 54N - method: Transverse Mercator Datum: World Geodetic System 1984 ensemble - Ellipsoid: WGS 84 - Prime Meridian: Greenwich 'profile': <dict `rasterio.io.DatasetReader.profile`> } >>> dom.header["height"] 5752
小心
Since v2.0.2, this function backend has been switched from tifffile to rasterio to improve the performance, Some of the key tags in header like 'tags', 'photometric', 'planarconfig', 'compress' has been deprecated.
- property height¶
快速访问
self.header['height'],请通过header字典更改值
- property imarray¶
Access to the pixel values in the type of numpy ndarray
- property mask: ndarray | None¶
Boolean mask where True indicates valid (non-nodata) pixels.
Shape is (height, width). When mask_polygon is set, the binary mask is computed from the polygon. Otherwise, falls back to computing from alpha channel or nodata values.
This property is lazy-computed and cached for efficiency.
- 返回:
Boolean mask array with shape (height, width), or None if no data.
- 返回类型:
np.ndarray | None
示例
>>> import easyidp as idp >>> test_data = idp.data.TestData() >>> dsm = idp.GeoTiff(test_data.pix4d.lotus_dsm) >>> mask = dsm.mask >>> mask.shape (5752, 5490) >>> mask.dtype dtype('bool')
- property mask_polygon: ndarray | None¶
Get the mask as polygon coordinates.
Returns the polygon in its stored coordinate type (geo or pixel). Use mask_polygon_geo or mask_polygon_pixel for specific types.
- 返回:
(n, 2) polygon coordinates, or None if not set.
- 返回类型:
np.ndarray | None
- property mask_polygon_geo: ndarray | None¶
Get mask polygon in geo coordinates.
Converts from pixel coords if needed using the transform.
- 返回:
(n, 2) geo coordinates, or None if no polygon.
- 返回类型:
np.ndarray | None
- property mask_polygon_pixel: ndarray | None¶
Get mask polygon in pixel coordinates.
Converts from geo coords if needed using the transform.
- 返回:
(n, 2) pixel coordinates, or None if no polygon.
- 返回类型:
np.ndarray | None
- property nodata¶
快速访问
self.header['nodata'],请通过header字典更改值
- open(tif_path: str | Path)¶
打开并获取 GeoTIFF 的元信息(头文件)
- 参数:
tif_path (str | pathlib.Path) -- GeoTIFF 文件的路径
示例
Though this function can be used by:
>>> import easyidp as idp >>> test_data = idp.data.TestData() >>> dom = idp.GeoTiff() >>> dom.read_geotiff(test_data.pix4d.lotus_dom)
强烈建议在初始化 GeoTIFF 对象时指定 GeoTIFF 路径:
>>> dom = idp.GeoTiff(test_data.pix4d.lotus_dom)
- pixel2geo(polygon_hv)¶
Convert geotiff pixel coordinate or index (horizontal, vertical) to geo coordinate (x, y). A warpper of rasterio.io.DatasetReader.xy() and rasterio.io.DatasetReader.transform()
- 参数:
points_hv (numpy nx2 array) -- [horizontal, vertical] points if dtype is np.floating, view as pixel coordinate if dtype is np.integer, view as pixel index (return left upper corner of pixel)
- 返回类型:
The ndarray pixel position of these points (horizontal, vertical)
示例
Prepare data:
>>> import easyidp as idp >>> test_data = idp.data.TestData() # prepare the roi data >>> roi = idp.ROI(test_data.shp.lotus_shp, name_field=0) >>> dom = idp.GeoTiff(test_data.pix4d.lotus_dom) >>> roi.change_crs(dom.crs) >>> roi_test = roi[111] >>> roi_test_pixel = dom.geo2pixel(roi_test) array([[5043.01515811, 4551.90714551], [5306.6183839 , 4495.38901391], [5362.27381938, 4759.85445164], [5097.37630191, 4815.50973136], [5043.01515811, 4551.90714551]])
Use this function:
>>> roi_test_back = dom.pixel2geo(roi_test_pixel) array([[ 368051.75902187, 3955484.68169527], [ 368053.70441367, 3955485.09879908], [ 368054.11515079, 3955483.14704415], [ 368052.16020711, 3955482.73630818], [ 368051.75902187, 3955484.68169527]])
- point_query(points_hv, is_geo=True)¶
获取给定点的像素值
- 参数:
points_hv (tuple | list | nx2 ndarray) --
The coordinates of qurey points, in order (horizontal, vertical)is_geo (bool, optional) --
The given polygon is geo coords (True, default) or pixel coords (False) on imarray.
- 返回:
获得的像素值(RGB 或高度)
- 返回类型:
ndarray
示例
前提条件
>>> import easyidp as idp >>> dsm = idp.GeoTiff(test_data.pix4d.lotus_dsm)
通过元组查询一个点
>>> # one point tuple >>> pts = (368023.004, 3955500.669) >>> dsm.point_query(pts, is_geo=True) array([97.45558])
通过列表查询一个点
>>> # one point list >>> pts = [368023.004, 3955500.669] >>> dsm.point_query(pts, is_geo=True) array([97.45558])
通过列表查询多个点
>>> pts = [ ... [368022.581, 3955501.054], ... [368024.032, 3955500.465] ... ] >>> dsm.point_query(pts, is_geo=True) array([97.624344, 97.59617])
通过 numpy 查询多个点
>>> pts = np.array([ ... [368022.581, 3955501.054], ... [368024.032, 3955500.465] ... ]) >>> dsm.point_query(pts, is_geo=True) array([97.624344, 97.59617])
参见
easyidp.geotiff.point_query
- polygon_math(polygon_hv: ndarray | None = None, is_geo=True, kernel='mean')¶
计算给定多边形内的值
- 参数:
polygon_hv (numpy nx2 array | None, optional) -- (horizontal, vertical) points. If None, the calculation will be performed on the entire image. Defaults to None.
is_geo (bool, optional) -- 给定的多边形是 imarray 上的像素坐标还是地理坐标(默认)
kernel (str, optional) -- 计算多边形摘要的方法,选项包括:["mean", "min", "max", "pmin5", "pmin10", "pmax5", "pmax10"],详细信息请查看备注部分。
备注
kernel参数的选项详情:"mean": 多边形内部的平均值
"min": 多边形内部的最小值
"max": 多边形内部的最大值
"pmin5": 多边形内部的第 5 个百分位数均值
"pmin10": 多边形内部的第 10 个百分位数均值
"pmax5": 多边形内部的第 95 个百分位数均值
"pmax10": 多边形内部的第 90 个百分位数均值
示例
Prepare data:
>>> import easyidp as idp >>> test_data = idp.data.TestData() # prepare the roi data >>> roi = idp.ROI(test_data.shp.lotus_shp, name_field=0) >>> dsm = idp.GeoTiff(test_data.pix4d.lotus_dsm) >>> roi.change_crs(dsm.crs) >>> roi_test = roi[111] array([[ 368051.75902187, 3955484.68169527], [ 368053.70441367, 3955485.09879908], [ 368054.11515079, 3955483.14704415], [ 368052.16020711, 3955482.73630818], [ 368051.75902187, 3955484.68169527]])
Use this function:
>>> dsm.polygon_math(roi_test, is_geo=True, kernel="mean") 97.20491 >>> dsm.polygon_math(roi_test, is_geo=True, kernel="pmax10") 97.311844
小心
此功能最初设计用于对单波段(层)GeoTIFF 进行一些简单的计算。
如果将此功能应用于 RGB 彩色 GeoTIFF,它将返回每一层的计算结果
>>> dom.polygon_math(roi_test, is_geo=True, kernel="pmax10") array([139.97428808, 161.36439038, 122.30964888, 255. ])
这四个值是 RGBA 四个颜色通道。
- save(save_path: str | Path, overwrite: bool = False, apply_mask: bool = True, use_affine: bool = False) bool¶
Save GeoTiff as tiff file with proper nodata/mask handling.
Mask is only applied during save. Previous crop operations preserve full rectangular data, allowing further calculations on edge pixels.
The save strategy depends on data type: - DSM: uses nodata value (-32767.0) - RGB/RGBA: uses alpha channel - MS/MSA (multispectral): adds alpha channel to protect original data
When use_affine=True and mask_polygon is a rectangle, the image is saved with affine rotation in the transform (no mask needed). The current object is NOT modified (unless it was already in affine mode).
- 参数:
save_path (str | Path) -- The file path to save the geotiff
overwrite (bool, optional) -- If True, overwrite existing file without prompting, by default False
apply_mask (bool, optional) -- If True and mask exists, apply mask appropriately, by default True
use_affine (bool, optional) -- "Convert and Save" mode. If True, try to use affine rotation storage for rectangular masks. If the object is ALREADY in affine mode (self.use_affine=True), this parameter is ignored (no double-conversion). Requires mask_polygon to be a valid rectangle (4 vertices, 90° angles). By default False.
- 返回:
True if save succeeded, False if cancelled
- 返回类型:
bool
示例
>>> import easyidp as idp >>> test_data = idp.data.TestData() >>> dsm = idp.GeoTiff(test_data.pix4d.lotus_dsm) >>> dsm.save('output_dsm.tif', overwrite=True) True
- property scale¶
快速访问
self.header['scale'],请通过header字典更改值
- set_mask_polygon(polygon: ndarray, is_geo: bool = True) None¶
Set mask from polygon coordinates.
- 参数:
polygon (np.ndarray) -- (n, 2) polygon vertices. Auto-closes if first != last.
is_geo (bool, optional) -- True if polygon is in geo coordinates, False for pixel. By default True.
示例
>>> gtiff = idp.GeoTiff(...) >>> roi_coords = np.array([[x1, y1], [x2, y2], ...]) >>> gtiff.set_mask_polygon(roi_coords, is_geo=True)
- property tie_point¶
快速访问
self.header['tie_point'],请通过header字典更改值
- property use_affine: bool¶
Check if this GeoTiff uses affine rotation storage.
When True, the transform contains rotation and the entire image is valid (no mask needed). This is detected from the transform's b and d coefficients being non-zero.
- 返回:
True if using affine rotation storage.
- 返回类型:
bool
- property width¶
快速访问
self.header['width'],请通过header字典更改值