python - 用于多光谱图像处理的 skimage
问题描述
我有一个需要分割以检测苹果树的 6 波段图像(红色、绿色、蓝色、近红外、红色边缘和高度)。我发现尝试使用 skimage 完成这项任务很困难。我遇到的一个问题的例子是当我运行我的代码时:
import skimage
from skimage import io, color
import cv2
import numpy as np
from matplotlib import pyplot as plt
#read the image
trees= io.imread('ortho/OrthoRGBReNirCHM_Clip1.tif')
#seperate the 6 bands
R,G,B,Re,N,C=cv2.split(trees)
#crop a small part of the image to test
C_cropped=C[0:1500,0:1500]
#apply median filter
from skimage import filters
trees_denoised=filters.median(C_cropped, out=None, mode='nearest', cval=0.0, behavior='ndimage')
#save the image
io.imsave("ortho/denoised.TIF", trees_denoised)'
最终的图像完全被破坏了,它看起来不像原来的树。拆分命令有问题吗?还是我做错了什么?
解决方案
推荐阅读
- erlang - 为什么要为不是 named_table 的 ETS 表分配名称?
- reactjs - 无法在 Next.js 文件中注册服务工作者错误
- javascript - javascript取消选中另一个复选框时取消选中复选框
- python - django.db.utils.IntegrityError: NOT NULL 约束失败来自 Postman
- c++ - 我在 C++ 中的向量声明有什么问题?
- javascript - 在 dist 文件夹的子目录中输出字体、css 文件和其他资源
- algorithm - 是否有一种压缩算法可以将多个输入压缩到相同的输出中,并且在解压缩时会生成所有原始输入?
- grafana - 是否可以在 LogQL 中将字符串值转换为数字?
- go - 当我尝试使用 Go 和 firebase adminSDK 获取用户数据时,我只能获取内存地址
- port - 我可以创建多个具有相同端口号的套接字吗?