mirror of
https://github.com/opencv/opencv.git
synced 2024-12-06 02:29:14 +08:00
a1a2cb0aeb
Memory leak in color-blob-detection sample fixed; Default face size in face-detection is set to 20%; Error handling improved; Some possible mat leak fixed; Manager verison and engine interface version incremented to fix incompatibilities; Docs updated;
23 lines
515 B
Python
Executable File
23 lines
515 B
Python
Executable File
#!/usr/bin/python
|
|
|
|
import os
|
|
|
|
TARGET_PATH = "img"
|
|
|
|
pipe = os.popen("which dia")
|
|
DiaPath = pipe.readline()
|
|
DiaPath = DiaPath.strip("\n");
|
|
pipe.close()
|
|
|
|
if ("" == DiaPath):
|
|
print("Error: Dia tool was not found")
|
|
exit(-1)
|
|
|
|
print("Dia tool: \"%s\"" % DiaPath)
|
|
|
|
if (not os.path.exists(TARGET_PATH)):
|
|
os.mkdir("img")
|
|
|
|
for filename in os.listdir("."):
|
|
if ("dia" == filename[-3:]):
|
|
os.system("%s --export %s %s" % (DiaPath, os.path.join(TARGET_PATH, filename[0:len(filename)-4] + ".png"), filename)) |