
black washer 3d model
import numpy as np from PIL import Image, ImageFilter from scipy import ndimage import trimesh, os src = "/mnt/data/a_clean_high_resolution_centered_isolated_vecto.png" im = Image.open(src).convert("RGB") a = np.asarray(im) # 배지 모양으로 자르기; 통합된 아일렛과 전체 원형 본체 유지 crop = im.crop((45, 0, 1215, 1215)) W = 300 H = int(round(crop.height * W / crop.width)) small = crop.resize((W, H), Image.Resampling.LANCZOS) rgb = np.asarray(small).astype(np.float32) gray = rgb.mean(axis=2) / 255.0 # 어두운 배지를 흰색 배경에서 분리; 흰색 아일렛 중앙은 구멍으로 유지 mask = gray < 0.88 mask = ndimage.binary_fill_holes(mask) # 참조 이미지의 중앙에 위치하도록 아일렛 구멍을 명시적으로 복원합니다. # 크롭 영역을 기준으로 위치를 근사합니다. hole_cx = int((623-45) * W / 1170) hole_cy = int((100-0) * H / 1215) Y, X = np.ogrid[:H, :W] mask &= ((X-hole_cx)**2 + (Y-hole_cy)**2) > (int(43*W/1170))**2 mask = ndimage.binary_closing(mask, iterations=2) mas
4K·PBR·Tripo H3.1