Skip to content

Commit 964ee7a

Browse files
committed
1 parent 1fa408a commit 964ee7a

4 files changed

Lines changed: 28 additions & 28 deletions

File tree

CSK_Module_MultiImageEdgeMatcher/pages/pages/CSK_Module_MultiImageEdgeMatcher/CSK_Module_MultiImageEdgeMatcher.html

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -116,7 +116,7 @@
116116
</layout-column>
117117
<layout-column id="ColumnLayout17" style="align-items: stretch">
118118
<davinci-numeric-field id="NF_MinScore" type="outline" min="0" max="1"
119-
ticks="1" group-separator="," decimal-separator="."
119+
ticks="0.01" group-separator="," decimal-separator="."
120120
format-pattern="0.00">
121121
<crown-edpws-binding property="value"
122122
name="CSK_MultiImageEdgeMatcher/OnNewStatusMinimalScore"
@@ -173,7 +173,7 @@
173173
</layout-column>
174174
</layout-row>
175175
<davinci-value-display id="VD_ResultTranslation"
176-
value="Result translation in X / Y directin [px]:">
176+
value="Result translation in X / Y direction [px]:">
177177
</davinci-value-display>
178178
<layout-row id="RowLayout19">
179179
<layout-column id="ColumnLayout28" style="align-items: stretch">

CSK_Module_MultiImageEdgeMatcher/project.mf.xml

