how can I debug with the OpenCV source code - opencv

I am using VS2010 with OpenCV 2.3.1, and opencv is installed by using OpenCV-2.3.1-win-superpack. Now I want to understand the facedetect sample (opencv\samples\c\facedetect.cpp) in detail, I wanna know how to process the specific xml feature file (haarcascade_frontalface_alt.xml), and how to decide which feature to be used. These are all
in the CascadeClassifier class, but when I use "go to definition", the result file is a .hpp
head file, so where is the implementation file? when I use vs2010 to debug, the debugger can not locate the implementation file either. some advice?

Add the opencv\modules directory to the 'source' entry in the vs-directories tab in the project settings. And make sure the pdb files are in the same directory as the debug dlls

Related

How to add library paths in Delphi 10

I am trying to install GLscene but getting problems with the source file locations.
It says in the install instructions to add the GLscene source directories into the global library path in tool/options/Delphi options/Library, which I have done but it has no effect.
I can add the source directories into each package project directory and it then compiles, but I would rather have it accessible globally.
The GLscene library items I have entered are,
C:\Users\Andy\Documents\Embarcadero\Studio\Projects\GLScene_VCL\Source
C:\Users\Andy\Documents\Embarcadero\Studio\Projects\GLScene_VCL\Source\Shaders
C:\Users\Andy\Documents\Embarcadero\Studio\Projects\GLScene_VCL\Source\DesignTime
Which are all correct,
anybody know any reason why the compiler can't find the files in these directories?
The compiler will search for source files on the library path. Note that there are separate library paths for different targets, e.g. Win32, Win64 etc.
If you have source files that cannot be found, then they are not in the library path that you specified.
Personally I don't like the approach of using search paths for source files. I like everything under my project directory so that I can check out from my VCS and have everything I need to build right there. A search path based approach makes serious development very difficult because you cannot maintain branches. What if you have old versions to maintain that use old versions of your libraries?
Well this is a bit late but it could help someone else.
Try and add the paths to both the Library Path and the Debug DCU Path.
Recent Delphi versions have different build configurations for Release and Debug and my guess is that the Debug configuration only searches in the Debug DCU Path.

No symbols/source for external library in Xcode 4

My application is not seeing source code for a library:
If I "Jump to definition" on a library method, XCode takes me to the .h file but says there is no .cpp counterpart
When debugging, I see no source code and most of the call-stack is missing for the library:
I have made sure "Show disassembly when debugging" is UNchecked
I built the library as DEBUG and then packaged up the headers+.a file into a SDK dir. So I guess I need to either copy the debug files into that SDK dir as well, or tell my application where to look. I'm not sure how to do either.
To clarify, my application project doesn't maintain a reference to the library project, only to the .a files and the header dirs. This is because the library project is created by CMake and I don't want to modify it.
First of all, you should check the .debug_str section of your static library to verify it contains the appropriate debug information.
Try running this command on the terminal:
xcrun dwarfdump /path/to/library.a | grep "\.m"
You should see a bunch of your source (.m) file paths printed out. Theoretically, this is where Xcode is going to look when you stop in the debugger, so make sure the paths here are correct. If you don't see any paths, you will need to pass an appropriate debug flag (e.g. -g to the compiler when building your library.
If the paths are somehow incorrect, or you want to point them to some other location, you may be able to modify them as part of the build process in CMake, for example to make them relative to your project directory. Try looking at "Make gcc put relative filenames in debug information", which uses CMake to adjust these debug paths.

recompile/rebuild Delphi 5 code using .dpr file

