Hi,
I need to define a region of interest in a setup where I’m using a Zed2i camera with Zed SDK 5.0 EA, inside a Unreal 5.5 project.
I’m based on the BP_Zed_Initializer blueprint, which has no option to define the region of interest. You can limit the detection regarding depth but you can’t crop inside the images.
However, I notice that the Zed SDK has a function sl:
:setRegionOfInterest that should fit my needs.
Do you have an easy way for me to use this function in my Unreal Engine project?
Thanks in advance!
Hi Benjamin,
Thanks for your answer.
I can find the function inside Unreal but it take only two variable as input:
- Target: SI Camera Proxy Object Reference
- Module: Set of ESIModules Enums
The second one, module, refers to a set of enums where you can select between: All, Depth, Positional Tracking, Object Detection, Body Tracking, Spatial Mapping.
So there is no entry to define the region of interest itself.
Do you think about anything else I should do before using this function to define the region of interest itself?
Best,
Ah, I see what you mean. The mat was set as reference and therefore considered as an output when called from a blueprint.
I just pushed a fix, it should be good now.
Thanks for the report.
Stereolabs Support
hi again,
Now I can see a new variable, Mat: SI Mat Structure as an entry. Looks good, thanks!
But there is no more exec pin so I can execute the function.
I think the function got it just before.
Can you do something or do I misunderstand anything?
I don’t think it did before the change, but I can modify it if you want.
Is it a problem for you ?
Stereolabs Support
yes it is, because I can’t execute the function if I don’t have an exec pin in Unreal.
thanks in advance!
Yes, it’s good now on this side.
But I continue to need help because I’m not successful in creating the mat needed as an input.
I’m declaring a variable of type SI MAT as needed in the “set region of interest” and trying to act on it with functions issued from StereolabsMatFunctionLibrary.h . But all the functions make the editor crash. For exemple, just trying to print the result of the “Is init” function make the editor crash with error:
Unhandled Exception: EXCEPTION_ACCESS_VIOLATION reading address 0x0000000000000050
sl_zed_c
UnrealEditor_Stereolabs!USlMatFunctionLibrary::execIsInit() [E:\RepertoireDeTravail\CosmoAv\Mozart\UnrealProject\zed-UE5-main\Plugins\Stereolabs\Intermediate\Build\Win64\UnrealEditor\Inc\Stereolabs\UHT\StereolabsMatFunctionLibrary.gen.cpp:931]
Can you help me on this subject please?
Can you show me how you initialize the sl mat please?
Thanks.
I just realised it is very complicated to manipulate slMat from the blueprint with the current version of the plugin.
So I added some utility functions. You can use it like that :

Stereolabs Support
Thanks a lot,
I can’t try right now. I will come back soon to tell you if it’s ok.
Best,
Hi Benjamin,
On my side, this compile. No more crash.
But I can’t make it work.
First, maybe the problem, I don’t have the “Set to int” function. Only a “Set to Int 32”.
I’m doing the same thing as you, in your last post, except the “Set to int” that I replaced with the “Set to Int 32” one.
I’m starting the project with “Start Object Detection Automatically” set to “False” in “BP_skeleton_Visualizer”.
Then I execute the code you give me to set the region of interest, with “Resolution X” set to 1920 and “Resolution Y” set to 1080 (I’m setting also the “Resolution” init parameter of the camera to “HD 1080P” in “BP_Z_Initializer”.
Every function returns “Success”.
And after I execute " EnableOD" in “BP_skeleton_Visualizer”
I’m trying with a value of 255 and also with a value of 0 for the “Set to int 32” function, considering that one of these two values should stop the detection by making a black region of interest. But in both cases, the detection works after enabling it.
Do you think the problem comes from the “Set to int32” function?