首页 > 解决方案 > 用于多光谱图像处理的 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)'

最终的图像完全被破坏了,它看起来不像原来的树。拆分命令有问题吗?还是我做错了什么?

标签: pythonimageimage-segmentationscikit-image

解决方案


推荐阅读