realsense sdk2 example error - visual-studio

I'm using intel realsense SDK2.10.0 with D410 depth module to build a project. But faced with an immediate problem that I can't run even the hello world example they give us. With no problem is building the project, there is always internal error as:
Unhandled exception at 0x00007FFB60434008 in hello-world.exe: Microsoft C++ exception: rs2::error at memory location 0x000000B0AD1EF670.
This is my first-time use visual studio so that could be a naive problem but I can't identify it. Any help and idea?

I solved the problem. The point is that those samples didn't expect infrared image as input and the render code part is for RGB frames. I only have the depth module with the infrared camera with no RGB sensor. so the sample program can't handle it.
You have to heavily modify the example.hpp file to make it functional. So if you are not a professional user, don't try individual modules on your own, or at least for now.

Suggest to use Windows CMAKE tool to configure the build x64 environment for VS2015.
The CMAKE tool will help create the required librealsense VS projects for you to build those RealSense sample apps.
BR,
Freeman

Related

Fortran .for file and Microsoft Visual Studio. How Can I Run It?

I'm new in Fortran and I need your help.
I'm a space engineering student and I'm used to code in MATLAB.
Right now I'm writing my MSc thesis and I have to deal with a code written in fortran77 (I'm guessing it by its extension ".for"). The code has already been tested and used in other occasions.
I use Windows 10 as an operating system and I know that sometimes an old code could show problems depending on the system in which it is run (for instance I've heard about the need of running old versions of an operating system through emulators to solve some problems).
I hope I can still use Win10 for the purpose.
So, I have done the following steps (based on what I have found on internet) in order to configure my system:
I have installed the last version of Microsoft Visual Studio Community 2019
I have installed Intel OneApi Basic Toolkit and then Intel OneApi HPC Toolkit (the last one is an add-on that contains the fortran compiler).
It seems that both are well configured/integrated and I think they are working properly.
Now, when I try to open the project from Visual Studio, the .for extension isn't apparently recognized.
So I've tried to open it as a simple file, and in doing so, I can visualize it on VS.
I don't know If It is the right procedure, and I don't know if it works as it should.
How can I prove it?
I try to run it, but nothing seems to happen (no error flag by the way).
I'm totally new in this field, so any "obvious" suggestions will be really appreciated.
I'm open to any tips, even If it is better to change compiler (I've heard about gfortran) or use other kinds of softwares. I would be also grateful if someone could suggest me a beginner useful guide.
Thanks to whoever wants to help me out.

android ndk hw debuggning memory

Backgrond
I am very experienced in C and pretty new to Android and Java, but this is rather environmental issues that programming.
I have developed an administrative application in ANSI-C to be ported to any OS, just adding a UI in OS-dependent code. Well it uses quite some memory, especially for huge user files. I have a working Win32 program, trying to make an Android app using Android Studio with NDK.
Android studio bundle NDK installation works fine
I have installed and made a Win7 ultimate Android Studio 1.3 with bundle NDK and made compiling and running the ActionbarStyled (non NDK) hello-jni (NDK) sample in the emulators, smooth and nice. I also in the emulator been successfully running Hello-jni sample with a bunch of extra c-files (not called, at present just garbage, compiled without errors, in this step)
Then I tried to connect my Samsung TAB3 SM-T110 template (one need a Win7 Samsung driver SAMSUNG_USB_Driver_for_Mobile_Phones.zip) to my Win7 and tried it. ActionbarStyled sample works just fine. So does the Hello-JNI sample.
But
Running Hello-jni sample with a bunch of extra c-files I get this error message:
Error while starting native debug session: java.lang.IllegalArgumentException: Unable to find process for com.example.hellojni on device samsung-sm_t110-47900bc50c0c3100
I try to understand what is the issue? Is it lack of memory, the Samsung is full of active running apps, the emulator obviously not.
What makes the Samsung unit to halt the application? Error message is not that describing?
Some more questions supporting handling this kind of issues
We are talking about Android studio 1.3 bundle NDK, how much from earlier setups (in articles) are applicable for this new future NDK standard use?
Memory?
Running the pure Hello-jni sample I have about 6Mb memory (where 5Mb are used), that is pretty poor for my needs, is there something I need to do have my app getting more memory allocated? Is the error message due to running out of memory?
How large Android Apps are possible to do? Are we in a world like the 8-bit DOS 64Kb segment business again? I know it from past but that isen't the case? And if need to know to handle it. The Library for unrestricted heap memory for bitmaps using NDK on Android question is interesting to read, but here we are talking about the jni (C-)code rather than java.
Compiler optimisation?
I have some really huge C-files due to that they are machine generated converting an XML library of documents to C-code (made a program writing C-code from the XSD definitions). In an application I most of the time use only say 5% of all the C-function, the rest are in Windows dev studio/compiler optimised away. Certainly I can reorganise my source code to quite some extra work, but I need to know. How is the optimisation in the Android Studio NDK support?
Thing is in this test no extra C-functions are called except the same regular as in the hello-jni sample. Actually the compiler should make exactly the same in both cases (the modified and the original hello-jni). But obviously it don't. Please explain a bit more how the environment works so I know?
General interest
I tried to find any spot in the Android developers that describe things like compiler behaviour, memory management and environment (the Java handles such completely different, but in C-programming on need to be aware). I think for NDK use it would be interesting getting a good answer here, for the general understanding of the environment, somewhere in the Android developer pages, rather than here. That also includes how the compiler optimises in different situations. But also how to make environmental settings.

