OpenCV configuration with Visual Studio
Today i'll show you the how can you manually configure OpenCV 2.4.11 with Visual Studio 2013.
Open the visual studio File > New > New Project > Installed > Template > Visual C++ > CLR then click on CLR Console Application and named the project as TestOpenCV then hit OK.
Go to Link and download opencv 2.4.11, you can choose any latest version of opencv, process will be same as following.
Create a new folder in Drive C named as cv2411 and extract in it. Your directory should be like following image.
First of all you need to set System Environment Variable in windows. Open Control panel > System and Security > System > Advance system settings > Advanced click on Environment Variables button. Select Path from System variables then click Edit and paste bin path as following then click OK OK and OK :).
Go back to Visual Studio, right click on project and select properties. I'm building opencv for x86 platform in visual studio but you can also use x64. For this you just need to change path as x64. In properties panel go to Configuration Properties > VC++ Directories > Include Directories then click drop down edit button and add following path.
In Libraries Directories add following path
Go to C/C++ > Additional Include Directories and paste following directory
Go to Linker > Additional Library Directories and paste following directory
Then click on Apply button then OK. Your opencv has been configured. Now let's run some lines of code to test OpenCV, just copy following code and paste in TestOpenCV.cpp file.
Open the visual studio File > New > New Project > Installed > Template > Visual C++ > CLR then click on CLR Console Application and named the project as TestOpenCV then hit OK.
Go to Link and download opencv 2.4.11, you can choose any latest version of opencv, process will be same as following.
Create a new folder in Drive C named as cv2411 and extract in it. Your directory should be like following image.
First of all you need to set System Environment Variable in windows. Open Control panel > System and Security > System > Advance system settings > Advanced click on Environment Variables button. Select Path from System variables then click Edit and paste bin path as following then click OK OK and OK :).
- C:\cv2411\opencv\build\x86\vc12\bin
Go back to Visual Studio, right click on project and select properties. I'm building opencv for x86 platform in visual studio but you can also use x64. For this you just need to change path as x64. In properties panel go to Configuration Properties > VC++ Directories > Include Directories then click drop down edit button and add following path.
- C:\cv2411\opencv\build\include
In Libraries Directories add following path
- C:\cv2411\opencv\build\x86\vc12\lib
Go to C/C++ > Additional Include Directories and paste following directory
- C:\cv2411\opencv\build\include
Go to Linker > Additional Library Directories and paste following directory
- C:\cv2411\opencv\build\x86\vc12\lib
- opencv_calib3d2411d.lib
- opencv_contrib2411d.lib
- opencv_core2411d.lib
- opencv_features2d2411d.lib
- opencv_flann2411d.lib
- opencv_gpu2411d.lib
- opencv_highgui2411d.lib
- opencv_imgproc2411d.lib
- opencv_legacy2411d.lib
- opencv_ml2411d.lib
- opencv_nonfree2411d.lib
- opencv_objdetect2411d.lib
- opencv_photo2411d.lib
- opencv_stitching2411d.lib
- opencv_superres2411d.lib
- opencv_ts2411d.lib
- opencv_video2411d.lib
- opencv_videostab2411d.lib
Then click on Apply button then OK. Your opencv has been configured. Now let's run some lines of code to test OpenCV, just copy following code and paste in TestOpenCV.cpp file.
- #include "stdafx.h"
#include <iostream>
#include <opencv/cv.h>
#include <opencv/highgui.h>
#include <opencv2/core/core.hpp>
#include <opencv2/opencv.hpp>
#include <opencv2/imgproc/imgproc.hpp>
#include <opencv2/highgui/highgui.hpp>
using namespace std;
using namespace cv;
int main()
{
Mat image;
image = cv::imread("C:\\test.png");
namedWindow("Display window", 1);
imshow("Display window", image);
waitKey(0);
return 0;
}
Build the project and run.
If you are facing dll missing errors then simply go to following path and copy all dll files and paste them with project .exe file. You can find project exe file in Project directory. it will be in Debug or Release folder.
If you are facing dll missing errors then simply go to following path and copy all dll files and paste them with project .exe file. You can find project exe file in Project directory. it will be in Debug or Release folder.
- C:\cv2411\opencv\build\x86\vc12\bin
Image Processing, opencv, Ubuntu, Ubuntu Server
Run following command in terminal to get all libraries paths and lib files
How to configure opencv in Eclipse IDE
Firstly, I'm assuming that you have installed OpenCV on Ubuntu. If not, then follow the link. Secondly You need to install Eclipse + JDK7. Following command will install eclipse for c++ developer with JDK7. Just Run following command.
Open Eclipse and right click or Go to File > new project > C/C++ > C++ Project > Next
Name the project as TestOpenCV and select Hello World C++ Project then click next. Write Author name whatever you want then click next next and finish.
Before to run project expand src directory and add following lines of code in TestOpenCV.cpp
Run following commands to get includes paths
Copy all include paths and add into include paths (-I) tab like following- sudo apt-get install eclipse eclipse-cdt g++
Open Eclipse and right click or Go to File > new project > C/C++ > C++ Project > Next
Name the project as TestOpenCV and select Hello World C++ Project then click next. Write Author name whatever you want then click next next and finish.
Before to run project expand src directory and add following lines of code in TestOpenCV.cpp
- #include "stdfix.h"#include <iostream>
#include <opencv/cv.h>#include <opencv/highgui.h>
#include <opencv2/core.hpp>
#include <opencv2/opencv.hpp>
#include <opencv2/imgproc/imgproc.hpp>
#include <opencv2/highgui/highgui.hpp>
using namespace std;
using namespace cv;
int main()
{
Mat image;
image = cv::imread("/home/test.png");
namedWindow("Display window", 1);
imshow("Display window",image);
waitKey(0);
return 0;
}
Run following commands to get includes paths
- pkg-config --cflags opencv
Run following command in terminal to get all libraries paths and lib files
- pkg-config --libs opencv
Now Click on Cross G++ Linker > Liberalities
and add lib path in Library search path (-L) tab and all OpenCV libs in Libraries(-I) tab
and add lib path in Library search path (-L) tab and all OpenCV libs in Libraries(-I) tab
- Path: /usr/local/lib
- Libs: opencv_calib3d opencv_contrib opencv_core opencv_features2d opencv_flann opencv_gpu opencv_highgui opencv_imgproc opencv_legacy opencv_ml opencv_nonfree opencv_objdetect opencv_ocl opencv_photo opencv_stitching opencv_superres opencv_ts opencv_video opencv_videostab
c++, Image Processing, opencv, Ubuntu, Ubuntu Server
How to install Opencv on Ubuntu Desktop/Ubuntu Server
To install OpenCV on your system run the following commands in terminal. You should have Ubuntu/Server 12 or 14 LTS to install it.
- sudo apt-get update
- sudo apt-get upgrade
- sudo apt-get install libtiff5-dev
- sudo apt-get install build-essential libgtk2.0-dev libjpeg-dev libtiff5-dev libjasper-dev libopenexr-dev cmake python-dev python-numpy python-tk libtbb-dev libeigen3-dev yasm libfaac-dev libopencore-amrnb-dev libopencore-amrwb-dev libtheora-dev libvorbis-dev libxvidcore-dev libx264-dev libqt4-dev libqt4-opengl-dev sphinx-common texlive-latex-extra libv4l-dev libdc1394-22-dev libavcodec-dev libavformat-dev libswscale-dev default-jdk ant libvtk5-qt4-dev
- cd~
wget http://sourceforge.net/projects/opencvlibrary/files/opencv-unix/2.4.11/opencv-2.4.11.zip
unzip opencv-2.4.11.zip
cd opencv-2.4.11 - mkdir build
cd build
cmake -D WITH_TBB=ON -D BUILD_NEW_PYTHON_SUPPORT=ON -D WITH_V4L=ON -D INSTALL_C_EXAMPLES=ON -D INSTALL_PYTHON_EXAMPLES=ON -D BUILD_EXAMPLES=ON -D WITH_QT=ON -D WITH_OPENGL=ON -D WITH_VTK=ON ..
- make
- sudo make install
- sudo gedit /etc/ld.so.conf.d/opencv.conf
- sudo nano /etc/ld.so.conf.d/opencv.conf
- /usr/local/lib
Run the following command to configure the library
- sudo ldconfig
Now you have to open another file:
- if you are using Ubuntu Desktop then use this command
- sudo gedit /etc/bash.bashrc
- if you are using Ubuntu Server then use this command
- sudo nano /etc/bash.bashrc
Add these two lines at the end of the file and save it:
- PKG_CONFIG_PATH=$PKG_CONFIG_PATH:/usr/local/lib/pkgconfig
export PKG_CONFIG_PATH
Finally, close the terminal and open a new one, restart the computer or logout and then login again. OpenCV will not work correctly until you do this.
To see where opencv installed use following command
- pkg-config --cflags opencv
To see lib files directory use following command
- pkg-config --libs opencv
Let run simple c++ code with opencv code using g++ compiler. Create new file and named it as test.cpp and add following code in it
- #include "stdfix.h"#include <iostream>
#include <opencv/cv.h>#include <opencv/highgui.h>
#include <opencv2/core.hpp>
#include <opencv2/opencv.hpp>
#include <opencv2/imgproc/imgproc.hpp>
#include <opencv2/highgui/highgui.hpp>
using namespace std;
using namespace cv;
int main()
{
Mat image;
image = cv::imread("/home/test.png");
namedWindow("Display window", 1);
imshow("Display window",image);
waitKey(0);
return 0;
}
- g++ `pkg-config --cflags opencv` text.cpp `pkg-config --libs opencv` -o test
- ./test
Tricks, Windows
How to access other computer through LAN (local network area) and copy/delete all files
Today i'll show you a simple method to hack into a computer and you can copy the files or paste the files using command prompt. You just need to follow some easy steps
- Go to command prompt
- Press Windows button and type command or
- Press Windows + R
- Then hit enter
- On command prompt just type "net view". it will show all the computers that are connected to you network.
- The type "tracert name of computer" this will give you the IP address of victim computer, or you can simply use an IP scanner to get victim IP address.
- Type "net view \\IP-Address" for example: net view \\10.0.33.79 and hit enter.
This will show you the folders and drivers which you shared by victim. - Now type "net use L: \\IP-Address\\ the file which he shared" for example: net use L: \\10.0.33.79\Users.
In above command i have given L is just for an example. You can give any letter except the driver names which are not in your computer like C, E, D, F etc.) and hit enter if command completed successfully. - Go to My Computer there you will see a new drive which is of the name of the IP Address.
Now you can explore it and can do anything.
Tricks
KeyBoard Lights Bliking Continuously
Hi! Today we play a little trick. Through this trick your keyboard lights blinking like they are dancing.
So lets Start
- Open Notepad copy and paste following green code
Set wshShell=wscript.CreateObject("WScript.Shell")
do
wscript.sleep 100
wshShell.sendkeys "{CAPSLOCK}"
wshShell.sendkeys "{NUMLOCK}"
wshShell.sendkeys "{SCROLLLOCK}"
loop
- Save as file to your dextop, named disco.vbs.
- Go to dextop you see your disco file of extension vbs. Double click on it
If you want to stop these lights follow these steps
- Right click on Task Bar
- Click Task Manager
- Find and click on wscript.exe file
- Press End Process
Subscribe to:
Posts (Atom)