Skip to content

Commit 64015e5

Browse files
Release 2.0.1 (#3)
# Release 2.0.1 ## Bugfix - ROI too small for bigger images - Translation was limited to positive values
1 parent af3accd commit 64015e5

6 files changed

Lines changed: 47 additions & 14 deletions

File tree

CHANGELOG.md

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,12 @@
11
# Changelog
22
All notable changes to this project will be documented in this file.
33

4+
## Release 2.0.1
5+
6+
### Bugfix
7+
- ROI too small for bigger images
8+
- Translation was limited to positive values
9+
410
## Release 2.0.0
511

612
### New features

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
@@ -815,7 +815,7 @@
815815
<layout-column id="ColumnLayout28"
816816
style="align-items: stretch">
817817
<davinci-numeric-field id="NF_ResultTransX"
818-
type="outline" min="0" max="9999" ticks="1"
818+
type="outline" min="-99999" max="99999" ticks="1"
819819
group-separator="," decimal-separator="."
820820
format-pattern="0">
821821
<crown-edpws-binding property="value"
@@ -831,7 +831,7 @@
831831
<layout-column id="ColumnLayout29"
832832
style="align-items: stretch">
833833
<davinci-numeric-field id="NF_ResultTransY"
834-
type="outline" min="0" max="9999" ticks="1"
834+
type="outline" min="-99999" max="99999" ticks="1"
835835
group-separator="," decimal-separator="."
836836
format-pattern="0">
837837
<crown-edpws-binding property="value"

CSK_Module_MultiImageEdgeMatcher/project.mf.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -470,7 +470,7 @@ Setting this parameter will invalidate any previous teach call!</desc>
470470
</crown>
471471
</crown>
472472
<meta key="author">SICK AG</meta>
473-
<meta key="version">2.0.0</meta>
473+
<meta key="version">2.0.1</meta>
474474
<meta key="priority">low</meta>
475475
<meta key="copy-protected">false</meta>
476476
<meta key="read-protected">false</meta>

CSK_Module_MultiImageEdgeMatcher/scripts/CSK_MultiImageEdgeMatcher_Processing.lua

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -39,6 +39,7 @@ local width_ROI = 100.0 -- width of ROI
3939
local height_ROI = 100.0 -- height of ROI
4040
local center_ROI = Point.create(centerX_ROI, centerY_ROI) -- centerPoint of ROI
4141
local roi = Shape.createRectangle(center_ROI, width_ROI, height_ROI) -- ROI itself
42+
local gotImageSize = false -- Flag to check if image size was checked
4243

4344
-- Event to notify amount of found matches
4445
Script.serveEvent("CSK_MultiImageEdgeMatcher.OnNewStatusFoundMatches" .. multiImageEdgeMatcherInstanceNumberString, "MultiImageEdgeMatcher_OnNewStatusFoundMatches" .. multiImageEdgeMatcherInstanceNumberString, 'int')
@@ -96,6 +97,24 @@ processingParams.matcher:setTimeout(processingParams.timeout)
9697
processingParams.resultTransX = scriptParams:get('resultTransX')
9798
processingParams.resultTransY = scriptParams:get('resultTransY')
9899

100+
--- Function to create ROI related to image size
101+
---@param img Image Image to process
102+
local function checkForImageSize(img)
103+
local width_ROI, height_ROI = Image.getSize(img)
104+
local pixelSizeX = Image.getPixelSize(img)
105+
106+
width_ROI = width_ROI * pixelSizeX
107+
height_ROI = height_ROI * pixelSizeX
108+
109+
centerX_ROI = width_ROI/2
110+
centerY_ROI = height_ROI/2
111+
112+
center_ROI = Point.create(centerX_ROI, centerY_ROI)
113+
roi = Shape.createRectangle(center_ROI, width_ROI/6, height_ROI/6)
114+
115+
gotImageSize = true
116+
end
117+
99118
---------------------------
100119

101120
--- Function to teach the EdgeMachter instance.
@@ -104,6 +123,9 @@ local function teachEdgeMatcher(img)
104123

105124
viewer:clear()
106125
local parentID = viewer:addImage(img, nil, imageID)
126+
if not gotImageSize then
127+
checkForImageSize(img)
128+
end
107129
viewer:addShape(roi, decorationOK, roiID, parentID)
108130
viewer:installEditor(roiID)
109131
installedEditorIconic = roiID
@@ -152,6 +174,9 @@ local function handleOnNewProcessing(image)
152174
if installedEditorIconic == nil then
153175
viewer:clear()
154176
local parentEditorID = viewer:addImage(image, nil, imageID)
177+
if not gotImageSize then
178+
checkForImageSize(image)
179+
end
155180
viewer:addShape(roi, decorationOK, roiID, parentEditorID)
156181
viewer:installEditor(roiID)
157182
installedEditorIconic = roiID

README.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,8 @@ Tested on
1919

2020
|Device|Firmware|Module version|
2121
|--|--|--|
22+
|SIM1012|V2.4.2|V2.0.1|
23+
|SIM2x00|V1.8.0|V2.0.1|
2224
|SIM1012|V2.4.2|V2.0.0|
2325
|SICK AppEngine|V1.7.0|V2.0.0|
2426
|SICK AppEngine|V1.5.0|V1.0.0|

docu/CSK_Module_MultiImageEdgeMatcher.html

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
<meta name="viewport" content="width=device-width, initial-scale=1.0">
77
<meta name="generator" content="Asciidoctor 2.0.12">
88
<meta name="author" content="SICK AG">
9-
<title>Documentation - CSK_Module_MultiImageEdgeMatcher 2.0.0</title>
9+
<title>Documentation - CSK_Module_MultiImageEdgeMatcher 2.0.1</title>
1010
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/4.7.0/css/font-awesome.min.css">
1111
<style>
1212
/* Stylesheet for CodeRay to match GitHub theme | MIT License | http://foundation.zurb.com */
@@ -615,11 +615,11 @@
615615
</head>
616616
<body class="article toc2 toc-left">
617617
<div id="header">
618-
<h1>Documentation - CSK_Module_MultiImageEdgeMatcher 2.0.0</h1>
618+
<h1>Documentation - CSK_Module_MultiImageEdgeMatcher 2.0.1</h1>
619619
<div class="details">
620620
<span id="author" class="author">SICK AG</span><br>
621-
<span id="revnumber">version 2.0.0,</span>
622-
<span id="revdate">2024-08-14</span>
621+
<span id="revnumber">version 2.0.1,</span>
622+
<span id="revdate">2025-02-05</span>
623623
</div>
624624
<div id="toc" class="toc2">
625625
<div id="toctitle">Table of Contents</div>
@@ -817,11 +817,11 @@ <h2 id="_document_metadata">Document metadata</h2>
817817
</tr>
818818
<tr>
819819
<th class="tableblock halign-left valign-top"><p class="tableblock">Version</p></th>
820-
<td class="tableblock halign-left valign-top"><p class="tableblock">2.0.0</p></td>
820+
<td class="tableblock halign-left valign-top"><p class="tableblock">2.0.1</p></td>
821821
</tr>
822822
<tr>
823823
<th class="tableblock halign-left valign-top"><p class="tableblock">Date</p></th>
824-
<td class="tableblock halign-left valign-top"><p class="tableblock">2024-08-14</p></td>
824+
<td class="tableblock halign-left valign-top"><p class="tableblock">2025-02-05</p></td>
825825
</tr>
826826
<tr>
827827
<th class="tableblock halign-left valign-top"><p class="tableblock">Author</p></th>
@@ -4933,7 +4933,7 @@ <h6 id="_parameters_27">Parameters</h6>
49334933
<td class="tableblock halign-left valign-top"><p class="tableblock">Instance</p></td>
49344934
<td class="tableblock halign-left valign-top"><p class="tableblock">INT</p></td>
49354935
<td class="tableblock halign-left valign-top"><p class="tableblock">1</p></td>
4936-
<td class="tableblock halign-left valign-top"><p class="tableblock">Numeric identifier of processing instance (must be &gt;=1).</p></td>
4936+
<td class="tableblock halign-left valign-top"><p class="tableblock">Numeric identifier of processing instance.</p></td>
49374937
</tr>
49384938
</tbody>
49394939
</table>
@@ -5084,7 +5084,7 @@ <h6 id="_parameters_29">Parameters</h6>
50845084
<td class="tableblock halign-left valign-top"><p class="tableblock">Instance</p></td>
50855085
<td class="tableblock halign-left valign-top"><p class="tableblock">INT</p></td>
50865086
<td class="tableblock halign-left valign-top"><p class="tableblock">1</p></td>
5087-
<td class="tableblock halign-left valign-top"><p class="tableblock">Numeric identifier of processing instance (must be &gt;=1).</p></td>
5087+
<td class="tableblock halign-left valign-top"><p class="tableblock">Numeric identifier of processing instance.</p></td>
50885088
</tr>
50895089
</tbody>
50905090
</table>
@@ -5325,7 +5325,7 @@ <h6 id="_parameters_31">Parameters</h6>
53255325
<td class="tableblock halign-left valign-top"><p class="tableblock">Instance</p></td>
53265326
<td class="tableblock halign-left valign-top"><p class="tableblock">INT</p></td>
53275327
<td class="tableblock halign-left valign-top"><p class="tableblock">1</p></td>
5328-
<td class="tableblock halign-left valign-top"><p class="tableblock">Numeric identifier of processing instance (must be &gt;=1).</p></td>
5328+
<td class="tableblock halign-left valign-top"><p class="tableblock">Numeric identifier of processing instance.</p></td>
53295329
</tr>
53305330
</tbody>
53315331
</table>
@@ -5757,8 +5757,8 @@ <h3 id="API:Enum:CSK_MultiImageEdgeMatcher.BackgroundClutterLevel"><span class="
57575757
</div>
57585758
<div id="footer">
57595759
<div id="footer-text">
5760-
Version 2.0.0<br>
5761-
Last updated 2024-08-14 16:10:34 +0200
5760+
Version 2.0.1<br>
5761+
Last updated 2025-02-05 15:19:56 +0100
57625762
</div>
57635763
</div>
57645764
<script type="text/javascript">

0 commit comments

Comments
 (0)