python - 调整图像大小并仅在中心周围显示 100x100 像素
解决方案
感谢busybyte,我找到了答案:
img = cv.imread("PATH")
centerx, centery = [int(img.shape[0] / 2) - 50, int(img.shape[1] / 2) - 50]
img = img[centerx:centerx + 100, centery:centery + 100]
它将图像从中心裁剪为所需的 100x100 大小。
推荐阅读
- php - 通过多个数组数据中的数组值返回数组键
- excel - VBA:如何在用户表单列表中均匀地放置项目?
- vbscript - 拆分后vbScript忽略许多空格
- xamarin - Xamarin 存档工具 - 看似正常的错误,但原因不明
- scalatest - println的scalatest Flatespec测试结果
- matlab - Matlab 快速数据类型转换 4x1byte 到 1x32byte
- image - 添加 Alpha 通道性能
- r - R POSIXct 错误地用毫秒解析秒
- elasticsearch - 系统过载时丢弃 Elasticsearch 请求
- bash - 从表中选择与模式匹配的行