Skip to content

Commit

Permalink
use PIL to read
Browse files Browse the repository at this point in the history
  • Loading branch information
kwea123 committed Feb 5, 2021
1 parent b2b2a22 commit cd9bbc9
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions extract_color_mesh.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
import os
import numpy as np
import cv2
from PIL import Image
from collections import defaultdict
from tqdm import tqdm
import mcubes
Expand Down Expand Up @@ -211,8 +212,9 @@ def f(models, embeddings, rays, N_samples, N_importance, chunk, white_back):
print('Fusing colors ...')
for idx in tqdm(range(len(dataset.image_paths))):
## read image of this pose
image = cv2.imread(dataset.image_paths[idx])[:,:,::-1]
image = cv2.resize(image, tuple(args.img_wh))
image = Image.open(dataset.image_paths[idx]).convert('RGB')
image = image.resize(tuple(args.img_wh), Image.LANCZOS)
image = np.array(image)

## read the camera to world relative pose
P_c2w = np.concatenate([dataset.poses[idx], np.array([0, 0, 0, 1]).reshape(1, 4)], 0)
Expand Down

0 comments on commit cd9bbc9

Please sign in to comment.