You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
13 lines
367 B
13 lines
367 B
# import numpy as np
|
|
from numpy import copy,max,uint8
|
|
def image_reverse(input_image):
|
|
|
|
input_image_cp = copy(input_image) # 输入图像的副本
|
|
|
|
pixels_value_max = max(input_image_cp) # 输入图像像素的最大值
|
|
|
|
output_imgae = pixels_value_max - input_image_cp # 输出图像
|
|
|
|
output_imgae = output_imgae.astype(uint8)
|
|
|
|
return output_imgae |