open_scene_engineT_open_scene_engineOpenSceneEngineOpenSceneEngineopen_scene_engine (Operator)
Name
open_scene_engineT_open_scene_engineOpenSceneEngineOpenSceneEngineopen_scene_engine — Start and connect to the scene engine synthetic data generator.
Signature
void OpenSceneEngine(const HTuple& GenParamName, const HTuple& GenParamValue, HTuple* SceneEngine)
static HSceneEngine HDeepMatching3D::OpenSceneEngine(const HTuple& GenParamName, const HTuple& GenParamValue)
static HSceneEngine HDeepMatching3D::OpenSceneEngine(const HString& GenParamName, const HString& GenParamValue)
static HSceneEngine HDeepMatching3D::OpenSceneEngine(const char* GenParamName, const char* GenParamValue)
static HSceneEngine HDeepMatching3D::OpenSceneEngine(const wchar_t* GenParamName, const wchar_t* GenParamValue)
(
Windows only)
void HSceneEngine::HSceneEngine(const HTuple& GenParamName, const HTuple& GenParamValue)
void HSceneEngine::HSceneEngine(const HString& GenParamName, const HString& GenParamValue)
void HSceneEngine::HSceneEngine(const char* GenParamName, const char* GenParamValue)
void HSceneEngine::HSceneEngine(const wchar_t* GenParamName, const wchar_t* GenParamValue)
(
Windows only)
Description
The operator open_scene_engineopen_scene_engineOpenSceneEngineOpenSceneEngineopen_scene_engine starts the executable of
the synthetic data generation tool Scene Engine and connects to
the started instance.
Additional parameters can be set using the generic parameters
GenParamNameGenParamNameGenParamNamegenParamNamegen_param_name and GenParamValueGenParamValueGenParamValuegenParamValuegen_param_value, which are
described further below.
The executable is terminated when the handle returned in
SceneEngineSceneEngineSceneEnginesceneEnginescene_engine is cleared.
This is typically once no more tuple contains that
handle.
To terminate the executable manually, use
clear_handleclear_handleClearHandleClearHandleclear_handle to manually clear the
SceneEngineSceneEngineSceneEnginesceneEnginescene_engine-Handle.
Location of the executable
The operator looks for the executable at the following locations,
using the first matching location.
-
The generic parameter 'executable'"executable""executable""executable""executable" (see below).
-
The environment variable 'HALCON_SCENE_ENGINE'"HALCON_SCENE_ENGINE""HALCON_SCENE_ENGINE""HALCON_SCENE_ENGINE""HALCON_SCENE_ENGINE", which is
typically set during installation. Note that the value of
'HALCON_SCENE_ENGINE'"HALCON_SCENE_ENGINE""HALCON_SCENE_ENGINE""HALCON_SCENE_ENGINE""HALCON_SCENE_ENGINE" must end with '/scene_engine'"/scene_engine""/scene_engine""/scene_engine""/scene_engine" (on
Linux) or '/scene_engine.exe'"/scene_engine.exe""/scene_engine.exe""/scene_engine.exe""/scene_engine.exe" (on Windows).
-
The file 'run_scene_engine.sh'"run_scene_engine.sh""run_scene_engine.sh""run_scene_engine.sh""run_scene_engine.sh" (on Linux) or
'scene_engine.exe'"scene_engine.exe""scene_engine.exe""scene_engine.exe""scene_engine.exe" (on Windows) in the default installation path
$HALCONROOT/../SceneEngine-25.05.
Note that a proper installation of the executable is required,
e.g. using the MVTec Software Manager (SOM).
Most notable, it must be able to find its dynamic link libraries. On Linux,
this requires extending the value of the environment variable
'LD_LIBRARY_PATH'"LD_LIBRARY_PATH""LD_LIBRARY_PATH""LD_LIBRARY_PATH""LD_LIBRARY_PATH" with the '/lib'"/lib""/lib""/lib""/lib" directory from the Scene
Engine installation:
LD_LIBRARY_PATH=/path/to/SceneEngine/lib:$LD_LIBRARY_PATH
Alternatively, the script 'run_scene_engine.sh'"run_scene_engine.sh""run_scene_engine.sh""run_scene_engine.sh""run_scene_engine.sh" from the Scene
Engine installation can be used as value of the generic parameter
'executable'"executable""executable""executable""executable" (see below).
Location of assets
Assets are 3D models, textures and environment maps that are used
to add variation to the generated images, as well as to make them
more realistic.
Note that assets need to be installed beforehand, using for example
the MVTec Software Manager (SOM).
The path to the assets must be set in the environment variable
'HALCON_ASSET_DIR'"HALCON_ASSET_DIR""HALCON_ASSET_DIR""HALCON_ASSET_DIR""HALCON_ASSET_DIR".
Alternatively, the path to the assets can be set using
set_scene_engine_paramset_scene_engine_paramSetSceneEngineParamSetSceneEngineParamset_scene_engine_param.
To check if assets were correctly found by the Scene Engine, use
get_scene_engine_paramget_scene_engine_paramGetSceneEngineParamGetSceneEngineParamget_scene_engine_param with the parameter 'assets'"assets""assets""assets""assets".
Generic Parameters
The operator supports the following additional parameters, which can
be set by passing a pair of tuples to GenParamNameGenParamNameGenParamNamegenParamNamegen_param_name and
GenParamValueGenParamValueGenParamValuegenParamValuegen_param_value which contain the parameter names and values,
respectively.
-
'executable'"executable""executable""executable""executable": A string containing the location of the
executable to be started. Note that the value of 'executable'"executable""executable""executable""executable"
must end with '/scene_engine'"/scene_engine""/scene_engine""/scene_engine""/scene_engine" (on Linux) or
'/scene_engine.exe'"/scene_engine.exe""/scene_engine.exe""/scene_engine.exe""/scene_engine.exe" (on Windows). On Linux, it is also possible
to use the script 'run_scene_engine.sh'"run_scene_engine.sh""run_scene_engine.sh""run_scene_engine.sh""run_scene_engine.sh" from the Scene Engine
installation as value of 'executable'"executable""executable""executable""executable", as long as its full path
is specified. This script helps set the correct environment variables.
Default:
See above for the default search locations.
-
'timeout'"timeout""timeout""timeout""timeout": After starting the executable, the operator
will wait this many seconds for the executable to connect.
If the executable does not start up within that time, an error
is returned.
Setting the timeout to 0 disables the timeout.
Default:
10.0
Execution Information
- Multithreading type: reentrant (runs in parallel with non-exclusive operators).
- Multithreading scope: global (may be called from any thread).
- Processed without parallelization.
This operator returns a handle. Note that the state of an instance of this handle type may be changed by specific operators even though the handle is used as an input parameter by those operators.
Parameters
GenParamNameGenParamNameGenParamNamegenParamNamegen_param_name (input_control) attribute.name(-array) → HTupleMaybeSequence[str]HTupleHtuple (string) (string) (HString) (char*)
Names of parameters.
Default:
[]
Suggested values:
'executable'"executable""executable""executable""executable", 'timeout'"timeout""timeout""timeout""timeout"
GenParamValueGenParamValueGenParamValuegenParamValuegen_param_value (input_control) attribute.value(-array) → HTupleMaybeSequence[Union[str, float, int]]HTupleHtuple (string / real / integer) (string / double / int / long) (HString / double / Hlong) (char* / double / Hlong)
Values of parameters.
Default:
[]
Suggested values:
'scene_engine'"scene_engine""scene_engine""scene_engine""scene_engine", 'scene_engine.exe'"scene_engine.exe""scene_engine.exe""scene_engine.exe""scene_engine.exe", 10.0, 0
SceneEngineSceneEngineSceneEnginesceneEnginescene_engine (output_control) scene_engine → HSceneEngine, HTupleHHandleHTupleHtuple (handle) (IntPtr) (HHandle) (handle)
Handle of the Scene Engine connection.
Result
If the parameters are valid, the operator open_scene_engineopen_scene_engineOpenSceneEngineOpenSceneEngineopen_scene_engine
returns the value 2 (
H_MSG_TRUE)
. If necessary, an exception is raised.
Possible Successors
set_scene_engine_paramset_scene_engine_paramSetSceneEngineParamSetSceneEngineParamset_scene_engine_param,
run_scene_enginerun_scene_engineRunSceneEngineRunSceneEnginerun_scene_engine
Alternatives
render_object_model_3drender_object_model_3dRenderObjectModel3dRenderObjectModel3drender_object_model_3d,
disp_object_model_3ddisp_object_model_3dDispObjectModel3dDispObjectModel3ddisp_object_model_3d
See also
create_deep_matching_3dcreate_deep_matching_3dCreateDeepMatching3dCreateDeepMatching3dcreate_deep_matching_3d
Module
3D Metrology