代码整理
This commit is contained in:
1 parent
2ccccaaedc
commit
fd637f9def
1 file changed
+9
-10
@@ -103,12 +103,12 @@ def post_process_clahe(img, clip_limit=1.5, grid_size=(8, 8), mix_ratio=0.3):
|
|||||||
|
|
||||||
def main():
|
def main():
|
||||||
# === 参数配置 ===
|
# === 参数配置 ===
|
||||||
img1_path = "/home/algo/Documents/openMVS/openMVS/cartoon_texture/data/642713/642713.o.jpg" # 图1:模糊但纯净
|
img1_path = "/home/algo/Documents/openMVS/openMVS/cartoon_texture/data/642713/642713.qz.jpg" # 图1:模糊但纯净
|
||||||
img2_path = "/home/algo/Documents/openMVS/openMVS/cartoon_texture/data/642713/642713.mesh7.png" # 图2:清晰但有印染
|
img2_path = "/home/algo/Documents/openMVS/openMVS/cartoon_texture/data/642713/642713.mesh7.png" # 图2:清晰但有印染
|
||||||
output_path = "/home/algo/Documents/openMVS/openMVS/cartoon_texture/data/642713/642713.jpg"
|
output_path = "/home/algo/Documents/openMVS/openMVS/cartoon_texture/data/642713/642713.jpg"
|
||||||
|
|
||||||
# 印染检测参数(可按实际效果微调)
|
# 印染检测参数(可按实际效果微调)
|
||||||
DIFF_THRESH = 0.12 # 差异阈值
|
DIFF_THRESH = 0.05 # 差异阈值
|
||||||
GRAD_THRESH = 0.03 # 梯度阈值
|
GRAD_THRESH = 0.03 # 梯度阈值
|
||||||
VAR_THRESH = 0.005 # 局部方差阈值
|
VAR_THRESH = 0.005 # 局部方差阈值
|
||||||
|
|
||||||
@@ -159,14 +159,13 @@ def main():
|
|||||||
print(f"Done! Result saved to {output_path}")
|
print(f"Done! Result saved to {output_path}")
|
||||||
print(f"Debug mask saved to stain_mask_debug.png")
|
print(f"Debug mask saved to stain_mask_debug.png")
|
||||||
|
|
||||||
# 显示结果
|
# # 显示结果
|
||||||
cv2.imshow("Original (mesh7.1)", img2)
|
# cv2.imshow("Original (mesh7.1)", img2)
|
||||||
cv2.imshow("Reference (n1)", img1)
|
# cv2.imshow("Reference (n1)", img1)
|
||||||
cv2.imshow("Stain Mask", mask_viz)
|
# cv2.imshow("Stain Mask", mask_viz)
|
||||||
cv2.imshow("Fused Result", fused_bgr)
|
# cv2.imshow("Fused Result", fused_bgr)
|
||||||
cv2.waitKey(0)
|
# cv2.waitKey(0)
|
||||||
cv2.destroyAllWindows()
|
# cv2.destroyAllWindows()
|
||||||
|
|
||||||
|
|
||||||
if __name__ == "__main__":
|
if __name__ == "__main__":
|
||||||
main()
|
main()
|
||||||
Reference in new issue
Block a user