I am trying to recompile/rebuild an old application program developed on Delphi5. I used the same Delphi5 software on an XP computer.
I did some minor corrections to the codes of a couple of forms and units. When I recompile using the .dpr file it comes with a fatal message: File not found System.pas
I added in .dpr file on the link path to this file BP folder. No success and the same message. Any clue will help.
Probably Library Path is broken after running some buggy component installer. In modern IDE's look for Tools -> Options -> Library -> Library Path from main menu (should be slightly different for Delphi 5).
System.dcu file lives in $(BDS)\Lib path for Delphi 2007.
The "File not found System.pas" error often isn't really because it can't find system.pas. It's some other problem that manifests as this error.
It can be:
Duplicate Path entries in the Library Path.
Too many entries in the Library Path - I think the limit is 99.
Path to a package in Library Paths too long.
Path to a package in Library Paths corrupt.
Environmental Variables not set correctly.
and possibly more if you Google "system.pas not found"
Marjan is right.
But also add ${DELPHI}\LIB\OBJ
If you still have a dcc32.cfg with the project, or a .cfg with the project, open it up to see if the settings in there are correct. Otherwise delete the .cfg or edit it to reflect the proper path to the bin and bin\obj directories.
A .dpr file is the main project file for a Delphi 2,3,4,5,6,7 project.
You have not given any details like WHAT WAY OF BUILDING SOMETHING of delphi you're using (the code is Delphi 5 level code, but you are not telling me for example, if you built the project inside the Delphi IDE or from the command line compiler DCC32), and what other files you have installed. You haven't mentioned if the library paths and so on are configured (either for the IDE, or for the command line environment, both of which are separate tasks).
An inability to find System.pas suggests to me that you might be running the command line compiler (Dcc32) instead of the IDE to build the project, and you have forgotten to mention that. That usually means you have to set up the Options (dcc32.dof) file for Delphi, so that command line building with Dcc32 can work.
What exactly do you mean by "When I compile with the .dpr file"? Instead of making people guess, show the commands you typed, exactly, and the error message, exactly. If it helps, use screenshots or text grabs.

integrating cvblobslib in opencv

here I have just started my fyp and ints gona be in opencv.
I needed to vectorize the image and in order to do that I chose to use cvblobslib.
I downloaded it and it was build successfully but when I use it in my project there's a link error saying that "could not open cvblobslib.obj"
the exact string is pasted below
fatal error LNK1104: cannot open file 'E:\Faizan\myWork\moCap\blobslib\Debug\cvblobslib.obj'
of the solutions which I found on net and tried on my project are to remove any spaces in path, build in release mode rather than in debug mode, but problem was not solved.
the thing is that the stated file does not get built with other files when cvblobslib is built, i.e it is not there in the stated folder.
any body please give a solution
What exactly are you trying to use the cvblobslib for? I also tried using this with no luck. I found that openCV has a lot of the same capabilities. For example, you can use cvCountours to detect "blobs" and filter them by area.
(ps. i tried leaving this as a comment. do you need certain amount of rep to do that?)
cvBlobsLib has been developed using Microsoft Visual C++ (6.0) and can also be used in .NET. A Linux version could be downloaded here.
cvBlobsLib is distributed in a static library (.lib). To use it, it is requred that you build the .lib file and later use that lib file in the desired project. To build the .lib file, simply open the MSVC++ project and build it (debug or release version).
To build the project where the library is to be used follow this steps (MSVC++ 6.0):
In Project/Settings/C++/Preprocessor/Additional Include directories add the directory where the blob library is stored
In Project/Settings/Link/Input/Additional library path add the directory where the blob library is stored and in Object/Library modules add the cvblobslib.lib file
Include the file BlobResult.h where you want to use blob variables.
In Project/Settings/C++/Precompiled Headers select Not use precompiled headers
NOTE: Verify that in the project where the cvblobslib.lib is used, the MFC Runtime Libraries are not mixed:
Check in Project->Settings->C/C++->Code Generation->Use run-time library of your project and set it to
Debug Multithreaded DLL (debug version) or to Multithreaded DLL ( release version ).
Check in "Project->Settings->General" how it uses the MFC. It should be "Use MFC in a shared DLL".
NOTE: The library can be compiled and used in .NET using this steps, but the menu options may differ a little
NOTE 2: In the .NET version, the character sets must be equal in the .lib and in the project. [OpenCV yahoo group: Msg 35500]
NOTE 3: cvBlobsLib might give errors when building with OpenCV v2.2 onwards. Try commenting out this line in file BlobLibraryConfiguration.h:
#define _SHOW_ERRORS
NOTE 4: If you are using the new cv::Mat for your images instead of the old IplImage, you can easily convert between them, such as by following the OpenCV C++ Cheatsheet.

Delphi can't find System.dcu; what should the default path settings be?