How do you guys debug GLSL?

I recently attempted to write some GLSL shader code and did not have much luck when the shader didn't draw what I expected (basically, everything is black on screen). Here are the tools I tried:
Nvidia NSight VS integration - It crashes right away when I start the application, try couples other application even with the simple triangle drawing and still have no luck. Search through the internet and Nvidia forum and seem it is a common issue, and didn't seems to find any solution.
glslDevil - It can start the application but then the program keeps exiting before any rendering happens, the GL Trace is
wglMakeCurrent(0, 0)
wglDeleteContext(00010000)
ChildProcess exited
Get another crash when running another application when after calling
glDeleteTexture(1, 0314EF74)
Child process exited
I have no clue what is going on.
AMD PerfStudio 2 - It seems it is the most promising tools, successfully run my application and display the required information. However, it didn't seems support debugging GLSL, I cannot step through the shader and watching the local variables etc? It seems only support DirextX shader
gDebugger - It works pretty well tool, similar to AMD PerfStudio, but again it is not a debugger, cannot step through the shader code and watching any local variables.
Printf - ?? Someone on stack overflow saying using printf, how can I do printf() in the shader?
Convert DirectX shader to GLSL - Since DirectX shader have better debugging tool, and there are tools like http://sourceforge.net/projects/hlsl2glsl/ to automatically convert the hlsl to glsl, it seems it can be an alternative. I personally didn't like this solution, and really wish I have another choice.
Can anyone suggest how you debug your GLSL? What tool you are using successfully?
I am running on:
NVidia GFX 460v2
Visual Studio 2008 and 2010
GLEW
OpenGL 2.0
You can specify extra outputs using the glDrawBuffers and then inspect that (your printf).
However that doesn't fixes anything when the primitive is outside the drawing area.
Otherwise it's old school programming by pure reasoning and mental debugging.
After many hours struggle, I finally make my NSight working on my machine, and I write up the process in here and hope it will help someone with similar problem,
Download NSight from https://developer.nvidia.com/nsight-visual-studio-edition-downloads, and it involves couple download steps, just follow the instruction. I have Nsight Tegra install before and get a NSight menu in my Visual Studio, however, when I start the graphics debugger, the application crash right away. I think the NSight integration come with the NSight Terga is broken, and reinstall the NSight follow the above link seems fix the problem
When running the NSight graphics debugger, I am not able to debug my shader code due to the fact that my app is using some incompatible function, such as
glTexImage2D()
glTexEnvf()
and much more. The graphics debugger told me I can call a tool named Nav.Launcher.exe to find out a list of incompatible functions in my application. However, I cannot find the tool in my hard drive.
Then I decide to use the gDEBugger to run my application again and turn on Breakpoints->Break On Deprecated Function. This allow my to know all deprecated functions I called in my code. After removed all deprecated functions, the NSight graphics debugger's frame debugger feature can be enabled and I can finally step through my shader code line by line in Visual Studio
Hope this help.

What happened to the GUI for experimenting with OpenCV?

There used to be a gui toolkit for experimenting with OpenCV image processing pipelines including code generation. I think it started with an "h". What is it called, and what happened to it?
I think I saw in the past a nice tool to test opencv functions, not so sure about the code generation.
Now i found this one, it looks decent:
http://code.google.com/p/piaf/
This one looks nice but experimental:
http://siggiorn.com/videopipe/
And these, but look poor and ancient:
http://code.google.com/p/cvpreprocessor/
http://code.google.com/p/open-rtvision/
EDIT:
This one is dedicated to feature detecting module:
http://introlab.github.io/find-object/
I think you refer to Harpia. It's available in Ubuntu applications if you enter OpenCV in SW repository (Ubuntu Software Center) search box
This is called HighGUI. You can find many docs in the web. Here's one of them: Load and Display an Image.

OpenCL, AMD Radeon, Visual Studio 2010 on Windows 7 - How to get started?

I'm a complete newbie with OpenCL, and I wanted to start learning how to code programs that will run on my video card (AMD Radeon 6970). I've installed AMD's app SDK, is this what I need to get started?
I tried building the sample solution they included, but I got:
error C1083: Cannot open include file: 'd3dx10.h': No such file or directory c:\users\...\simpledx10\SimpleDX10.hpp
I assume that this is because I have DX11 installed. I figured I would just make my own simple program to start off, but I couldn't figure out what all I needed to get it working after searching Stack Overflow and google.
Is there any useful guide for complete beginners to get OpenCL working in windows, using an AMD video card?
A good place to start is from the OpenCL book samples. If you don't mind using cmake to generate your projects build infrastructure then this CMakeLists should do just fine.
If you want a step-by-step tutorial on how to build and run a sample OpenCL application then I'll point you again at one of the auxiliary OpenCL book resources from here.
I'm also using cmake to build my OpenCL programs but the CMakeLists.txt file I'm using is pretty long and a bit twisted as it supports multiple compilers/platforms and it would only manage to confuse you.
Hope this helps you build your first OpenCL application. If not ask some more and I'll try to answer.

Resources