-
-
Notifications
You must be signed in to change notification settings - Fork 871
Expand file tree
/
Copy pathColorCheckerDetection.py
More file actions
97 lines (89 loc) · 3.43 KB
/
ColorCheckerDetection.py
File metadata and controls
97 lines (89 loc) · 3.43 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
__version__ = "2.0"
from meshroom.core import desc
from meshroom.core.utils import VERBOSE_LEVEL
class ColorCheckerDetection(desc.AVCommandLineNode):
commandLine = "aliceVision_colorCheckerDetection {allParams}"
size = desc.DynamicNodeSize("input")
# parallelization = desc.Parallelization(blockSize=40)
# commandLineRange = '--rangeStart {rangeStart} --rangeSize {rangeBlockSize}'
documentation = """
(BETA) \\
Performs Macbeth color checker chart detection.
Outputs:
- the detected color charts position and colors
- the associated transform matrix from "theoretical" to "measured"
assuming that the "theoretical" Macbeth chart corners coordinates are:
(0, 0), (1675, 0), (1675, 1125), (0, 1125)
Dev notes:
- Fisheye/pinhole is not handled
- ColorCheckerViewer is unstable with multiple color chart within a same image
"""
inputs = [
desc.File(
name="input",
label="Input",
description="SfMData file input, image filenames or regex(es) on the image file path.\n"
"Supported regex: '#' matches a single digit, '@' one or more digits, '?' one character and '*' zero or more.",
value="",
),
desc.ChoiceParam(
name="ccType",
label="Colorchart Type",
description="Colorchart type:\n"
" - mcc24 classical macbeth 24 patches\n"
" - sg140 Digital SG 140 patches\n"
" - Vinyl18 DKK colorchart 12 patches + 6 rectangles",
value="mcc24",
values=["mcc24", "sg140", "Vinyl18"],
exclusive=True,
),
desc.File(
name="modelFolder",
label="Model Folder",
description="DNN model directory path.",
value="${ALICEVISION_COLORCHARTDETECTION_MODEL_FOLDER}",
),
desc.IntParam(
name="maxCount",
label="Max Count By Image",
description="Maximum color charts count to detect in a single image.",
value=1,
range=(1, 3, 1),
advanced=True,
),
desc.BoolParam(
name="debug",
label="Debug",
description="If checked, debug data will be generated.",
value=False,
),
desc.BoolParam(
name="processAllImages",
label="Process All Images",
description="If checked, detection will be launched on all images.\n"
"If unchecked, only images with a name fitting a regular expression are considered.",
value=True,
),
desc.File(
name="filter",
label="Filter",
description="Regex to select the images on which the colorchecker detection will be computed.",
value="*_macbeth.*",
enabled=lambda node: not node.processAllImages.value
),
desc.ChoiceParam(
name="verboseLevel",
label="Verbose Level",
description="Verbosity level (fatal, error, warning, info, debug, trace).",
values=VERBOSE_LEVEL,
value="info",
),
]
outputs = [
desc.File(
name="outputData",
label="Color Checker Data",
description="Output position and colorimetric data extracted from detected color checkers in the images.",
value="{nodeCacheFolder}/ccheckers.json",
),
]