Got this error whenever I try to compile something: "F1027 Unit not found: 'System.pas' or binary equivalents (.dcu)".
Got it after installing a component, removed it, reinstalled RAD studio, but still same.
In order to get it fixed, I need the Library path and browsing path. Please anybody post yours so I get it working.
A workaround I found is including the path "$(BDS)\lib\win32\debug" to Library path, but this is not the correct way. So I need your paths. Thanks!
This is from the HKLM\Software\Embarcadero\BDS\8.0\Library key in the registry - you can save it to a .reg file and then import it (making any necessary fixes to the paths first, of course):
Windows Registry Editor Version 5.00
[HKEY_LOCAL_MACHINE\SOFTWARE\Embarcadero\BDS\8.0\Library]
"Browsing Path"="$(BDS)\\SOURCE\\VCL;$(BDS)\\source\\rtl\\common;$(BDS)\\SOURCE\\RTL\\SYS;$(BDS)\\source\\rtl\\win;$(BDS)\\source\\ToolsAPI;$(BDS)\\SOURCE\\IBX;$(BDS)\\source\\Internet;$(BDS)\\SOURCE\\PROPERTY EDITORS;$(BDS)\\source\\soap;$(BDS)\\SOURCE\\XML;$(BDS)\\source\\db;$(BDS)\\source\\Indy10\\Core;$(BDS)\\source\\Indy10\\System;$(BDS)\\source\\Indy10\\Protocols;$(BDS)\\source\\database;"
"Debug DCU Path"="$(BDSLIB)\\$(Platform)\\debug;$(BDS)\\RaveReports\\Lib"
"HPP Output Directory"="$(BDSCOMMONDIR)\\hpp"
"Language Library Path"="$(BDSLIB)\\$(Platform)\\release\\$(LANGDIR);$(BDS)\\lib\\$(LANGDIR)"
"Package DCP Output"="$(BDSCOMMONDIR)\\Dcp"
"Package DPL Output"="$(BDSCOMMONDIR)\\Bpl"
"Package Search Path"="$(BDSCOMMONDIR)\\Bpl"
"Translated Debug Library Path"="$(BDSLIB)\\$(Platform)\\debug\\$(LANGDIR)"
"Translated Library Path"="$(BDSLIB)\\$(Platform)\\release\\$(LANGDIR)"
"Translated Resource Path"="$(BDSLIB)\\$(Platform)\\release\\$(LANGDIR)"
"Search Path"="$(BDSLIB)\\$(Platform)\\release;$(BDSUSERDIR)\\Imports;$(BDS)\\Imports;$(BDSCOMMONDIR)\\Dcp;$(BDS)\\include;C:\\Program Files\\Raize\\CS4\\Lib\\RS-XE;;$(BDS)\\RaveReports\\Lib"
For MSBuild to work properly (and for project configurations), you need to make sure the following environmental variable is set properly:
PLATFORM=ANYCPU
Top Line of the library path:
$(BDSLIB)\$(Platform)\release
Some installers mistakenly parse this as two lines and split them out.
Check on your Delphi IDE menu: Tools * Options, to see what is defined.
My default installation has 2 important "Environment Variables",
BDSLIB, defined as "c:\program files\embarcadero\rad studio\8.0\lib"
Platform, defined as "Win32".
On that same form, under Library, is defined
Library path:, the path begins "$(BDSLIB)\$(Platform)\release;...
That should equate to C:\program files\embarcadero\rad studio\8.0\lib\Win32\release", which is where you should find System.dcu. Make sure that file is there. Maybe it was removed or damaged by your component work.
There is also a "Debug" directory under Win32 which should have the dcu with the debug information included. If the release dcu is missing or damaged, you can probably copy the debug version in as a quick test.
It sounds like the compiler couldn't find the dcu then also looked for the source file to recreate it. But it should normally use the dcu.
I believe the source is in PF\Embarcadero\Rad Studio\8.0\source\rtl\sys as system.pas.
All of the above is the default Delphi Options. The options can also be changed for a project, which could interfere with the above. Try the above first. Then create a new project and see if it will complile, as that will use the defaults only.
Patrick
New York
Take a look at the -cleanregistryide option on this page:
http://support.embarcadero.com/es/article/42597
It will allow you to restore the IDE's default installation paths. If you use this option, third-party add-in's would need to be reinstalled. I have experienced this problem after upgrade installations when there were installed 3rd party IDE tools.
HTH
Navid
For XE4 use this restore.reg
Windows Registry Editor Version 5.00
[HKEY_CURRENT_USER\Software\Embarcadero\BDS\11.0\Library\Win32]
"Search Path"="$(BDS)\Imports;$(BDSCOMMONDIR)\Dcp;$(BDS)\include;C:\Program Files (x86)\Embarcadero\RAD Studio\11.0\lib;C:\Program Files (x86)\Embarcadero\RAD Studio\11.0\include;C:\Program Files (x86)\Embarcadero\RAD Studio\11.0\Imports;$(BDSLIB)\$(Platform)\release;$(BDSUSERDIR)\Imports;$(BDS)\Imports;$(BDSCOMMONDIR)\Dcp\$(Platform);$(BDS)\include"
You can change 11.0 to your version of Delphi

Resources