Thursday, 12 December 2013

How to install Opencv in Visual Studio 2010 in windows 64 bit

Many of us ofcourse Programmers facing problem in OpenCv with Visual Studio 2010. Problem encounter at the beginning. Means installation of OpenCv in VS_2010 specially in windows 7 64bit computer. I have created a video in which this type of installation problem has solved. Here you can see the video click here.
Also I am describing here all the steps for installation. You may watch video or go step by step process to install.

Step-1: 

software requirement : 

1. Microsoft Visual Studio 2010 express


2. OpenCv Latest Version

Step-2:

After downloading vs2010 install it and when you run OpenCv .exe file it will extract all data to a directory in your computer. 
 It will look like this (for opencv)
Step-3:

Now you have done installing vs2010 and opencv. Now you have to configure property sheet in vs2010 project to properly run your c++ image-processing code. In property sheet configuration we just import opencv and it functions to visual studio to perform image-processing action. So get ready for that. step 4 explain how to configure property sheet.


Step-4:

Open visual Studio 2010 and create new project. Select win32 and console application as shown in figure below and click Ok.

Then click next.
Then check on empty project and click finish.
 Next go to property manager which is below right side in window.
Now right click on debug |win32 and select last option property. Then it will look like as image below
and
  

In above image there are three points.
      4a. VC++ directories
      4b. c/c++
      4c. Linker


4a.  VC++ directories :

   There are two field.
   include directory and library directory
In "include directory" you have to add include folder of opencv
in my case it is in folder "C:\Users\Krishna\Downloads\Programs\opencv\build\include"
In "Library directory" you have to add library folder of opencv as like "C:\Users\Krishna\Downloads\Programs\opencv\build\x86\vc10\lib"
this tutorial only describe for windows 64 bit users.
4b. C/C++ :

go to general  ->  additional include directory.
and add the include folder of opencv


4c. Linker :

There will be two tab "general" and "input"
In general tab add in additional library directories

 now go to the input tab. 
It is serious part of step 4 and you need to mare care about this part.
go to directory "C:\Users\Krishna\Downloads\Programs\opencv\build\x86\vc10\lib" and copy the name of all debug dll file and paste it in input part as in figure below
how to identify debug dll file? 
simple way is that if a file contains atleast one 'd' letter then it will be debug dll file. I am using opencv 4.6 so in my case it is

opencv_calib3d246d.lib
opencv_contrib246d.lib
opencv_core246d.lib
opencv_features2d246d.lib
opencv_highgui246d.lib
opencv_imgproc246d.lib
opencv_legacy246d.lib
opencv_nonfree246d.lib
opencv_objdetect246d.lib
opencv_photo246d.lib
opencv_stitching246d.lib
opencv_video246d.lib
opencv_videostab246d.lib


after that click Ok and again Ok to close property sheet.
Now you have done.

Step-5: 

Now go to solution explorer and right click on source -> add new source file and add c++ file
build and run your code.
Here is sample code just copy and paste.

#include <opencv\cv.h>
#include <opencv\highgui.h>

using namespace std;
using namespace cv;

int main()
{
IplImage* img =  cvLoadImage("c:\\p.jpg");
cvNamedWindow("Input_Image");
cvShowImage("Input_Image",img);
waitKey(300);
system("pause");

return 0;
}

I hope you run your code successfully. For any help regarding to this topic please comment I will help you always.
Thank You.

Friday, 6 December 2013

Face Detection in OpenCv and Visual Studio 2010

Face detection was one of the my hobby project. I did it successfully. At the same time I learned OpenCv and its uses and various function. I am still learning. Here I will describe whatever i did in my face detection project. Here is my project result click here.

Sunday, 1 December 2013

Access smartphone's webcam in opencv in c++

This post  describe you how to access ipwebcam from your smartphone to your project in opencv. I faced very difficulty to find solution of this problem on internet. Now I have solved this problem and decide to share it for helping others who is seeking with this problem.
First you need to download ip-webcam in your smartphone. I am using android v3.6 . You can download ipwebcam from google play store. Now when you start server it generate ip address based on your network. If you are using internet then it provide your isp address. If you connected to wifi then it will generate your device ip-address and If you are using tethering hotspot then it will generate gateway ip-address. Whatever when you get the ip-address you need to open it in your computer in any browser. I am supposing your ip-address is http://192.168.100.1:8080
Now come to second part ...
In Visual Studio 2010 and opencv I am using c++ programming. The only way to access webcam from mobile is write a code to download image from ip-address to your computer and you can use that image for further processing. Here is code.