Lines changed: 16 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -11,11 +11,11 @@ This module provides a UI for all relevant features. +
1111
{empty} +
1212
Typically to configure this module to work with other modules you should do this: +
1313
{empty} +
14-
1) If multiple instances are needed, these can be added via 'addInstance' (not needed if you only use 1 single instace). +
14+
1) If multiple instances are needed, these can be added via 'addInstance' (not needed if you only use 1 single instance). +
1515
2) Select the instance you want to configur via setInstance(). +
1616
3) Set the event providing the images to be processed e.g. via setRegisterEvent('CSK_ImagePlayer.OnNewImage'). +
1717
4) Optionally edit EdgeMatcher parameters via 'setEdgeThreshold', 'setMaximumMatches', 'setDownsampleFactor'. +
18-
5) Press the "Teach Mode" button within the UI. It will provide a ROI editor to select a an object and show its teached edges. Press the button again to confirm the teached structure.+
18+
5) Press the "Teach Mode" button within the UI. It will provide a ROI (Region of interest) editor to select an object and show its tought edges. Press the button again to confirm the tought structure.+
1919
6) Define the minimum valid score via 'setMinScore'. +
2020
7) The module will align the image in relation to the first found object. Other modules can register on the 'CSK_MultiImageEdgeMatcher.OnNewAlignedImage[NUM]' event to receive the aligned image for further processing, on the 'CSK_MultiImageEdgeMatcher.OnNewTransformation[NUM]' event to receive the transformation itself or on 'OnNewStatusFoundMatchesNUM' / 'OnNewStatusMatchScoreResultNUM' to receive the processing result values. +
2121
{empty} +</desc>
@@ -34,17 +34,17 @@ Typically to configure this module to work with other modules you should do this
3434
</event>
3535
<event name="OnNewProcessingParameter">
3636
<desc>Event to share processing parameters to the instances.</desc>
37-
<param desc="Number of the instance to receive the parameter." multiplicity="1" name="objectNo" type="int"/>
37+
<param desc="Numeric identifier of the instance to receive the parameter." multiplicity="1" name="objectNo" type="int"/>
3838
<param desc="Name of the parameter." multiplicity="1" name="parameter" type="string"/>
3939
<param desc="Value of the parameter." multiplicity="1" name="value" type="auto"/>
40-
<param desc="If parameter is for specifici internal used object, its number." multiplicity="?" name="internalObjectNo" type="int"/>
40+
<param desc="Numeric identifier, if parameter is for specific internal used object." multiplicity="?" name="internalObjectNo" type="int"/>
4141
</event>
4242
<event name="OnNewSelectedInstance">
4343
<desc>Notify if new instance is selected.</desc>
4444
<param desc="Selected instance." multiplicity="1" name="selectedObject" type="int"/>
4545
</event>
4646
<event name="OnDataLoadedOnReboot">
47-
<desc>Event to call if module tried to load parameters and should be ready.</desc>
47+
<desc>Event to call after module loaded parameters and is ready.</desc>
4848
</event>
4949
<event name="OnNewParameterName">
5050
<desc>Notify name of persistent data parameter.</desc>
@@ -68,15 +68,15 @@ Typically to configure this module to work with other modules you should do this
6868
</event>
6969
<event name="OnNewValueUpdateNUM">
7070
<desc>Example of dynamically created event to sync paramters between instance threads and Controller part of module. +
71-
NUM will be replaced by the number of instance (e.g. "OnNewValueUpdate1"). +</desc>
72-
<param desc="Instance new value is coming from." multiplicity="1" name="instance" type="int"/>
71+
NUM will be replaced by the numeric identifier of instance (e.g. "OnNewValueUpdate1"). +</desc>
72+
<param desc="Instance the new value is coming from." multiplicity="1" name="instance" type="int"/>
7373
<param desc="Name of the paramter to update/sync." multiplicity="1" name="parameter" type="string"/>
7474
<param desc="Value to update." multiplicity="1" name="value" type="auto"/>
75-
<param desc="Optionally if internal parameter should be used for internal objects." multiplicity="?" name="selectedObject" type="int"/>
75+
<param desc="Optional: If internal parameter should be used for internal objects." multiplicity="?" name="selectedObject" type="int"/>
7676
</event>
7777
<event name="OnNewValueToForwardNUM">
7878
<desc>Example of dynamically created event to forward data from instance thread to Controller part of module, e.g. to forward values to UI. +
79-
NUM will be replaced by the number of instance (e.g. "OnNewValueToForward1"). +</desc>
79+
NUM will be replaced by the numeric identifier of instance (e.g. "OnNewValueToForward1"). +</desc>
8080
<param desc="Eventname to use to forward value." multiplicity="1" name="eventname" type="string"/>
8181
<param desc="Value to forward." multiplicity="1" name="value" type="auto"/>
8282
</event>
@@ -114,14 +114,14 @@ NUM will be replaced by the number of instance (e.g. "OnNewValueToForward1"). +<
114114
</event>
115115
<event name="OnNewAlignedImageNUM">
116116
<desc>Example of dynamically created event to provide aligned image to be used for post processing. +
117-
NUM will be replaced by the number of instance (e.g. "OnNewAlignedImage1"). +
117+
NUM will be replaced by the numeric identifier of instance (e.g. "OnNewAlignedImage1"). +
118118
INFO: Other modules can check via "Script.isServedAsEvent" if event of sepecific instance exists.</desc>
119119
<param alias="Image" desc="Aligned image" multiplicity="1" name="image" type="object"/>
120120
</event>
121121
<event name="OnNewStatusMatchScoreResultNUM">
122122
<desc>Notify score of match.
123123
Example of dynamically created event to provide score of match. +
124-
NUM will be replaced by the number of instance (e.g. "OnNewStatusMatchScoreResult1"). +
124+
NUM will be replaced by the numeric identifier of instance (e.g. "OnNewStatusMatchScoreResult1"). +
125125
INFO: Other modules can check via "Script.isServedAsEvent" if event of sepecific instance exists.</desc>
126126
<param desc="Score of match." multiplicity="1" name="score" type="float"/>
127127
</event>
@@ -135,13 +135,13 @@ INFO: Other modules can check via "Script.isServedAsEvent" if event of sepecific
135135
</event>
136136
<event name="OnNewStatusFoundMatchesNUM">
137137
<desc>Example of dynamically created event to provide result of found matches. +
138-
NUM will be replaced by the number of instance (e.g. "OnNewStatusFoundMatches1"). +
138+
NUM will be replaced by the numeric identifier of instance (e.g. "OnNewStatusFoundMatches1"). +
139139
INFO: Other modules can check via "Script.isServedAsEvent" if event of sepecific instance exists.</desc>
140140
<param desc="Amount of found matches." multiplicity="1" name="amount" type="int"/>
141141
</event>
142142
<event name="OnNewTransformationNUM">
143143
<desc>Example of dynamically created event to provide transformation data to be used for post processing. +
144-
NUM will be replaced by the number of instance (e.g. "OnNewTransformation1"). +
144+
NUM will be replaced by the numeric identifier of instance (e.g. "OnNewTransformation1"). +
145145
INFO: Other modules can check via "Script.isServedAsEvent" if event of sepecific instance exists.</desc>
146146
<param alias="Transform" desc="Transformation" multiplicity="1" name="transform" type="object"/>
147147
</event>
@@ -151,7 +151,7 @@ INFO: Other modules can check via "Script.isServedAsEvent" if event of sepecific
151151
</event>
152152
<event name="OnNewStatusResultTranslateY">
153153
<desc>Notify pixel to transform result in y direction.</desc>
154-
<param desc="Pixel in x direction." multiplicity="1" name="value" type="int"/>
154+
<param desc="Pixel in y direction." multiplicity="1" name="value" type="int"/>
155155
</event>
156156
<function name="setParameterName">
157157
<desc>Function to set the name of the parameters if saved/loaded via the CSK_PersistentData module.</desc>
@@ -180,13 +180,13 @@ INFO: Other modules can check via "Script.isServedAsEvent" if event of sepecific
180180
<return desc="Amount of created instances." multiplicity="1" name="amount" type="int"/>
181181
</function>
182182
<function name="setRegisterEvent">
183-
<desc>Configure event that this module should listen to. If this one is notified, it will be linked to internal processing function. +
183+
<desc>Configure event that this module should listen to. If this event is notified, it will be linked to the internal processing function. +
184184
(Will be set to currently active instance, see 'setSelectedObject')</desc>
185185
<param desc="Event name to listen to." multiplicity="1" name="event" type="string"/>
186186
</function>
187187
<function name="processInstanceNUM">
188188
<desc>Example of dynamically served function to process internally coded function. +
189-
NUM will be replaced by the number of instance (e.g. "processInstance1"). +
189+
NUM will be replaced by the numeric identifier of instance (e.g. "processInstance1"). +
190190
INFO: Other modules can check via "Script.isServedAsFunction" if function of sepecific instance exists. +
191191
Needs then to be called via "Script.callFunction".</desc>
192192
<param alias="Image" desc="Transferred object (optional)" multiplicity="1" name="image" type="object"/>

