1 Star 2 Fork 0

老张/mz_3d_photo_inpainting

加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
文件
克隆/下载
test.py 1.44 KB
一键复制 编辑 原始数据 按行查看 历史
老张 提交于 2021-02-25 00:04 . fixed
# import networkx as nx
import os
import glob
import imageio
import numpy as np
import cv2
# G =nx.Graph()
# image_folder = r'C:\Users\laozhang\Desktop\imgs'
# lines = [os.path.splitext(os.path.basename(xx))[0] for xx in glob.glob(os.path.join(image_folder, '*' + '.jpg'))]
# print(lines)
img = r'E:\TEST\aa.exr'
# img = r'E:\TEST\123\ttt.jpg'
# img = r'D:\MZ\MY\MY_01_01_001\render\All\All.0528.exr'
# img = r'C:\Users\laozhang\Desktop\imgs\dogs.jpg'
# # img = r'E:\TEST\123\t.tif'
#
# result = imageio.imread(img)
# # print(result.shape)
# print(result)
# # H, W = imageio.imread(img).shape[:2]
# # print(H)
# result2 = cv2.imread(img,2)
# result2 = cv2.imread(img,cv2.IMREAD_COLOR)
result2 = cv2.imread(img,cv2.IMREAD_UNCHANGED)
print(result2.shape)
# min_16bit = np.min(result2)
# max_16bit = np.max(result2)
# print(min_16bit)
# print(max_16bit)
#
# image_8bit = np.array(np.rint((255.0 * (result2 - min_16bit)) / float(max_16bit - min_16bit)), dtype=np.uint8)
#
# print(image_8bit)
# print(result2)
# print(type(result2))
# zz=None
# a=cv2.normalize(result2, result2, 0, 255, cv2.NORM_MINMAX)
# print(a)
# b=np.array([result2],dtype='uint8')
# print(b)
# result2=result2.astype(np.uint8)
# print(result2)
# result2= np.uint8(result2)
# last = cv2.cvtColor(a,cv2.COLOR_BGR2RGB)
# print(last.shape)
# print(last)
cv2.imwrite(r'E:\TEST\123\attt.jpg',result2)
cv2.imshow('a',result2)
cv2.waitKey(0)
# import torch
#
# device = torch.device('cuda')
# print(device)
Loading...
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化
1
https://gitee.com/cgai/mz_3d_photo_inpainting.git
git@gitee.com:cgai/mz_3d_photo_inpainting.git
cgai
mz_3d_photo_inpainting
mz_3d_photo_inpainting
master

搜索帮助