Items with no label
3335 Discussions

First contact with D415 ,What should I do

jchen206
Beginner
2,226 Views

I used it for the VS2015 first time.and I want to use D415 with C++,

I'm a beginner. What am I supposed to do?

and I don't know how to import the example.h

0 Kudos
1 Solution
MartyG
Honored Contributor III
958 Views

The Visual Studio instructions for RealSense beginners with the 400 Series cameras are admittedly not beginner-friendly and users are assumed to have a certain amount of programming knowledge. Even I have to re-read the instructions multiple times to make sure I get it right.

If you are using Windows, once you have installed the complete SDK with the file 'Intel.RealSense.SDK.exe' on the SDK downloads page (be sure to tick that you want a shortcut placed on your desktop during the installation process), it should place a shortcut on your computer's desktop called Intel RealSense Samples. This is a Visual Studio solutions file for setting up RealSense in VS.

Running this should open up Visual Studio automatically and set the solution up in it. If it asks you about missing files during the setup process, click 'Install'.

When the solution has completed its installation, you can press the F5 key in Visual Studio to build and run the sample programs.

View solution in original post

0 Kudos
12 Replies
MartyG
Honored Contributor III
959 Views

The Visual Studio instructions for RealSense beginners with the 400 Series cameras are admittedly not beginner-friendly and users are assumed to have a certain amount of programming knowledge. Even I have to re-read the instructions multiple times to make sure I get it right.

If you are using Windows, once you have installed the complete SDK with the file 'Intel.RealSense.SDK.exe' on the SDK downloads page (be sure to tick that you want a shortcut placed on your desktop during the installation process), it should place a shortcut on your computer's desktop called Intel RealSense Samples. This is a Visual Studio solutions file for setting up RealSense in VS.

Running this should open up Visual Studio automatically and set the solution up in it. If it asks you about missing files during the setup process, click 'Install'.

When the solution has completed its installation, you can press the F5 key in Visual Studio to build and run the sample programs.

0 Kudos
jchen206
Beginner
958 Views

Thank for you answer

Now I create a new project with vs2015 , I looked at the basic examples on GitHub, and the question that bothers me is how to introduce "example.hpp".

I tried to copy it directly,but there were a lot of mistakes.

How do I import "example.hpp" file.

0 Kudos
MartyG
Honored Contributor III
958 Views

You can import the details of files by using an # include statement at the very top of your script. For example, if you look at the main script files of the examples in Visual Studio, most of them have these lines at the top:

# include // Include RealSense Cross Platform API

# include "example.hpp" // Include short list of convenience functions for rendering

In programming, anything put after // acts as a reminder note about what that line does, and the program ignores everything after the // when running.

The part that a lot of visual Studio programmers have problems with is that when they run their program, Visual Studio says that it cannot find the include files. You should define the paths to the files so that Visual Studio can locate them.

Most documentation on the internet for creating linkages is horrible, so I've written my own guide for you (I end up writing my own manuals for most programming products). The instructions below were tested by me in Visual Studio 2017, which has a free Community edition.

STEP ONE

Make sure you have the Solution Explorer panel open in Visual Studio (go to the View menu and select 'Solution Explorer').

STEP TWO

When the Solution Explorer panel is open, highlight the topmost item. Right-click on it and select 'Open folder in File Explorer' to open the folder location on your computer where your project is stored.

STEP THREE

Add to this folder location any files and folders you want to include in your project. you can do this by dragging and dropping files and folders into the project folder.

STEP FOUR

When you have added the files or folders you want to include, return to the Solution Explorer panel, left-click on the panel and select the 'Refresh' option to update the file list.

In the example above, I added to the project folder a folder called 'woooo', put a text file called 'moooo' in it and then clicked Refresh to show it in the list in the Solution Explorer.

STEP FIVE

Finally, right click on the folder or file in the Solution Explorer that you want to include in the project and select 'Include in project' to link it to the project.

0 Kudos
jchen206
Beginner
958 Views

Hello MartyG, Thanks for your patience.

I can now operate on D415 using vs2015 and I done a lot of routine experiments.

When I did the measure experiment, I found its accuracy in centimeters. What can I do to improve the accuracy?

0 Kudos
MartyG
Honored Contributor III
958 Views

I'm glad you found the guide useful.

If you want to increase accuracy, you could try setting the 'Visual Preset' configuration of the camera to High Accuracy mode. This can be done in script with the line below. I would suggest putting it somewhere near the top of your script, after the pipeline is set up but before the script does processing of camera frames.

const char* new_preset = "High accuracy";

Also, if you are measuring with the camera in close range to the object, you could try altering the camera's depth scale.

0 Kudos
jchen206
Beginner
958 Views

Hi~! MartyG

Allow me to ask a simple question.

I tired to change the camera's depth scale.

I've been trying all day,but I'm not gonna use "rs2_set_option" with "RS2_OPTION_DEPTH_UNITS".

0 Kudos
MartyG
Honored Contributor III
958 Views

If you need high accuracy, the other option would be to increase the resolution that you are using. Accuracy increases as resolution increases and reduces as resolution is lowered. For good accuracy in depth scanning, a minimum resolution of 848x400 is recommended. The downside of increasing resolution is that the minimum distance of the object from the camera must increase, so you cannot position objects as close to the camera.

0 Kudos
jchen206
Beginner
958 Views

Can i change the scale to 0.1mm?

0 Kudos
MartyG
Honored Contributor III
958 Views

I do not know another way to change it other than RS2_OPTION_DEPTH_UNITS, unfortunately. I believe that the line below should be used, with the 0.001f value changed to the scale you want to use, such as 0.1f (it's important to put the f on the end, as it stands for float, or decimal-point number).

depth_sensor.add_read_only_option(RS2_OPTION_DEPTH_UNITS, 0.001f);.

0 Kudos
jchen206
Beginner
958 Views

Hello!~MartyG

With your advice,I managed to get the schedule to 0.1mm.

I've read a lot of pots, including one about using OpenCV to work with all the depth that is worth my while.

I did some experiments, and I tried to test the accurary of a point to see if it could detect a change in 1mm.

As I later discovered depth is constantly changing and what can I do to reduce the depth that is worth the ups and downs.

0 Kudos
MartyG
Honored Contributor III
958 Views

The link below discusses the depth fluctuation issue.

https://github.com/IntelRealSense/librealsense/issues/1280 Depth Values Fluctuation · Issue # 1280 · IntelRealSense/librealsense · GitHub

You might also consider using a different Visual Preset setting for the camera, such as 'High Accuracy'.

https://github.com/IntelRealSense/librealsense/wiki/D400-Series-Visual-Presets D400 Series Visual Presets · IntelRealSense/librealsense Wiki · GitHub

0 Kudos
ASriv7
New Contributor I
958 Views

If you want to use frame metadata, there are additional steps that need to be followed, depending on your operating system. Look at the installation .md (e.g. installation_windows.md) file for your operating system https://github.com/IntelRealSense/librealsense/tree/master/doc here.

0 Kudos
Reply