我有两张不同对比度的图像。如何才能使第二张图像具有相同的对比度比例?有什么技术可以做到这一点吗?直方图匹配技术是否适用于此目的?
发布于 2020-05-17 04:24:08
使用SimpleITK
import SimpleITK as sitk
# read images
im_ref = sitk.ReadImage("/path/to/reference/image")
im_orig = sitk.ReadImage("/path/to/image/to/be/modified")
# apply histogram matching
histogram_match = sitk.HistogramMatchingImageFilter()
histogram_match.SetThresholdAtMeanIntensity(True) # useful if a lot of background pixels
im_matched = histogram_match.Execute(im_orig, im_ref)
# write output
sitk.WriteImage(im_matched, "/path/for/output/image")https://stackoverflow.com/questions/61746007
复制相似问题