CSK_Module_MultiImageEdgeMatcher/scripts/CSK_MultiImageEdgeMatcher_Processing.lua

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ local decorationOK = View.ShapeDecoration.create()
3030
decorationOK:setFillColor(0, 127, 195, 50)
3131
decorationOK:setLineWidth(3)
3232

33-
local teached = false
33+
local tought = false
3434

3535
local centerX_ROI = 100.0 -- xPos of ROI
3636
local centerY_ROI = 100.0 -- yPos of ROI
@@ -101,7 +101,7 @@ local function teachEdgeMatcher(img)
101101
local teachPose = processingParams.matcher:teach(img, teachRegion)
102102
if teachPose then
103103
_G.logger:info("Teach OK")
104-
teached = true
104+
tought = true
105105

106106
local serMatcher = Object.serialize(processingParams.matcher, 'JSON')
107107
Script.notifyEvent("MultiImageEdgeMatcher_OnNewValueUpdate" .. multiImageEdgeMatcherInstanceNumberString, multiImageEdgeMatcherInstanceNumber, 'matcher', serMatcher)
@@ -126,7 +126,7 @@ local function teachEdgeMatcher(img)
126126
viewer:present()
127127
else
128128
_G.logger:warning(nameOfModule .. ": Edge Matcher teaching not succesfull.")
129-
teached = false
129+
tought = false
130130
end
131131

132132
end
@@ -171,7 +171,7 @@ local function handleOnNewProcessing(image)
171171
local parentID = viewer:addImage(image)
172172
end
173173

174-
if teached then
174+
if tought then
175175

176176
-- Finding object pose
177177
local poses, scores = processingParams.matcher:match(image)
@@ -275,7 +275,7 @@ local function handleOnNewProcessingParameter(multiImageEdgeMatcherNo, parameter
275275
Script.deregister(processingParams.registeredEvent, handleOnNewProcessing)
276276
processingParams.registeredEvent = ''
277277

278-
elseif parameter == 'chancelEditors' then
278+
elseif parameter == 'cancelEditors' then
279279
roiEditorActive = false
280280

281281
elseif parameter == 'roiEditorActive' then
@@ -294,13 +294,13 @@ local function handleOnNewProcessingParameter(multiImageEdgeMatcherNo, parameter
294294
elseif parameter == 'matcher' then
295295
processingParams.matcher = value
296296

297-
-- Check if new matcher was teached.
297+
-- Check if new matcher was tought.
298298
local suc = Image.Matching.EdgeMatcher.getTeachPose(value)
299299
if suc then
300-
teached = true
300+
tought = true
301301
-- Future improvement: Get Values from matcher?
302302
else
303-
teached = false
303+
tought = false
304304
end
305305

306306
else
@@ -309,7 +309,7 @@ local function handleOnNewProcessingParameter(multiImageEdgeMatcherNo, parameter
309309
processingParams.matcher:setEdgeThreshold(processingParams.edgeThreshold)
310310
elseif parameter == 'downsampleFactor' then
311311
processingParams.matcher:setDownsampleFactor(processingParams.downsampleFactor)
312-
teached = false
312+
tought = false
313313
elseif parameter == 'maxMatches' then
314314
processingParams.matcher:setMaxMatches(processingParams.maxMatches)
315315
end

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ Module to provide 2D Image EdgeMatcher functionality to search for objects withi
66

77
## How to Run
88

9-
The app includes an intuitive GUI.
9+
The app includes an intuitive GUI.
1010
For further information check out the [documentation](https://raw.githack.com/SICKAppSpaceCodingStarterKit/CSK_Module_MultiImageEdgeMatcher/main/docu/CSK_Module_MultiImageEdgeMatcher.html) in the folder "docu".
1111

1212
## Information

0 commit comments

Comments
 (0)