- 🔤 文字学证据:𥘵字(示+旦)揭示祖先崇拜=生殖崇拜 - 🌋 地理学证据:大同火山→昊天寺→平城→奈良→富士山崇拜传播链 - 🏛️ 建筑学证据:应县木塔承载寇谦之静轮天宫的生殖象征 - 📜 制度学证据:北魏→日本完整政治文化传播机制 核心发现: ✨ 四重证据相互印证的完整理论体系 ✨ 从一个汉字解开东亚文化千年之谜 ✨ 首次系统解释日本阳具崇拜历史起源 ✨ 为'胡汉三千年'理论提供核心实证支撑 学术价值: - 创新'纯逻辑考古'研究方法论 - 建立跨学科文化传播理论 - 填补东亚文化研究重要空白 - 为中华文明世界影响提供科学证据
55 lines
1.6 KiB
Python
55 lines
1.6 KiB
Python
#!/usr/bin/env python3
|
|
"""
|
|
OCR 文字提取工具
|
|
需要安装: pip install pytesseract pillow
|
|
"""
|
|
|
|
try:
|
|
import pytesseract
|
|
from PIL import Image
|
|
import os
|
|
|
|
def extract_text_from_image(image_path):
|
|
"""从图片中提取文字"""
|
|
try:
|
|
# 打开图片
|
|
image = Image.open(image_path)
|
|
|
|
# 使用 OCR 提取文字
|
|
text = pytesseract.image_to_string(image, lang='chi_sim+eng')
|
|
|
|
return text.strip()
|
|
|
|
except Exception as e:
|
|
return f"OCR 失败: {e}"
|
|
|
|
def batch_ocr_images(image_dir, output_file="ocr_results.md"):
|
|
"""批量 OCR 图片"""
|
|
results = []
|
|
|
|
# 获取所有 PNG 图片
|
|
png_files = [f for f in os.listdir(image_dir) if f.endswith('.png')]
|
|
png_files.sort()
|
|
|
|
for filename in png_files:
|
|
image_path = os.path.join(image_dir, filename)
|
|
print(f"正在 OCR: {filename}")
|
|
|
|
text = extract_text_from_image(image_path)
|
|
|
|
if text:
|
|
results.append(f"## {filename}\n\n```\n{text}\n```\n\n---\n")
|
|
else:
|
|
results.append(f"## {filename}\n\n*无文字内容*\n\n---\n")
|
|
|
|
# 保存结果
|
|
with open(output_file, 'w', encoding='utf-8') as f:
|
|
f.write("# OCR 文字提取结果\n\n")
|
|
f.writelines(results)
|
|
|
|
print(f"OCR 完成,结果保存到: {output_file}")
|
|
|
|
except ImportError:
|
|
print("需要安装 OCR 依赖:")
|
|
print("pip install pytesseract pillow")
|
|
print("还需要安装 tesseract 引擎") |