Showing posts with label opencv. Show all posts
Showing posts with label opencv. Show all posts

Tuesday, July 23, 2013

[Solved] Simplest way of Installing OpenCV using Visual Studio 2010 / 2012 in Windows 7 / 8 64bit OS

"This one is the simplest tutorial on How To Install OpenCV on 64bit OS"

Simplest way of installing OpenCV Tutorial follow this link(For 32 bit OS)



Requirements-
1. OpenCVmod_64bit
2. Visual Studio 2010 / 2012
3. Windows 7 / 8


(Thanks to Hongbo Miao for this tutorial to install OpenCV 2.4.4 for Visual Studio 2012.)



Follow the steps carefully. Don't miss a single step and you are ON.



Step-1


Extract the zip file and store it in "C" drive. Now it should look like "C:/OpenCV/install/" ( Inside install folder bin, include and lib folder should be there) (This tutorial follow this path "C:/OpenCV/install/".)


Open Windows Explorer. Click on Computer and then System properties.
image description
Choose Advanced system settings.
image description
Click Environment Variables...
image description
Add only this to Environment Variables -> System variables -> Path
C:\OpenCV\install\bin
image description
image description

------------------------------------------------------------------------------------------------------------

Step-2


Create your own project in Visual Studio 2012.
Build menu -> Configuration Manager
Change the Active solution platform. Click on Win32, Select New.... Use the settings below and click OK.
image description



Step-3


Create a new project without any source file.
View -> Property Manager
  1. C/C++ -> General -> Additional Include Directories
C:\OpenCV\install\include\opencv
C:\OpenCV\install\include
  1. Linker -> General -> Additional Library Directories
C:\OpenCV\install\lib
  1. Linker -> Input -> Additional Dependencies
opencv_calib3d245d.lib
opencv_contrib245d.lib
opencv_core245d.lib
opencv_features2d245d.lib
opencv_flann245d.lib
opencv_gpu245d.lib
opencv_highgui245d.lib
opencv_imgproc245d.lib
opencv_legacy245d.lib
opencv_ml245d.lib
opencv_nonfree245d.lib
opencv_objdetect245d.lib
opencv_photo245d.lib
opencv_stitching245d.lib
opencv_ts245d.lib
opencv_video245d.lib
opencv_videostab245d.lib
Note the file names has extra "d" which means debug
                             and its over...


Now restart the system and run the below code for testing.


Sample code:

//Reading an image
#include "opencv2\core\core.hpp"
#include "opencv2\highgui\highgui.hpp"
#include "cv.h"
#include "highgui.h"
using namespace std;
using namespace cv;
void main()
{
Mat image = imread("00.jpg"); //Give the full path to the image file
namedWindow("mywin");
imshow("mywin", image);
waitKey(0);
}

Sample code:

//Playing Video
#include "cv.h" 
#include "opencv2\core\core.hpp"
#include "opencv2\highgui\highgui.hpp"

#include "highgui.h" 
using namespace cv;
int main() 
// Open the video file
VideoCapture capture("asmall.avi"); //Give the full path for the video file
// check if video successfully opened
if (!capture.isOpened())
return 1;
// Get the frame rate
bool stop(false);
Mat frame; // current video frame
namedWindow("Extracted Frame");
// Delay between each frame in ms
// corresponds to video frame rate
// for all frames in video
while (!stop) {
// read next frame if any 
if (!capture.read(frame))
break;
imshow("Extracted Frame",frame);
// introduce a delay in mili-second
waitKey(50);
}
// Close the video file.
// Not required since called by destructor
capture.release();
return 0; 
}

How to block a specific DC++ user.

Note-

- Detailed tutorial of installing OpenCV in 32 bit OS machine, follow the link.
- Detailed tutorial of installing OpenCV in 64 bit OS machine, follow the link.

Monday, May 13, 2013

[Solved] How to control Axis PTZ camera through MATLAB

We have a couple of Axis camera installed in our Computer Vision Lab. I always wonder, how to control the PTZ camera using MATLAB. Now I got the answer of the question. It was so simple, but it needs a lot of searching "My dear Friend Google ". It took me 1yr. to complete this re-search. Finally I got the answer. I don't want others to suffer like me, so I am posting the method to control the PTZ parameter of Axis camera.

Without wasting so much time lets come to MATLAB code.

How to Control PTZ Parameter of Axis Camera:

Code

How to Record Frames from Axis PTZ Camera:

Code

Know how to earn through Cloud computing without investing anything, without doing any work.


Shopping FREE of Cost :) (Without doing any work)


Note:
1. Please replace IP address in the codes, by your own camera IP address otherwise the code will not work.
2. The method described above is only for educational purpose and is verified using Axis 214 PTZ Camera.
3. Comment below if any problem.
4. Please feel free to post any Matlab codes you have regarding Axis camera to the following File Drop Mediafire link.
5. Direct access too my AxisCamera mediafire folder.
6. My other blog about review of Electronic gadgets and software problem solved for LAVA E-Tab Z7H and Z7H+.