How to setup OpenCV (Referring to Harvard University's Wiki)

xiaoxiao2021-03-30  180

HOWTO SETUP OpenCV

From RFC Cambridge Wiki

(Difference Between Revision)

Revision as of 03:42, 2 February 2006RShi (Talk | Contribs) â Previous Diffrevision As of 03:43, 2 February 2006rshi (Talk | Contribs) OpenCV with Devcpnext Diff â 'Line 23: Line 23: == OpenCV with devCPP == == OpenCV with devCPP == -. OpenCV is Intelâ € ™ s open source computer vision library It contains a huge collection of computer-vision related algorithms, data structures, filters, etc. that we may find useful . OpenCV is Intel's open source computer vision library. It contains a huge collection of computer-vision related algorithms, data structures, filters, etc. that we may find useful. Once your IDE is set up, go to http://sourceforge.net / Projects / OpenCVLibrary / and Click on the opencv-winlink overce your IDE is set up, go to http://sourceforge.net/projects/opencvlibrary/ and click on the opencv-win link

Revision as of 03:43, 2 February 2006

Setting Up OpenCV IN A Variety of Environments.

OpenCV with V2005

.................. ..

Obtain The Executable Source Files (Available In The Files Section) and Install OpenCV.

Make Sure The Path To The OpenCV Libaries Are Correctly Set (Should Be The Check Box During Installation.)

You can set this yourself if you move the directory by right clicking My Computer and selecting properties (or hitting Win Key Break), selecting the Advanced Tab, and hitting the Environment Variables button on the bottom. In User Variables, there should be a Path Setting, Set to Wheree The OpenCV Library is Installed (Default IS C: / Program Files / OpenCV / BIN).

Open the Visual Studio 2005 environment, and open the opencv.sln solution file stored in the _make directory of your installation (default is C: / Program Files / OpenCV / _make). .This should load the entire solution into the Visual Studio environment.

In Visual Studio, Select The Build File-Menu, and SELECT Build Solution.

Optional: you make choose to clean the solution before building.

Note: It Takes A Significant Amount of Time To Compile The Entire OpenCV Library.

Enjoy Your Newly Built OpenCV LIBRARY!

OpenCV with devcpp

OpenCV IS Intel's Open Source Computer Vision Library. It Contains a huge collection of computer-vision related Algorithms, Data Structures, Filters, etc. That We May Find Useful.

Once Your IDE IS set up, go to http://sourceforge.net/projects/opencvlibrary/ and click on the opencv-win link

Click on The Download OpenCV Beta5 Link. On the next page, choise a mirror to download

Run the setup program you just downloaded. Accept all the defaults; this will install opencv to c: / program files / opencv.

If you navigate to the C: / Program Files / OpenCV / samples / c directory, you will find a bunch of C / C code samples, showing off some of OpenCVâ € ™ s capabilities Some of them require a connected webcam to work;. Those Won "THEMPLES OF EDGE DETECTION, ERODE / DILATION, ETC.

IMPORTANT: There is a naming problem with the latest beta5 version of openCV Navigate to the C:.. / Program Files / OpenCV / bin directory There you will find several .dll files with an 097 in them Copy each .dll, and change. The name from 097 to 096. (IE, the copy of cv097.dll Becomes Cv096.dll, Same for CVAUX, CVCAM, CXCORE, AND HIGHGUI) (this can be done by running copy * 097.dll * 096.dll Under the command shell) Add the C: / Program Files / OpenCV / bin directory and the C:. / Program Files / OpenCV / otherlibs / highgui directory to your system PATH variable This tells the computer where to find the .dll system libraries to do. this, go to Start Menu-> Control Panel -.> System (or hit the Windows Button break keys) Go to the Advanced tab and click the Environmental Variables button In the lower box, find the variable labeled PATH Click Edit... In The Lower Text Box, Navigate To The end and append; c: / program files / opencv / bin; c: / program files / opencv / otherlibs / highgui (Remember the Semicolons). Click Ok in all the windows.

Open Up BloodShed DEV-C

Go to File-> Open Project Or Fileâ € | And Open Up C: / Program Files / OpenCV / Samples / C / Contours.c

Make A New File (File-> New-> Source File). Copy and Paste The Code from Contours.c Into this New File, And Save IT as Test.cpp

Go to Tools-> Compiler Options. It Should Come Up with The Compiler Tab SELECTED. Check The Box Labeled Add these Commands to the

Linker Command Line and Type (or Copy-Paste) The Following Into The Text Box:

-lhighgui -lcv -lcxcore -lcvaux -lcvcam

This Tells The Ide to Link your Program with the opencv libraries.

Switch to the Directories Tab, And in The Libraries Sub-Tab Add to Directories:

C: / Program Files / OpenCV / LIB

Switch to the c includees tab. Addc: / program files / opencv / cxcore / incrude

C: / Program Files / OpenCV / CV / INCLUDE

C: / Program Files / OpenCV / OtherLibs / Highgui

C: / Program Files / OpenCV / CVAUX / INCLUDE

C: / Program Files / OpenCV / OtherLibs / CVCAM / Include As Include Directories.

Do The Same Thing for the C Includes Tab.

Now you should be able to compile and run the test.cpp sample file with the command Execute-> Compile and Run. This program analyzes the image of the faces to extract information about the different regions. You can change the level of the contour to see different elements of the face (eyes, pupil, nose, mouth, etc) Play around with the source code for this program;.. change parameters or a line of code, and see what it does Make sure to recompile with (Execute- > Compile and Run Every Time You make a change.

OpenCV with G (on a Linux system)

If You Use Linux, You CAN Set Up OpenCV There with G by Following these Steps:

Go to http://sourceforge.net/projects/opencvlibrary/ and Download the opencv-0.9.7.tar.gz file. (Note Version Might Change Later)

As Superuser, Go To The Directory You Downloaded The Tar.gz File Into. There, TYPE

Tar -xzf opencv-0.9.7.tar.gz

CD OpenCV-0.9.7

./configure && make && make install

OpenCV Should Be Installed. But We need to prepare G to work with opencv. So, go to your home directory and open the .bashrc file. Append the following to the file.

Alias ​​GCV = "G -i / usr / local / include / opencv -lcv -lcxcore -lcvaux -lhighgui"

Now, Go To The OpenCV-0.9.7 Directory from Earlier, INTO SAMPLES, AND INTO C, AND Make Sure The Following Runs The Contour Program.

GCV coutours.c && ./a.out

IF not, Troubleshoot. If So, You Should Be Good.Retrieved from "

http://hces1.fas.harvard.edu/wiki/index.php/howto_setup_opencv "

转载请注明原文地址:https://www.9cbs.com/read-130657.html

New Post(0)