//Code:

#include <math.h>
#include <opencv\cv.h>
#include <opencv\highgui.h>
#include <stdlib.h>
#include <iostream>
#include <stdio.h>
#include<UrlMon.h>
#include<tchar.h>
#pragma comment(lib,"urlmon.lib")


using namespace cv;
using namespace std;


int main()
{
    Mat capf;
    for(;;)
    {
HRESULT hr = URLDownloadToFile(NULL,
        _T("http://192.168.43.1:8080/shot.jpg"),
        _T("e:/ptest.jpg"),0,NULL);

    //IplImage *test=cvLoadImage("e:/ptest.jpg");
    capf=imread("e:\\ptest.jpg");
    imshow("test",capf);
    cvWaitKey(30);
    }
    system("pause");
    return 0;
}


This program grab an image from your mobile webcam and store it in particular location (any drive) and next line in code open that image in your opencv window for further processing. This process is slow but very usefull in various application.
I am not a professional so my explaination is rough type. All you need to grab information from this post. Further any query leave a comment. Thank You.

Friday, 22 November 2013

BackTrack 5 Hacking Tutorial

Hi guys...
This is my first tutorial on backtrack5. In this tutorial you will know how to access any computer in LAN using backdooring method. All you need to create a payload (a virus) and send it to your friend computer and wait for open it. When your friend open this file you have full access to your friend's computer. There is a step by step tutorial in video. Click Here to see this video. Thank You

Wednesday, 13 November 2013

Tell me about yourself. The best and precise answer for HR interview.

This is very common question in almost every interview. Interviewer asks this question to get you talking and they sense how well you present yourself immediately. In short they want to see you in action.They comes to know by asking this question is : How do you come across; how articulate are you; do you speak with confidence, poise, authority etc.
So for answering this question you need to very careful and well prepared for this question to impress interviewer. Here is some ways and examples to make yourself perfect by practicing this.

Tips

1. Don't speak lengthy history or wander off in different directions. Your response should be focused and purposeful.

Monday, 4 November 2013

Solved TCS question paper

1) 28a + 30 b +31c =365 find a+b+c if a.b.c are natural numbers


2) P is 30% of Q
    Q is 20% of M
   M is 50% of N

what is P/N equal to.


3)Mother +daughter+infant age is 74. Mother age is 46 more then daughter and infant.And infant age is 0.4 of daughter. Find daughters age.


4) A takes 12 hrs to complete a work B takes 10 hrs to complete the same work time taken by them to make 2 publications working independently.

5)Some cards question. Probability of 1 ace which is red and one spade. Something like
This. Do go thru the cards ques. The decks and everything.


6)A finishes a work in 8 hrs
   B finishes a work in 10 hrs
  C  finishes a work in 12 hrs
A,B,C work together but A leaves after 2 hrs find the time t taken by B & C.


7)There are exactly 4 Thursdays and 4 Sundays in a month of 31. Find the first day.
You can calculate easily.

8)There were some questions of this type :-

J, K, L, M and N collected stamps. They collected a total of 100 stamps. None of them collected less than 10.
No two among them collected the same number.
(i) 3 collected the same number as K and M together.
(ii) L collected 3 more than the cube of an integer
(iii) The no. collected by J was the square of an integer.
(iv) Total no. collected by K was either the square or cube of an integer.
1. The no. collected by J was:
(1) 27 (2) 49 (3) 36 (4) 64
2. The no. collected by K was:
(1) 16 (2) 27 (3) 25 (4) 36
3. The difference of numbers collected by L & M was:
(1) 3 (2) 2 (3) 5 (4) 9

9)All numbers between 11 & 100 how many times is the number 4 used

10)A & B travelling from X to Y. A starts at 12 pm at a speed of 63m/hr. B at 1:30 pm at a speed of 84m/hr.At what time will B be 34m ahead of A?

11)There were2-3 visualizing questions also.
A cube was given in 1d. With dotted lines. Faces were marked. With 1 face as x. U had to
Tell that what will be face opposite x when it is folded as a cube.
12)Another time distance, a person runs around a rectangular field. Time given speed
Given. Find the distance. Apply perimeter formula 2(length+breadth). And length and breadth
Ratio given. Find area.