Troubleshooting
This page describes problems and error messages of LumiScan Template Finder, grouped by category. Start with the general checks, then find your symptom below: each problem lists its symptoms, the possible causes, a diagnostic procedure and the resolution. Problems of the Data Layer itself are described in Data Layer troubleshooting, licence problems in Licensing troubleshooting.
General checks
-
Check the status code. Read
output/status-codeof the operation that failed. Expected:1. A value greater than 0 means success,0means the operation has not run since the application started, and a value less than 0 means it failed and produced nothing. The codes are listed in Execution Status. -
Read the status text. Read
output/status-textof the same operation. It starts withok:orerror:and names every invalid input and the value it holds. A failed write toexecuteanswers with a status code only (over REST, a bare400), so the reason is only onoutput/status-text. -
Read the application log. It holds the same text, with one warning line for each invalid input: on ctrlX OS in the ctrlX Logbook or with
journalctl, on a PC in the application’s console output. How much is logged is set withlogLevelin thesystemblock oflumiscan-template-finder.json(TRACE,DEBUG,INFO,WARN,ERROR,FATALorOFF); without the key, the application logs atDEBUG. The level is read once, at startup, so restart the application after you change it.TRACEis what to set before you reproduce a problem for a support report. See Template Storage. -
Check the image source. The camera application, normally LumiScan Cam Driver, must run on the same device - the same ctrlX CORE or ctrlX IPC, or the same PC - and must have captured an image. Remote Data Layer access is not supported. Expected: the node named in
input/input-image-addressprovidesdata,width,heightandpixel-type. -
Check the order of the calls. A module runs one operation at a time, and every run clears its outputs as it starts. Expected: your program waits for
executeto return, reads the outputs, and only then triggers the next run. -
Check the licence (ctrlX OS). Expected: the application keeps running after it starts. Without a licence it shuts down shortly after starting; see Problem: The application stops shortly after starting.
The configuration directory holds lumiscan-template-finder.json, the module files <module-id>.json, the templates folder and settings-history/:
| Platform | Configuration directory |
|---|---|
ctrlX OS |
|
PC (Windows) |
|
Status codes and error messages
Problem: Status code -1 (busy)
output/status-code of find-template is -1. The write to execute answers TooManyOperations (ctrlX: DL_TOO_MANY_OPERATIONS). Nothing was done, and output/result keeps its value. With a camera streaming, this happens often. system/remove-module can answer -1 (busy) as well.
-
Another operation of the same module was still running. A second call is not queued; it returns at once and does nothing.
-
The module’s image stream is searching a frame. The stream and
find-templatenever run at the same time on one module.
-
Check in your program whether it writes to
executeof the same module again before the previous write has returned. Expected: one call per module at a time. -
Read
<module-id>/control/subscribe/output/stream/active.truemeans that the stream of this module runs.
-
If another operation was still running: wait for the running
executeto return, then call the method again. The lock is per module, so other modules are not held up. -
If the stream of the module runs:
-
Stop the stream before you call the method: set
control/subscribe/input/enabletofalseand write tocontrol/subscribe/execute. Or call the method again. -
To use the results of the stream instead, switch on
control/subscribe/input/keep-latest-outputand readfind-template/output/result.
-
-
If
system/remove-moduleanswers busy: stop the stream of the module first. Removing a module stops its stream.
Send the information listed under Information for support to support, together with the module id, the answer of the write to execute and the value of control/subscribe/output/stream/active.
Problem: Status code -2 (invalid input)
output/status-code is -2. output/status-text starts with error: and names every offending input and the value it holds, for example min-scale must be > 0, got 0. Each one is also logged as a warning.
-
A required input is empty:
input/input-image-addressorinput/template-name. -
The match mode is misspelled.
input/match-modeacceptsTM_SQDIFF,TM_SQDIFF_NORMED,TM_CCORR,TM_CCORR_NORMED,TM_CCOEFFandTM_CCOEFF_NORMED. -
A search parameter is out of range, for example
input/scale/min-scaleorinput/rotation/step-rotnot greater than 0, or a rotation outside 0 to 360. -
The image address points at this application itself.
-
A folder or file name is an absolute path, such as
/tmp/templates, or a path that leads outside the configuration directory, such as../../etc.
-
Read
output/status-textof the operation. Expected: it names each offending input and its value. -
Read the application log. Each offending input is logged as a warning.
-
If a required input is empty: set it.
input/template-nametakes an entry ofsystem/templates. -
If the match mode is misspelled: write one of the accepted names to
input/match-mode. -
If a search parameter is out of range: correct it, see Tuning the Search.
-
If the image address points at this application: set
input/input-image-addressto the image node of the camera application, for examplehdvisionsystems/lumiscan-cam-driver/camera1/output/image. -
If a path is absolute or leaves the configuration directory: give it relative to the configuration directory. A path that stays inside is fine even if it contains
...
Then run the operation again. Expected: output/status-code is 1. See Execution Status and Template Storage.
Send the information listed under Information for support to support, together with the content of output/status-text.
Problem: Status code -3 (image read failed)
output/status-code of find-template or system/create-template is -3.
-
The camera application is not running, or it runs on another device.
-
The camera application has not captured an image yet.
-
The address in
input/input-image-addressis wrong. -
The image node at the address is missing, empty or inconsistent.
-
The image uses an unsupported pixel format. Supported are
Mono8,Mono12,RGB8,RGB12,BGR8,BGR12,BayerGR8,BayerGR12,BayerRG8andBayerRG12.
-
Check that the camera application, normally LumiScan Cam Driver, runs on the same device. Expected: it runs on the same ctrlX CORE or ctrlX IPC, or on the same PC.
-
Compare
input/input-image-addresswith the address of the camera’s image node, for examplehdvisionsystems/lumiscan-cam-driver/camera1/output/image. Expected: identical.system/create-templateandfind-templateeach have their own address node. -
Read
width,heightandpixel-typeof the image node. Expected: values greater than 0, and apixel-typefrom the list above.
-
If the camera application is not running: start it on the same device and capture an image.
-
If no image has been captured yet: capture an image in the camera application.
-
If the address is wrong: correct
input/input-image-address. -
If the pixel format is not supported: use one of the supported pixel formats, see Requirements.
Then run the operation again. Expected: output/status-code is 1.
Send the information listed under Information for support to support, together with the content of output/status-text, the image address and the pixel-type of the image node.
Problem: Status code -4 (source not found)
output/status-code of find-template is -4. output/status-text names a directory or a file.
-
The message names a directory: the template folder does not exist. The default
templatesis created at startup, so either it was deleted or the folder name is wrong. -
The message names a file: the folder exists but holds no such file.
-
The file is there but is not found: it is in a different folder from the one in use. All modules share one template folder.
-
Read
output/status-text. Expected: it names a directory or a file. -
Compare
input/template-namewithsystem/templates. Expected: the name is listed, spelled the same way. -
Read
system/template-dir. Expected: it names the folder that holds the file.
-
If the folder does not exist: switch to an existing folder with
system/set-template-dir, or correct its name. The folder must already exist; it is not created for you. -
If the folder holds no such file: correct the spelling of
input/template-name, or create the template withsystem/create-template. -
If the file is in another folder: move the file into the folder
system/template-dirnames, or switch withsystem/set-template-dir.
Then run find-template again. Expected: output/status-code is 1. See Template Storage.
Send the information listed under Information for support to support, together with the content of output/status-text, input/template-name, system/template-dir and system/templates.
Problem: The crop region does not fit the image
system/create-template answers status -5 (invalid crop region), and output/status-text names the actual image size. For find-template, output/status-text names the input and the limit it broke, for example:
crop/startX + crop/width (100 + 541 = 641) exceeds the image width 640
In the image stream, the frame fails, and control/subscribe/output/stream/last-failure names a crop region that does not fit the frame.
-
The region reaches past an edge of the image. A region reaching past an edge is refused, not trimmed.
-
For
find-template, the region is smaller than the template. This is refused with status-5. -
For
system/create-template,input/crop/widthorinput/crop/heightis 0. Both must be greater than 0.
-
Read the image size from the message, or
widthandheightof the image node. -
Add
input/crop/startXandinput/crop/width, andinput/crop/startYandinput/crop/height. Expected: the sums are not larger than the image width and the image height. -
For
find-template, compare the region with the size of the template. Expected: the region is at least as large as the template.
-
If the region reaches past an edge: correct
input/crop/startX,startY,widthorheight, so that the region fits the image. A zero width or height reaches the right or bottom edge. -
If the region is smaller than the template: widen the region.
-
If width or height is 0 (
create-template): set both to the size of the region, greater than 0.
Then run the operation again. Expected: output/status-code is 1. See Finding a Template and Creating a Template.
Send the information listed under Information for support to support, together with the content of output/status-text and the four input/crop/ values.
Problem: Status code -6 (write failed)
output/status-code of system/save-module-inputs or system/create-template is -6.
-
A file could not be written - usually a permission problem or a full disk.
-
The configuration directory is not writable. The same problem is reported in the log at startup.
-
Read
output/status-textof the operation. Expected: it names the file that could not be written. -
Read the application log of the start. Expected: no message that the configuration directory is not writable.
-
Check the configuration directory (see General checks). Expected: it exists and the application can write to it.
-
If the configuration directory is not writable: make it writable for the application.
-
If the disk is full: free disk space on the device.
Then run the operation again. Expected: output/status-code is 1.
Send the information listed under Information for support to support, together with the content of output/status-text and the log of the start.
Search results
Problem: The result is empty although the status code is 1
output/status-code of find-template is 1, but matches in output/result is empty, and best_score is 0.0.
An empty matches list with status code 1 means that the search ran correctly and found nothing. That is a normal result: the part is not there, or not similar enough to pass the threshold. If a part that is there is not found:
-
The template was cut from the wrong region or the wrong image, see Problem: The template is not found even in the image it was cut from.
-
The part is rotated or at another distance than in the template, see Problem: The part is not found when it is rotated or at a different distance.
-
input/cropexcludes the part. -
The template touches the edge of the image. Such a template cannot be found near the opposite edge, because the template must fit entirely inside the searched image.
-
Background that changes from part to part is inside the template; it lowers every score.
-
Read
output/status-code. Expected:1. If it is negative, the run failed: readoutput/status-textand see the entries under Status codes and error messages. -
Search the image the template was cut from. Expected: one match at the centre of the region you specified, with a confidence close to 1.
-
Compare the orientation and the size of the part in the image with the template.
-
Read the four
input/crop/values. Expected: all0(the whole image), or a region that contains the part. -
Read
match_threshinoutput/result: the threshold that was applied (default0.9).
-
If the template is not found in its own image: follow Problem: The template is not found even in the image it was cut from.
-
If the part is rotated or at another distance: follow Problem: The part is not found when it is rotated or at a different distance.
-
If the crop excludes the part: widen the region, or set all four
input/crop/values to0. -
If the template touches the image border or holds changing background: create the template again from a region that stays away from the image border, includes what identifies the part and excludes what varies. See Creating a Template.
-
If the part was not in the image: the result is correct; nothing needs to be changed.
Send the information listed under Information for support to support, together with input/template-name, the template file and output/result.
Problem: The template is not found even in the image it was cut from
A search in the very image the template was cut from does not report the match at the centre of the region you specified, with a confidence close to 1.
-
The region given when the template was created is wrong.
-
The image address is wrong: the template was cut from another image than the one searched.
system/create-template/input/input-image-addressand<module>/find-template/input/input-image-addressare separate nodes.
The search parameters are not the cause, and no amount of tuning fixes it.
-
Compare
system/create-template/input/input-image-addresswith<module>/find-template/input/input-image-address. Expected: the same image node. -
Read the four
system/create-template/input/crop/values. Expected: a region that contains the part in that image. -
Read
system/create-template/output/template-path. Expected: the file you search for, for exampletemplates/screw.png.
-
Correct
input/input-image-addressand the crop region, then create the template again. Searched in the same image, it must be found exactly at the centre of the region you specified - (195, 250) for a region starting at (100, 200) that is 190 x 100 pixels - with a confidence close to 1.
Send the information listed under Information for support to support, together with the inputs of system/create-template, the template file and output/result.
Problem: The part is not found when it is rotated or at a different distance
The template is found in the image it was cut from, but not in a new image in which the part is rotated or closer to or further from the camera.
-
The defaults search the template at its original size and orientation only.
-
Read
input/rotation/min-rot,max-rotandinput/scale/min-scale,max-scaleof the module. At the defaults (0.0,0.0,1.0,1.0) only the original orientation and size are searched. -
Compare the part in the new image with the template. Expected: you know whether it varies in orientation, in size, or in both.
Widen only what varies, one range at a time, and stop as soon as the part is found reliably:
-
If the part rotates: set
input/rotation/max-rot(for example360) with a coarseinput/rotation/step-rot(for example5). -
If the part changes distance: set
input/scale/min-scale,input/scale/max-scaleandinput/scale/step-scale(for example0.9,1.1,0.05).
Each scale/rotation combination is a separate pass over the image, so 72 rotations and 5 scales are 360 passes. If a wider range starts producing matches in the wrong places, see Problem: A wide search reports weak matches in the wrong places. See Tuning the Search.
Send the information listed under Information for support to support, together with the scale and rotation inputs and output/result.
Problem: A wide search reports weak matches in the wrong places
With a scale or rotation range, matches holds the real match and, beside it, matches at unrelated places.
-
The confidence is not an absolute measure. The score map is rescaled for every scale/rotation step, so the best location of every step reaches a confidence near 1, and
input/match-threshacts per step. Only repeats at the same location are removed, so a weak match somewhere else can still appear.
-
Read
matches[0]andbest_score. Expected: the real match is the highest-confidence entry, at index 0. -
Read the scale and rotation inputs. A single-scale, single-rotation search behaves as expected; a range can report spurious matches.
-
Raise
input/match-thresh, for example to0.95, or narrow the scale and rotation range.
See Tuning the Search.
Send the information listed under Information for support to support, together with the inputs of find-template and output/result.
Problem: output/result is empty although the search worked a moment ago
A run produced matches, and shortly afterwards output/result is empty.
-
The next run has started. Every run clears its own outputs as soon as it begins, before anything that can fail. Triggering
executeagain and then reading gives the new run - possibly failed or still empty - not the previous one. -
A call refused with
-1(busy) clears nothing, so this is not the cause when the second call was refused.
-
Check the order of the calls in your program. Expected: it reads
output/resultbefore it triggers the nextexecute. -
Read
output/status-codeof the latest run. A negative value means that this run failed and leftoutput/resultempty.
-
If the next run started too early: wait for
executeto return, read the outputs, and only then trigger the next run. -
If the latest run failed: follow the entry for its status code.
See Execute a Method.
Send the information listed under Information for support to support, together with the sequence of calls your program makes.
Templates
Problem: The template file is on the device but missing from system/templates
A .png file is in the template folder, but system/templates does not list it.
-
The file arrived by other means - an upload through the ctrlX web interface on ctrlX OS, or a file copied into the folder on a PC - and the list was not refreshed. The list is refreshed at startup, when
system/set-template-dirsucceeds and whensystem/create-templatesaves a template. -
The extension is not a lower case
.png.SCREW.PNGis ignored. -
The file is in a different folder from the one in use.
-
Read
system/template-dir. Expected: it names the folder that holds the file. -
Check the file name. Expected: it ends in a lower case
.png.
-
If the extension is not a lower case
.png: rename the file to a lower case.png. -
If the list was not refreshed: execute
system/set-template-diragain, naming the same folder. Expected: its status code is1, andsystem/templateslists the template.
A template added while the application runs can be searched for straight away: the file is read each time, not cached at startup. See Template Storage.
Send the information listed under Information for support to support, together with system/template-dir, system/templates and the file name.
Image stream (experimental)
Problem: The image stream delivers no results
control/subscribe/output/stream/active stays false, no results arrive on control/subscribe/output/stream/result, or control/subscribe/output/stream/statistics/failed-frames grows.
-
Only the inputs were written. Writing
control/subscribe/input/enablealone starts nothing;control/subscribe/executeapplies the inputs. -
control/subscribe/executewas refused (Rejected, ctrlX:DL_INVALID_VALUE): stream mode without an address, or a queue size outside1to64. -
The settings file
<module-id>.jsoncould not be written, for example because it is not valid JSON (CreationFailed, ctrlX:DL_CREATION_FAILED). Nothing changed. -
The stream of the Cam Driver does not run, so no frames arrive.
-
The source cannot be subscribed to. The module tries it again every 5 seconds while the stream runs, and logs the first failure.
-
Frames cannot be searched, for the reasons
find-templategives in itsstatus-text.
-
Read
hdvisionsystems/lumiscan-cam-driver/<camera name>/control/publish/output/stream/active. Expected:true. -
Read
setting/stream/enableandsetting/stream/addressof the module. Expected:trueand the camera’s stream folder, for examplehdvisionsystems/lumiscan-cam-driver/camera1/control/publish/output/stream. They show what was applied last. -
Check the answer of the write to
control/subscribe/execute. Expected:Ok(ctrlX:DL_OK). These methods have nostatus-text; the reason for a refusal is in the application log. -
Read
control/subscribe/output/stream/active. Expected:true. -
Read
received-frames,processed-framesandfailed-framesundercontrol/subscribe/output/stream/statistics/. The first counter that does not grow shows where the chain stops. -
If
failed-framesgrows, readcontrol/subscribe/output/stream/last-failure. It says why the last frame failed, for example:a frame of 'hdvisionsystems/lumiscan-cam-driver/camera1/control/publish/output/stream' failed: invalid input: template-name is empty
-
If only the inputs were written: set
control/subscribe/input/enabletotrueand write tocontrol/subscribe/execute. Wait untilcontrol/subscribe/output/stream/activeistrue. -
If the call was refused (
Rejected,DL_INVALID_VALUE): write the camera’s stream folder tocontrol/subscribe/input/address, setcontrol/subscribe/input/queue-sizeto a value from1to64, and write tocontrol/subscribe/executeagain. -
If the settings file could not be written (
CreationFailed,DL_CREATION_FAILED): make<module-id>.jsonin the configuration directory valid JSON again, without comments, then write tocontrol/subscribe/executeagain. -
If the stream of the Cam Driver does not run: start it. It is not kept after a restart: call its
control/publish/executewithenable=trueafter every start, and connect the camera first. See A stream delivers nothing. -
If the source cannot be subscribed to: check that
control/subscribe/input/addressis the camera’s stream folder and that the Cam Driver runs on the same device. -
If frames fail: correct the input that
last-failurenames, as for a singlefind-templatecall.
Send the information listed under Information for support to support, together with the values under setting/stream/, the counters under control/subscribe/output/stream/statistics/, control/subscribe/output/stream/last-failure and the module’s <module-id>.json.
Modules, settings and licensing
Problem: My settings or modules are gone after a restart
After a restart of the application, a module is missing from system/modules, or a module’s inputs are back at their defaults.
-
The module list was not saved. Settings and new modules are live at once but not permanent until saved; the module list and each module’s settings are saved separately.
-
The module’s settings were not saved.
-
A save failed:
system/save-module-inputsorsystem/save-current-modulesdid not report status1. -
<module-id>.jsoncontains comments. The stream reads such a file, but the module’s inputs are then not restored at start; the log reports the file as unreadable. -
A setting whose node no longer exists after a software update is skipped, with a log entry.
Results are not saved; they are produced by the next run. Template files are already permanent: they are files in the configuration directory, on ctrlX OS part of the active solution.
-
Read
system/modulesafter the restart. Expected: all your modules. -
Check the configuration directory (see General checks). Expected:
lumiscan-template-finder.jsonnames your modules, and there is a<module-id>.jsonfor each module whose settings you saved. -
Read the application log of the start. Expected: no module file reported as unreadable, no skipped setting.
-
If the settings or the module list were not saved:
-
Set
system/save-module-inputs/input/module-id(for examplemodule-1) and write tosystem/save-module-inputs/execute. Do this for each module. -
Write to
system/save-current-modules/execute. -
Check that both report status
1.
-
-
If the module file contains comments: remove them from
<module-id>.json. Changes made to the file by hand take effect at the next start. -
If a setting was skipped after an update: set the input again and save the module’s settings.
A module’s image stream settings need no extra step: control/subscribe/execute saves them in <module-id>.json itself. To have the module itself back, save the module list as well. See Module Management and Kept in the settings file.
Send the information listed under Information for support to support, together with lumiscan-template-finder.json and the module files <module-id>.json.
Problem: The application stops shortly after starting
On ctrlX OS, the application shuts down shortly after it starts. Its nodes under hdvisionsystems/lumiscan-template-finder disappear from the Data Layer.
-
The licence is missing. The reason is written to the system log.
-
The application needs more licences than are installed. One licence covers ten modules, see Problem: Status code
-11(licence unavailable).
-
Open the ctrlX OS system log (ctrlX Logbook or
journalctl). Expected: it names the reason and the missing licence. -
Compare the licence with the ctrlX licence of LumiScan Template Finder,
SWL-W-XCx-TEMPLxFDxxHDVS-V1NN. Expected: it is installed on the device on which the application runs.
-
If the licence is missing: install a valid licence on the device and start the application again. Expected: it keeps running, and its nodes are on the Data Layer.
Send the information listed under Information for support to support, together with the lines of the system log that name the licence. For licences, contact licenses@hdvisionsystems.com.
Problem: Status code -11 (licence unavailable)
A module is refused with status code -11.
-
No licence on the device covers the module. One licence covers ten modules; the eleventh module acquires a second licence of the same key.
-
Count the entries of
system/modules. Expected: no more than ten modules for each licence on the device. -
Read
output/status-textof the operation that answered-11.
-
If more modules exist than the licences cover: remove the modules you do not need with
system/remove-moduleand save the module list withsystem/save-current-modules, or obtain another licence.
See Module Management.
Send the information listed under Information for support to support, together with system/modules. For licences, contact licenses@hdvisionsystems.com.
Information for support
If a problem persists, send this information to support:
-
Software version: the version of LumiScan Template Finder you run. The files in
settings-history/in the configuration directory record it assoftware.version. -
Platform: ctrlX OS (ctrlX CORE or ctrlX IPC) and its ctrlX OS version, or a PC with Windows 11 or Ubuntu 24.04. Also say where you bought the software: from HD Vision Systems or in the ctrlX Store.
-
Data Layer: the ctrlX Data Layer (ctrlX OS) or LumiScan Keryx (PC). On a PC, also the Data Layer address the application uses.
-
Log: the application log from the time of the error - on ctrlX OS from the ctrlX Logbook or
journalctl, on a PC the application’s console output. Before you reproduce the problem, setlogLeveltoTRACEin thesystemblock oflumiscan-template-finder.jsonand restart the application. -
Time: the date and time of the error.
-
Communication status:
output/status-codeandoutput/status-textof the operation that failed, and the answer of the write toexecute(for exampleTooManyOperationsorDL_TOO_MANY_OPERATIONS). -
Configuration files:
lumiscan-template-finder.json, the<module-id>.jsonof the module concerned, the template file and, for the image stream, the file insettings-history/that its settings hash names. Where they are is listed under General checks.
Contact HD Vision Systems customer success at customer.success@hdvisionsystems.com or +49 6221 6721905; for licences, licenses@hdvisionsystems.com. See also Before you contact support in the LumiScan FAQ.