However, I am getting NxLibError: ExecutionFailed and path: /Execute/rectify from e.getErrorText() and e.getItemPath() where e is a type NxLibException variable.
Here’s a screenshot of the NxTreeEdit, hope it can help debugging.
rectifying user-provided images is currently not possible because they are missing some important metadata and there is no way to provide it. Exposure is not necessary for rectification, it is just the first attribute in the group being checked.
The usual sequence of cmdCapture, cmdRectify works fine, correct? Do you require setBinaryData for your application?
I will confer with my colleagues about this issue, but fixing it will require at least a bugfix release as I cannot think of any workaround.
By “the usual sequence” I mean: just calling the two commands without intervening calls to setBinaryData, as it is not necessary for what we consider normal operation:
Assuming you have only this one camera 4103427447 open, then
After checking the code, the developer just get the binary data from the camera in the Capture step and set it to pFrame->imagesRaw, the type of this variable is std::vector<unsigned char>. And then when doing the Compute step, they set what they got from getBinaryData into setBinaryData using
But after referencing your answer, I removed both lines I mentioned above and then the Compute worked which made me so curious lol. Is there any explanation for this?
Internally, the NxLib has a binary pipeline associated to each camera, where the various binaries (e.g. raw and rectified images, disparity map, etc.) are stored. The commands automatically take the binaries from the camera pipelines as inputs and update the pipelines with their output.
The ability to write to some pipeline slots is a remnant of some exotic applications we had to support in the past, but this apparently got broken with improved meta-data handling inside the NxLib, which nobody had noticed before.
I would like to close this with a general rule for NxLib usage: If you are using setBinaryData, you are either doing something very exotic, or there is an easier way.
Thank you for the explanation.
So we decided not to use setBinaryData.
What about getBinaryData and getBinaryDataInfo? I think our code need to get some info from the image that the sensor captured, are getBinaryData and getBinaryDataInfo safe to use?
Yes, absolutely. Using getBinaryData and getBinaryDataInfo is the only way to obtain binary data from the NxLib. If you can use OpenCV, you will probably not need getBinaryDataInfo, as all the information is already available from the cv::Mat returned by the OpenCV getBinaryData overload.
I just noticed that the OpenCV overloads are currently not documented in our manual. I will attempt to correct that.