Skip to content

Commit e9073b0

Browse files
committed
- Updated UI
- Added new set functions - Fixed some issues after review (multi matcher did not work) - Showing TOTAL + VALID matches - Show matchID + score in image
1 parent 964ee7a commit e9073b0

9 files changed

Lines changed: 2431 additions & 549 deletions

File tree

CSK_Module_MultiImageEdgeMatcher/pages/pages/CSK_Module_MultiImageEdgeMatcher/CSK_Module_MultiImageEdgeMatcher.css

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,5 +5,10 @@
55
margin: 6px;
66
}
77

8-
.myCustomCssClass_CSK_Module_MultiImageEdgeMatcher {
8+
.myCustomMinHeight35px_CSK_Module_MultiImageEdgeMatcher {
9+
min-height: 35px;
10+
}
11+
12+
.myCustomMarginLeft30px_CSK_Module_MultiImageEdgeMatcher {
13+
margin-left: 30px;
914
}

CSK_Module_MultiImageEdgeMatcher/pages/pages/CSK_Module_MultiImageEdgeMatcher/CSK_Module_MultiImageEdgeMatcher.html

Lines changed: 463 additions & 167 deletions
Large diffs are not rendered by default.
Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,10 @@
11
export function convertToList(value) {
22
return JSON.parse(value)
3+
}
4+
5+
export function changeID(id) {
6+
const viewerElement = document.getElementById('Viewer2D1');
7+
viewerElement.setAttribute('viewer-id', id);
8+
viewerElement.triggerResume();
9+
return id;
310
}

CSK_Module_MultiImageEdgeMatcher/project.mf.xml

Lines changed: 109 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -14,11 +14,18 @@ Typically to configure this module to work with other modules you should do this
1414
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'). +
17-
4) Optionally edit EdgeMatcher parameters via 'setEdgeThreshold', 'setMaximumMatches', 'setDownsampleFactor'. +
17+
4) Optionally edit EdgeMatcher parameters via 'setEdgeThreshold', 'setMaximumMatches', 'setDownsampleFactor', ... (check other 'set....' function as well..). +
18+
INFO: Regarding further details of the EdgeMatcher parameters please read the AppSpace API documentation. +
1819
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.+
1920
6) Define the minimum valid score via 'setMinScore'. +
2021
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. +
2122
{empty} +</desc>
23+
<enum name="BackgroundClutterLevel" trait="released">
24+
<desc>Background clutter level.</desc>
25+
<item desc="Set if image contains a lot of other edges, structures, noise, clutter in areas not belonging to the object of interest (like barcodes and text which generate a lot of edge responses)." name="HIGH">HIGH</item>
26+
<item desc="Set for clean scenes to gain speed." name="MEDIUM">MEDIUM</item>
27+
<item desc="Set for clean scenes to gain speed." name="LOW">LOW</item>
28+
</enum>
2229
<serves>
2330
<event name="OnNewStatusLoadParameterOnReboot">
2431
<desc>Notify status if parameters should be loaded on app/device boot up.</desc>
@@ -36,8 +43,8 @@ Typically to configure this module to work with other modules you should do this
3643
<desc>Event to share processing parameters to the instances.</desc>
3744
<param desc="Numeric identifier of the instance to receive the parameter." multiplicity="1" name="objectNo" type="int"/>
3845
<param desc="Name of the parameter." multiplicity="1" name="parameter" type="string"/>
39-
<param desc="Value of the parameter." multiplicity="1" name="value" type="auto"/>
40-
<param desc="Numeric identifier, if parameter is for specific internal used object." multiplicity="?" name="internalObjectNo" type="int"/>
46+
<param desc="Value of the parameter." multiplicity="?" name="value" type="auto"/>
47+
<param desc="Numeric identifier, if parameter is for specific internal used object." multiplicity="?" name="internalObjectNo" type="int"/>
4148
</event>
4249
<event name="OnNewSelectedInstance">
4350
<desc>Notify if new instance is selected.</desc>
@@ -123,7 +130,7 @@ INFO: Other modules can check via "Script.isServedAsEvent" if event of sepecific
123130
Example of dynamically created event to provide score of match. +
124131
NUM will be replaced by the numeric identifier of instance (e.g. "OnNewStatusMatchScoreResult1"). +
125132
INFO: Other modules can check via "Script.isServedAsEvent" if event of sepecific instance exists.</desc>
126-
<param desc="Score of match." multiplicity="1" name="score" type="float"/>
133+
<param desc="Scores of matches." multiplicity="*" name="score" type="float"/>
127134
</event>
128135
<event name="OnNewStatusMatchScoreResult">
129136
<desc>Notify score of found match of currently selected EdgeMatcher instance.</desc>
@@ -153,6 +160,60 @@ INFO: Other modules can check via "Script.isServedAsEvent" if event of sepecific
153160
<desc>Notify pixel to transform result in y direction.</desc>
154161
<param desc="Pixel in y direction." multiplicity="1" name="value" type="int"/>
155162
</event>
163+
<event name="OnNewStatusFoundValidMatches">
164+
<desc>Notify amount of found matches with valid score of currently selected EdgeMatcher instance.</desc>
165+
<param desc="Amount of found matches." multiplicity="1" name="amount" type="string"/>
166+
</event>
167+
<event name="OnNewStatusFoundValidMatchesNUM">
168+
<desc>Example of dynamically created event to provide result of found matches with valid score. +
169+
NUM will be replaced by the number of instance (e.g. "OnNewStatusFoundValidMatches1"). +
170+
INFO: Other modules can check via "Script.isServedAsEvent" if event of sepecific instance exists.</desc>
171+
<param desc="Amount of found matches with valid score." multiplicity="1" name="amount" type="int"/>
172+
</event>
173+
<event name="OnNewStatusTought">
174+
<desc>Notify if matcher was teached already.</desc>
175+
<param desc="Status" multiplicity="1" name="status" type="bool"/>
176+
</event>
177+
<event name="OnNewStatusBackgroundClutter">
178+
<desc>Notify background clutter level.</desc>
179+
<param desc="Background clutter level." multiplicity="1" name="level" type="string"/>
180+
</event>
181+
<event name="OnNewStatusMinimumSeparation">
182+
<desc>Notify minimum separation between the center of object matches.</desc>
183+
<param desc="The minimum separation between the centers of two objects in image world units." multiplicity="1" name="minSeparation" type="float"/>
184+
</event>
185+
<event name="OnNewStatusPerformFineSearch">
186+
<desc>Notify if the fine search should be perfromed.</desc>
187+
<param desc="Status" multiplicity="1" name="status" type="bool"/>
188+
</event>
189+
<event name="OnNewStatusRotationRange">
190+
<desc>Notify angle in degree, the maximum deviation from the original object orientation to search for.</desc>
191+
<param desc="Angle in degree." multiplicity="1" name="angle" type="float"/>
192+
</event>
193+
<event name="OnNewStatusPriorRotation">
194+
<desc>Notify prior orientation for rotation range.</desc>
195+
<param desc="Prior orientation in degree." multiplicity="1" name="priorRotation" type="float"/>
196+
</event>
197+
<event name="OnNewStatusMinScale">
198+
<desc>Notify smallest scale factor to search for.</desc>
199+
<param desc="Lower limit is 0.8. Default value is 1.0" multiplicity="1" name="minScale" type="float"/>
200+
</event>
201+
<event name="OnNewStatusMaxScale">
202+
<desc>Notify largest scale factor to search for.</desc>
203+
<param desc="Upper limit is 1.2. Default value is 1.0." multiplicity="1" name="maxScale" type="float"/>
204+
</event>
205+
<event name="OnNewStatusPriorScale">
206+
<desc>Notfiy prior scale factor for scale ranger.</desc>
207+
<param desc="Min: 0.1. Max: 10" multiplicity="1" name="priorScale" type="float"/>
208+
</event>
209+
<event name="OnNewStatusTileCount">
210+
<desc>Notify how many tile images the match image should be splitted into.</desc>
211+
<param desc="Number of tile images to split into." multiplicity="1" name="tileCount" type="int"/>
212+
</event>
213+
<event name="OnNewStatusTimeout">
214+
<desc>Notify time in seconds after which the match algorithm should abort.</desc>
215+
<param desc="Time in seconds after which the algorithm should abort." multiplicity="1" name="timeoutSeconds" type="float"/>
216+
</event>
156217
<function name="setParameterName">
157218
<desc>Function to set the name of the parameters if saved/loaded via the CSK_PersistentData module.</desc>
158219
<param desc="Name of the parameter" multiplicity="1" name="name" type="string"/>
@@ -234,10 +295,53 @@ Setting this parameter will invalidate any previous teach call!</desc>
234295
<desc>Function to set image translation in y direction added to found object position.</desc>
235296
<param desc="Pixel in y direction." multiplicity="1" name="value" type="int"/>
236297
</function>
298+
<function name="unteach">
299+
<desc>Function to unteach matcher.</desc>
300+
</function>
301+
<function name="setBackgroundClutter">
302+
<desc>Function to set background clutter level.</desc>
303+
<param desc="Expected background clutter level." multiplicity="1" name="level" ref="CSK_MultiImageEdgeMatcher.BackgroundClutterLevel" type="enum"/>
304+
</function>
305+
<function name="setMinSeparation">
306+
<desc>Function to set the minimum separation between the centers of object matches.</desc>
307+
<param desc="The minimum separation between the centers of two objects in image world units. The default value is 50." multiplicity="1" name="minSeparation" type="float"/>
308+
</function>
309+
<function name="setFineSearch">
310+
<desc>Function to set status if fine search should be performed.</desc>
311+
<param desc="Default is true." multiplicity="1" name="status" type="bool"/>
312+
</function>
313+
<function name="setRotationRange">
314+
<desc>Function to set rotation interval to search in relative to the teach orientation.</desc>
315+
<param desc="Angle in degree unit, the maximum deviation from the original object orientation to search for. The default value is 180 degrees, i.e., full rotation." multiplicity="1" name="range" type="float"/>
316+
</function>
317+
<function name="setPriorRotation">
318+
<desc>Function to set prior orientation for rotation interval (see TODO).</desc>
319+
<param desc="Prior orientation in degrees. The orientation search range is centered around this orientation. Default is zero (i.e. same orientation as teach object)." multiplicity="1" name="orientation" type="float"/>
320+
</function>
321+
<function name="setMinScale">
322+
<desc>Function to set minimum of scale interval to search relative to the teach size.</desc>
323+
<param desc="The smallest scale factor to search for. Lower limit is 0.8. Default value is 1.0." multiplicity="1" name="value" type="float"/>
324+
</function>
325+
<function name="setMaxScale">
326+
<desc>Function to set maximum of scale interval to search relative to the teach size.</desc>
327+
<param desc="The largest scale factor to search for. Upper limit is 1.2. Default value is 1.0." multiplicity="1" name="value" type="float"/>
328+
</function>
329+
<function name="setPriorScale">
330+
<desc>Function to set prior scale factor of scale interval to search relative to the teach size.</desc>
331+
<param desc="Set to the expected scale of the object to find, relative to the size of the teach object. E.g. 1.25 if the object to find is 25% larger than the teach object. Min: 0.1. Max: 10" multiplicity="1" name="value" type="float"/>
332+
</function>
333+
<function name="setTileCount">
334+
<desc>Function to set into how many tile images the match image should be splitted into.</desc>
335+
<param desc="Number of tile images to split into. 0 gives automatic selection. 1 disables tiling. Default: 0." multiplicity="1" name="value" type="int"/>
336+
</function>
337+
<function name="setTimeout">
338+
<desc>Function to set the time the match call should abort if time exceeds.</desc>
339+
<param desc="Time in seconds after which the algorithm should abort. The default value is 5 seconds." multiplicity="1" name="value" type="float"/>
340+
</function>
237341
</serves>
238342
</crown>
239343
<meta key="author">SICK AG</meta>
240-
<meta key="version">0.1.0</meta>
344+
<meta key="version">1.0.0</meta>
241345
<meta key="priority">low</meta>
242346
<meta key="copy-protected">false</meta>
243347
<meta key="read-protected">false</meta>

0 commit comments

Comments
 (0)