I got this steps from
http://www.beroux.com/english/articles/boost_unit_testing/?part=2
However, the link to the download page was wrong. Here are more updated steps:
1. Download the latest Boost installer from BoostPro Computing: http://www.boostpro.com/download/
2. Install the setup:
Select whatever mirror you like and VS version you are working with.
[X] Mulithread Debug, DLL --DLL Debug, required when BOOST_DYN_LINK defined.
[X] Mulithread, DLL --DLL Release, required when BOOST_DYN_LINK defined.
[X] Mulithread --LIB (for CRT DLL) Release, default in Release.
[X] Mulithread Debug --LIB (for CRT DLL) Debug, default in Debug.
[X] Mulithread, static runtime --LIB (for CRT LIB) Release.
[ ] Mulithread Debug, static runtime --LIB (for CRT LIB) Debug.
[ ] Single thread, static runtime
[ ] Single thread Debug, static runtime
3. Add Boost to the include and library folders of Visual Studio:
Go to the menu Tools > Options...
Go to Project and Solutions > VC++ Directories
Add to your Include files: C:\Program Files\boost\boost_X_XX_X
Add to your Include files: C:\Program Files\boost\boost_X_XX_X\boost\tr1
Add to your Library files: C:\Program Files\boost\boost_X_XX_X\lib
Optional:
Path inclusion: If you use Boost DLLs (rare) you may add C:\Program Files\boost\boost_X_XX_X\lib to your system PATH.
Thursday, April 19, 2012
Wednesday, April 4, 2012
How to use Bilateral Filter in Opencv
Here is an example of using the bilateral filter where 21 is the color sigma and and 3 is the spatial sigma
cvSmooth(gray_image_,smoothed_image,CV_BILATERAL, 0,0, 21, 3);
cvSmooth(gray_image_,smoothed_image,CV_BILATERAL, 0,0, 21, 3);
Thursday, February 23, 2012
Why Latex crashes when using \usepackage in windows
Today I had this problem again and seemed to be because latex usually downloads automatically the packages that it doesn't have. However, in windows when Latex doesn't have the rights, it won't download this files because windows might block this process thinking is a a virus.
One way to fix this is by running Latex as administrator. This is done by right clicking on the application and choose "run as administrator"
I hope this helps
One way to fix this is by running Latex as administrator. This is done by right clicking on the application and choose "run as administrator"
I hope this helps
Tuesday, February 7, 2012
Compiling a simple OpenCv program in Ubuntu
Here is a couple links that could help you in case you run into problems:
opencv.org and willowgarage.com
Update: Here I found a script that takes care of the whole installation in Ubuntu. You might want to try that first.
https://help.ubuntu.com/community/OpenCV
Otherwise:
First you need to install the required packages in your system.
You can use this script to do that. Feel free to edit it in case doesn't work for you.
Remember to use chmod 755 to change the execution rights of the file
1. Create a folder for opencv
mkdir opencv
cd opencv
2. Download the code from
git clone git://code.opencv.org/opencv.git
or
git clone https://github.com/Itseez/opencv.git
3. Create a release folder to store built files
cd ~/opencv
mkdir release
cd release
cmake -D CMAKE_BUILD_TYPE=RELEASE -D CMAKE_INSTALL_PREFIX=/usr/local ..
(Remember that if you have a GPU installed you want to add the following parameters: -D WITH_CUDA=YES -D CUDA_TOOLKIT_ROOT_DIR="/usr/local/cuda/bin")
-Optionally you can add other options to the cmake line such as -D BUILD_PYTHON_SUPPORT=ON -D BUILD_EXAMPLES=ON
4. Run make inside release
make
sudo make install
5. Create a simple project using your favorite IDE. Here I just used vi:
vim image-display.c
6. Create a simple program such as:
7. gcc -ggdb `pkg-config --cflags opencv` image-display.c -o image-display `pkg-config --libs opencv`
8. run the program ./image-display "cat.jpg"
opencv.org and willowgarage.com
Update: Here I found a script that takes care of the whole installation in Ubuntu. You might want to try that first.
https://help.ubuntu.com/community/OpenCV
Otherwise:
First you need to install the required packages in your system.
You can use this script to do that. Feel free to edit it in case doesn't work for you.
Remember to use chmod 755 to change the execution rights of the file
mkdir opencv
cd opencv
2. Download the code from
git clone git://code.opencv.org/opencv.git
or
git clone https://github.com/Itseez/opencv.git
3. Create a release folder to store built files
cd ~/opencv
mkdir release
cd release
cmake -D CMAKE_BUILD_TYPE=RELEASE -D CMAKE_INSTALL_PREFIX=/usr/local ..
(Remember that if you have a GPU installed you want to add the following parameters: -D WITH_CUDA=YES -D CUDA_TOOLKIT_ROOT_DIR="/usr/local/cuda/bin")
-Optionally you can add other options to the cmake line such as -D BUILD_PYTHON_SUPPORT=ON -D BUILD_EXAMPLES=ON
4. Run make inside release
make
sudo make install
5. Create a simple project using your favorite IDE. Here I just used vi:
vim image-display.c
6. Create a simple program such as:
#include "highgui.h"
int main( int argc, char** argv ) {
// cvLoadImage determines an image type and creates datastructure with appropriate size
IplImage* img = cvLoadImage( argv[1],1);
// create a window. Window name is determined by a supplied argument
cvNamedWindow( argv[1], CV_WINDOW_AUTOSIZE );
// Display an image inside and window. Window name is determined by a supplied argument
cvShowImage( argv[1], img );
// wait indefinitely for keystroke
cvWaitKey(0);
// release pointer to an object
cvReleaseImage( &img );
// Destroy a window
cvDestroyWindow( argv[1] );
}
8. run the program ./image-display "cat.jpg"
Wednesday, January 18, 2012
How to create a new OpenCV project with Visual Studio 2008
1. Download OpenCV 2.1 for VS2008
2. Create a new console project in VS2008
3. On properties project-> Configuration properties do the following :
C/C++ -> General-> Additional Include Directories enter:
C:\OpenCV2.1\include\opencv
4. Under Linker->General->Additional Library Directories enter:
C:\OpenCV2.1\lib
5. Under Linker->Input->Additional Dependencies (libraries) enter:
cv210d.lib
cxcore210d.lib
highgui210d.lib
6. You can test it using some code like:
#include "stdafx.h"
#include <cv.h>
#include <cxcore.h>
#include <highgui.h>
int _tmain(int argc, _TCHAR* argv[])
{
IplImage *img = cvLoadImage("image.jpg");
cvNamedWindow("Image:",1);
cvShowImage("image:",img);
cvWaitKey();
cvDestroyWindow("Image:");
cvReleaseImage(&img);
return 0;
}
By: Matthew Stofflet
2. Create a new console project in VS2008
3. On properties project-> Configuration properties do the following :
C/C++ -> General-> Additional Include Directories enter:
C:\OpenCV2.1\include\opencv
4. Under Linker->General->Additional Library Directories enter:
C:\OpenCV2.1\lib
5. Under Linker->Input->Additional Dependencies (libraries) enter:
cv210d.lib
cxcore210d.lib
highgui210d.lib
6. You can test it using some code like:
#include "stdafx.h"
#include <cv.h>
#include <cxcore.h>
#include <highgui.h>
int _tmain(int argc, _TCHAR* argv[])
{
IplImage *img = cvLoadImage("image.jpg");
cvNamedWindow("Image:",1);
cvShowImage("image:",img);
cvWaitKey();
cvDestroyWindow("Image:");
cvReleaseImage(&img);
return 0;
}
By: Matthew Stofflet
Saturday, January 1, 2011
_CrtDumpMemoryLeaks() not working or showing lines
Well, here again trying to figure out why Microsoft doesn't provide a better memory leak tool (grumble grumble) but I am not bitter :)
I was following the instructions on the msdn documentation
http://msdn.microsoft.com/en-us/library/e5ewb1h3(v=vs.80).aspx
But it didn't work for me. It turns out that if you are using a static or dynamic library that is being called then you won't get the lines where the memory leaks happen unless you put the following at the beginning of the library header or where the code of the library you are calling resides.
#define _CRTDBG_MAP_ALLOC
#include <stdlib.h>
#include <crtdbg.h>
Also, some people found these other lines useful as supposed to the lines above
#include <iostream>
#define _CRTDBG_MAP_ALLOC
#include <crtdbg.h>
#define DEBUG_NEW new(_NORMAL_BLOCK, __FILE__, __LINE__)
#define new DEBUG_NEW
You can check this at http://www.gamedev.net/community/forums/topic.asp?topic_id=581580
Good luck fighting these nastier than sin memory leaks.
I was following the instructions on the msdn documentation
http://msdn.microsoft.com/en-us/library/e5ewb1h3(v=vs.80).aspx
But it didn't work for me. It turns out that if you are using a static or dynamic library that is being called then you won't get the lines where the memory leaks happen unless you put the following at the beginning of the library header or where the code of the library you are calling resides.
#define _CRTDBG_MAP_ALLOC
#include <stdlib.h>
#include <crtdbg.h>
Also, some people found these other lines useful as supposed to the lines above
#include <iostream>
#define _CRTDBG_MAP_ALLOC
#include <crtdbg.h>
#define DEBUG_NEW new(_NORMAL_BLOCK, __FILE__, __LINE__)
#define new DEBUG_NEW
You can check this at http://www.gamedev.net/community/forums/topic.asp?topic_id=581580
Good luck fighting these nastier than sin memory leaks.
Wednesday, December 1, 2010
from glib._glib import *ImportError: DLL load failed: The specified module could not be found.
So I was following the instructions on the pygtk website
http://www.pygtk.org/downloads.html
But I kept getting this annoying error. I knew I wasn't insane but couldn't figure out why this happened. I finally went to this page and followed the instructions to get pygtk working and it worked!
http://www.gramps-project.org/wiki/index.php?title=Windows_installer#Installation
Basically, the trick is to get the GTK runtime for windows at
http://gtk-win.sourceforge.net/home/index.php/en/Home
the other steps should be the same at pygtk.org but you can also follow all the instructions on this link and will work too. Good luck hacking up some code!
http://www.pygtk.org/downloads.html
But I kept getting this annoying error. I knew I wasn't insane but couldn't figure out why this happened. I finally went to this page and followed the instructions to get pygtk working and it worked!
http://www.gramps-project.org/wiki/index.php?title=Windows_installer#Installation
Basically, the trick is to get the GTK runtime for windows at
http://gtk-win.sourceforge.net/home/index.php/en/Home
the other steps should be the same at pygtk.org but you can also follow all the instructions on this link and will work too. Good luck hacking up some code!
Subscribe to:
Posts (Atom)