General Information
- Product: C-67-4-BL
- Serial Number: 260868
- Ensenso SDK Version: 4.3.991
- Operating System: Windows
- Data Attachments
- Screenshots
Problem / Question
Hi,
I am using NxLib through C# (NuGetpackage version 4.3.1057) to capture some point cloud with a C-67. I am very close to having everything I want working directly through the NxLib library, settings values via the [ ] interfaces and calling commands. However, my clouds never seem to be cropped by their Z-depth. I can achieve that fine through NxView but not my own code and I suspect I’m just missing a toggle somewhere so I’m hoping for some clarification on this.
As far as I can read from the docs, I should be able to set the Z values of the Near and Far MeasurementVolumes to achieve this. That is done with:
// Depth Range
disparityMapNode[NxLib.itmMeasurementVolume][NxLib.itmNear][NxLib.itmLeftBottom][2].Set(1000);
disparityMapNode[NxLib.itmMeasurementVolume][NxLib.itmFar][NxLib.itmLeftBottom][2].Set(1390);
And those values appear to be correctly set in the Parameters when I review the JSON:
{
"MeasurementVolume": {
"Far": {
"DisparityStep": 3.014694092202319542,
"LeftBottom": [
151.411984891589554536,
157.246083012587803296,
1390.521882114909431039
],
"LeftTop": [
151.411984891589554536,
-911.279691693013432996,
1390.521882114909431039
],
"PixelSize": 0.890438145588001051,
"RightBottom": [
730.196779523790269195,
157.246083012587803296,
1390.521882114909431039
],
"RightTop": [
730.196779523790269195,
-911.279691693013432996,
1390.521882114909431039
]
},
"Near": {
"DisparityStep": 1.423687579229886868,
"LeftBottom": [
105.848491351957065376,
109.926969584371107658,
972.080535891070439902
],
"LeftTop": [
105.848491351957065376,
-637.05380148371557425,
972.080535891070439902
],
"PixelSize": 0.622483975890072205,
"RightBottom": [
510.463075680504005049,
109.926969584371107658,
972.080535891070439902
],
"RightTop": [
510.463075680504005049,
-637.05380148371557425,
972.080535891070439902
]
}
}
}
And for context this is how I am doing the capture and post processing:
// captures an image
new NxLibCommand(NxLib.cmdCapture).Execute(out var retCode);
if (!CheckPointCloudCalculationError("Capture failed", retCode, out var exception))
throw exception;
// computes the stereo matching - this is the computationally intensive part of the process
new NxLibCommand(NxLib.cmdComputeDisparityMap).Execute(out retCode);
if (!CheckPointCloudCalculationError("Disparity matching failed", retCode, out exception))
throw exception;
// converts the disparity map into XYZ data for each pixel
new NxLibCommand(NxLib.cmdComputePointMap).Execute(out retCode);
if (!CheckPointCloudCalculationError("Map to point conversion failed", retCode, out exception))
throw exception;
// converts the image data into undistorted images
new NxLibCommand(NxLib.cmdRectifyImages).Execute(out retCode);
if (!CheckPointCloudCalculationError("Image rectification failed", retCode, out exception))
throw exception;
I then read my points from the Camera[NxLib.itmImages][NxLib.itmPointMap] node but that appears to contain all of my points irrelevant of their Z-depth and whether they are in the MeasurementVolume or not. Am I missing something to activate that trimming?
For a bit of additional context, I am also Computing Texture, Rending Point Map and Computing Normals after this but the behaviour I am seeing is still present regardless of whether I have those enabled or not in our code.
Thanks

