这是我的代码:
导入cv2导入numpy为np进口口
def读(sn,tn): #read源文件和目标文件 source = cv2.imread(“./ source /”+ sn +“。bmp”) target = cv2.imread(“./ target /”+ …
我可能错了。但在 recolor() 函数你再次迭代源,如 color() 功能。你不应该迭代 result 在 recolor() 功能?
recolor()
color()
result
从
for i in range(0, source.shape[0]): for j in range(0, source.shape[1]): for k in range(0, source.shape[2]): result[i, j, k] = round( ((result[i, j, k] - tmean[k]) * ( sstd[k]/tstd[k] )) + smean[k] )
至
for i in range(0, result.shape[0]): for j in range(0, result.shape[1]): for k in range(0, result.shape[2]): result[i, j, k] = round( ((result[i, j, k] - tmean[k]) * ( sstd[k]/tstd[k] )) + smean[k] )