91av视频/亚洲h视频/操亚洲美女/外国一级黄色毛片 - 国产三级三级三级三级

資源簡介

根據參考圖像各個通道的灰度分布,將一副圖像的灰度分布映射過去,使映射后的兩幅圖像灰度分布非常接近,被稱為histogram matching或者histogram specification,常用于網絡訓練的圖像數據擴增

資源截圖

代碼片段和文件信息

#!/usr/bin/env?python3

“““
@license:?Apache?License?Version?2.0
@author:?Stefano?Di?Martino
Exact?histogram?matching
“““

from?scipy?import?misc
from?histogram_matching?import?ExactHistogramMatcher
import?numpy?as?np
import?png


def?histogram_matching_rgb():
????target_img?=?misc.imread(‘F:/X15207198.png‘)
????reference_img?=?misc.imread(‘F:/307-1001059240_512.png‘)

????reference_histogram?=?ExactHistogramMatcher.get_histogram(reference_img)
????new_target_img?=?ExactHistogramMatcher.match_image_to_histogram(target_img?reference_histogram)
????misc.imsave(‘F:/rgb_out.png‘?new_target_img)


def?histogram_matching_grey_values():
????target_img?=?misc.imread(‘F:/307-1001057260.dcm.png‘)
????reference_img?=?misc.imread(‘F:/X15207198.png‘)

????reference_histogram?=?ExactHistogramMatcher.get_histogram(reference_img)
????new_target_img?=?ExactHistogramMatcher.match_image_to_histogram(target_img?reference_histogram)
????new_target_img?=?new_target_img.astype(np.uint16)
????#?misc.imsave(‘F:/grey_out.png‘?new_target_img)
????filename?=?‘F:/grey_out.png‘
????with?open(filename?‘wb‘)?as?f:
????????writer?=?png.Writer(width=new_target_img.shape[1]?height=new_target_img.shape[0]?bitdepth=16?greyscale=True)
????????zgray2list?=?new_target_img.tolist()
????????writer.write(f?zgray2list)


def?main():
????#?histogram_matching_rgb()
????histogram_matching_grey_values()


if?__name__?==?“__main__“:
????main()

?屬性????????????大小?????日期????時間???名稱
-----------?---------??----------?-----??----
?????目錄???????????0??2018-07-18?09:16??ExactHistogramSpecification-master\
?????文件????????1203??2018-06-17?14:22??ExactHistogramSpecification-master\.gitignore
?????目錄???????????0??2018-07-19?10:14??ExactHistogramSpecification-master\.idea\
?????文件?????????596??2018-07-17?18:34??ExactHistogramSpecification-master\.idea\deployment.xml
?????文件?????????455??2018-07-17?18:34??ExactHistogramSpecification-master\.idea\ExactHistogramSpecification-master.iml
?????目錄???????????0??2018-07-17?18:34??ExactHistogramSpecification-master\.idea\inspectionProfiles\
?????文件?????????288??2018-07-17?18:33??ExactHistogramSpecification-master\.idea\misc.xml
?????文件?????????320??2018-07-17?18:33??ExactHistogramSpecification-master\.idea\modules.xml
?????文件???????12373??2018-07-19?10:14??ExactHistogramSpecification-master\.idea\workspace.xml
?????文件????????1428??2018-07-18?09:16??ExactHistogramSpecification-master\example.py
?????文件????????8374??2018-07-18?09:01??ExactHistogramSpecification-master\histogram_matching.py
?????目錄???????????0??2018-06-17?14:22??ExactHistogramSpecification-master\images\
?????目錄???????????0??2018-07-17?18:48??ExactHistogramSpecification-master\images\GreyValue\
?????文件??????982940??2018-06-17?14:22??ExactHistogramSpecification-master\images\GreyValue\Luna_medium.jpg
?????文件?????1192627??2018-06-17?14:22??ExactHistogramSpecification-master\images\GreyValue\Luna_White_Balance_medium.jpg
?????目錄???????????0??2018-07-17?18:48??ExactHistogramSpecification-master\images\RGB\
?????文件?????1338556??2018-06-17?14:22??ExactHistogramSpecification-master\images\RGB\Luna_medium.jpg
?????文件?????2167112??2018-06-17?14:22??ExactHistogramSpecification-master\images\RGB\Luna_White_Balance_medium.jpg
?????文件???????11357??2018-06-17?14:22??ExactHistogramSpecification-master\LICENSE
?????文件?????????839??2018-06-17?14:22??ExactHistogramSpecification-master\README.md

評論

共有 條評論

相關資源