Realsense D457 Zoom and settings adjustment
Hello,
I am using the intel real sense camera for an orange detection robot. I have researched the camera from other threads, and it seems that the camera can only zoom through digital zoom. This surprises me, because this is a high end camera, I would think the camera would be able to optically zoom. Optical zoom is ideal for our application because it would preserve high-resolution image quality, which would make orange detection easier to identify. If it is possible to optical zoom, how do you do it using the MATLAB wrapper?
My second question is, can the settings of the camera permanently be changed using the Matlab wrapper? I would like to adjust the disparity shift setting so that the camera can detect objects closer than 52 cm away to obtain a better-quality image of the orange. However, the post I have seen has stated that the MATLAB wrapper does not have the ability to adjust certain settings, but again, that surprised me because it is a nicer camera.
-
Hi Coltongcunningham RealSense cameras do not have an optical zoom mechanism on their sensors. The focus of the lenses is fixed.
You can set a Disparity Shift in the RealSense MATLAB wrapper to reduce the minimum depth sensing distance by configuring its value in a json camera configuration file and then importing the json in your MATLAB script to apply the settings stored in the file. The link below demonstrates how to set Disparity Shift this way in the wrapper.
https://support.intelrealsense.com/hc/en-us/community/posts/17464300886675/comments/17480495790227
If you are using RGB color images then you may also benefit from setting RGB Sharpness to its maximum value of '100' in the json file to improve RGB image quality.
"controls-color-sharpness": "100",
-
Hi Marty,
Thank you for your response. I think loading in a .json file would be a good solution, but I think there is an issue with the Matlab wrapper code. I a getting the same error as seen in this thread. https://github.com/IntelRealSense/librealsense/issues/12004
I tried using the advancedmode example in the matlab wrapper, and it seems to not work in loading in the .json file as a string. Is there a work around to fix this issue? -
What method did you use to create your json file, please? Did you export it from the RealSense Viewer tool? If you are, is one of the preset files from the link below able to work with the json loading string?
https://dev.intelrealsense.com/docs/d400-series-visual-presets#preset-table
-
Hi, I just tried that, and it worked I believe. I attached the code I used to load in a .json file and then load those settings into the intel camera incase it is helpful for others down the road.
function advanced_mode_example()% Make a context objectctx = realsense.context();% Get a device from contextdevs = ctx.query_devices();dev = devs{1};% Make sure the device supports advanced modeif ~dev.is('advanced_mode')error('Device doesn''t support advanced mode!');end% Make sure the device is in advanced modeadv = dev.as('advanced_mode');if ~adv.is_enabled()adv.toggle_advanced_mode(true);% Pause execution to give the device time to reconnectoldState = pause('on');pause(2)pause(oldState);% Grab the devicedevs = ctx.query_devices();dev = devs{1};adv = dev.as('advanced_mode');% Make sure the device supports advanced modeif ~adv.is_enabled()error('Device didn''t enter advanced mode');endendjson_file_path = fullfile("Put full file path here");% Read the JSON filetryjson_data = fileread(json_file_path);catch MEerror(['Error reading JSON file: ' ME.message]);end% Load the JSON data into the cameraadv.load_json(json_data);disp('Successfully loaded camera settings from JSON file.');end -
One more question, I see in the viewer, that I can change the maximum detectable distance, and the minimum detectable distance. However, when I look in the .json file settings, I don't see an option to adjust the min and max depth thresholds. Is there a way to adjust these settings in the .json file?
-
You can define a depth clamp min-max in the json.
"aux-param-depthclampmin": "0",
"aux-param-depthclampmax": "65536",The values 0-65536 represent the raw pixel depth values. You can find what the values represent in real-world meters by multiplying the value by 0.001, the default 'depth unit scale' of the D455 camera. For example, 65536 x 0.001 = 65.536 meters (known as the expressive range, described at the link below).
https://dev.intelrealsense.com/docs/projection-in-intel-realsense-sdk-20#depth-image-formats
-
Thank you Marty, that is really helpful. Another question, what do people usally do to increase the resolution of the camera with far away objects? Because the camera is able to sense up to 6 meters away reliably, but if we take a picture of an object 6 meters away and enlarge it, it will be pretty pixelated. So, since the camera doesn't have a zoom function, is there another way to enhance the resolution of a faraway object?
-
The default depth resolution of D455 is 848x480. The higher resolution 1280x720 is also supported for depth though. If you are using RGB color then that is 1280x720 by default. Custom configurations for streams can be defined using the MATLAB wrapper code below.
config = realsense.config();
config.enable_stream(realsense.stream.depth,1280,720,realsense.format.z16,30);
config.enable_stream(realsense.stream.color,1280,720,realsense.format.rgb8,30);
% Make Pipeline object to manage streaming
pipe = realsense.pipeline();
% Start streaming with default settings
profile = pipe.start(config);
Please sign in to leave a comment.
Comments
9 comments