黑色垫圈 3D 模型: import numpy as np from PIL import Image, ImageFilter from scipy import ndimage  | Tripo AI
Lv.0

black washer 3d model

浏览全部3D模型
提示词

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

推荐模型