我需要获取16位摄影测量目标,因此我尝试使用此婚礼站点上的代码:https://mpetroff.net/2018/05/photogrammetry-targets/,但是当尝试使用tempfile创建临时目录时却出现了错误,我似乎没有了解原因。
with tempfile.TemporaryDirectory() as tmp_dir:
# Create sheets of targets in temporary directory
pdfs = []
for n in range(math.ceil(len(CODES) / ROWS / COLUMNS)):
pdf_filename = os.path.join(tmp_dir, str(n) + '.pdf')
create_sheet(n, pdf_filename)
pdfs.append(pdf_filename)
# Combine sheets into a single PDF
subprocess.run(['pdftk'] + pdfs + ['cat', 'output', FILENAME])