OpenCV 2.3.1 with CodeBlocks on Ubuntu 12.04

For Installing OpenCV 2.3.1 on ubuntu 12.04 please refer to previous post
http://opencvlover.blogspot.in/2012/05/install-opencv-231-on-ubuntu-1204.html

Once the installation is done, install codeblocks as mentioned in previous post http://opencvlover.blogspot.in/2011/07/installing-opencv-with-codeblocks-ide.html

Create a new console application as mentioned in above post and go to Build Options.
Make sure that GNU GCC compiler is selected in compiler drop down option.
Go to Linker Settings tab and Link libraries which are located at /usr/local/lib/ and looks like 'libopncv_*.so'
An example is shown in image below


Now go to Search directories and under Compiler tab add following location
/usr/local/include/opencv2
Here is a screenshot


Now we are ready to run OpenCV 2.3.1 on Code Blocks running on Ubuntu 12.04.
Here is a sample code to test the installtion






23 comments:

  1. Hi.. I am getting following errors...
    /home/cpp/img/main.o||In function `main':|
    main.cpp|| undefined reference to `cvNamedWindow'|
    main.cpp|| undefined reference to `cvWaitKey'|
    main.cpp|| undefined reference to `cvDestroyWindow'|
    ||=== Build finished: 3 errors, 0 warnings ===|

    Please tell me what should i do?????

    ReplyDelete
    Replies
    1. Please check your linker setting as mentioned in the post. Which opencv version are you using?

      Delete
    2. I have checked linker settings.. Still its not working..
      I am using OpenCV Version 2.1.0-7...

      Delete
    3. Method mentioned in above blogpost works for opencv 2.3 and higher versions. I would suggest you using opencv 2.3.1 or higher versions as they are latest.
      For opencv 2.1 I guess you will have to soecify few more setting such as include directory etc.

      Delete
    4. This is real take it serious, i am LORA ROBERT, i am from Ireland. Who will believe that a herbal medicine can cure herpes, I never believe that this will work, i have spend a lot money getting drugs from the hospital to keep me and my son healthy, it got to a point that i was waiting for death to come because i was broke, one day i heard about this great man called Dr ODUWA who is well known for Herpes, HIV, and Cancer cure, i decided to email him I didn't believe him that much, I just wanted to give him a try, he replied my mail and Needed some Information about me, then I sent them to him, he prepared a herbal medicine (CURE) and, he gave my details to the Courier Office. they told me that 4-8 days I will receive the package and after receiving it, i took the medicine as prescribed by him at the end of the two weeks, he told me to go to the hospital for a checkup, and i went, surprisingly after the test the doctor confirm me Herpes simplex virus negative, and my son and i thought it was a joke, i went to other hospital and was also negative, thank you for saving our life's, I promise I will always testify of your good works. If you are herpes simplex virus patient, contact him and I am sure you will get cured, contact him via: dr.oduwaspellhome@gmail.com or whatsapp him at +2348070685053.
      THESE ARE THE THINGS Dr ODUWA CURE
      . COLD SORE
      . HIV/AIDS
      . CANCER
      . HPV
      . LASSA FEVER
      . GONORRHEA

      Delete
  2. Hi... i am new to ubuntu and opencv...
    I followed the above mentioned steps..
    but i am getting following error....

    -------------- Build: Debug in p2 ---------------

    Linking console executable: bin/Debug/p2
    /usr/bin/ld: cannot find -lcv
    /usr/bin/ld: cannot find -lhigui
    /usr/bin/ld: cannot find -lcvaux
    /usr/bin/ld: cannot find -lcv
    /usr/bin/ld: cannot find -lcvaux
    /usr/bin/ld: cannot find -lhigui
    collect2: ld returned 1 exit status
    Process terminated with status 1 (0 minutes, 0 seconds)
    6 errors, 0 warnings

    can anybody tell what is the problem????

    ReplyDelete
    Replies
    1. which opencv version are you using?

      Delete
    2. Hi I am also getting the same error...

      /usr/bin/ld: cannot find -lcv
      /usr/bin/ld: cannot find -lcvaux
      /usr/bin/ld: cannot find -lhigui
      collect2: ld returned 1 exit status

      I am using openCV 2.4.9

      Delete
  3. Hi..
    I am trying to capture image using webcam. When i executed the code its giving me capture as null.
    What could be the problem??
    Please help me.
    Following is the code.

    #include
    #include

    int main( int argc, char** argv )
    {
    cvNamedWindow( "Example", CV_WINDOW_AUTOSIZE );

    CvCapture* capture = cvCaptureFromCAM(0) ;
    IplImage* frame;

    while(1)
    {
    frame = cvQueryFrame( capture );

    if( 1 ) // !frame
    break;
    cvShowImage( "Example", frame );

    char c = cvWaitKey(33);
    if( c == 27 )
    break;

    cvSaveImage("webcam_frame.png",frame);
    }
    cvReleaseCapture( &capture );
    cvWaitKey(0);
    cvDestroyWindow( "Example" );
    }

    ReplyDelete
  4. Hiv disease for the last 3 years and had pain hard to eat and cough are nightmares,especially the first year At this stage, the immune system is severely weakened, and the risk of contracting opportunistic infections is much greater. However, not everyone with HIV will go on to develop AIDS. The earlier you receive treatment, the better your outcome will be.I started taking ARV to avoid early death but I had faith in God that i would be healed someday.As a Hiv patent we are advise to be taking antiretroviral treatments to reduce our chance of transmitting the virus to others , few weeks ago i came on search on the internet if i could get any information on Hiv treatment with herbal medicine, on my search i saw a testimony of someone who has been healed from Hiv her name was Achima Abelard and other Herpes Virus patent Tasha Moore also giving testimony about this same man,Called Dr Itua Herbal Center.I was moved by the testimony and i contacted him by his Email.drituaherbalcenter@gmail.com We chatted and he send me a bottle of herbal medicine I drank it as he instructed me to.After drinking it he ask me to go for a test that how i ended my suffering life of Hiv patent,I'm cured and free of Arv Pills.I'm forever grateful to him Drituaherbalcenter.Here his contact Number +2348149277967...He assure me he can cure the following disease..Hiv,Cancer,Herpes Virus,Epilepsy, fibromyalgia ,ALS,Hepatitis,Copd,Parkinson disease.Genetic disease,Fibrodysplasia Ossificans Progressiva,Factor V Leiden Mutation ,Fatal Familial Insomnia ,Dupuytren's disease,Fibrodysplasia Ossificans Progressiva,Fluoroquinolone Toxicity Syndrome,Inflammatory bowel disease ,Huntington's disease ,Diabetes,Fibroid...

    ReplyDelete
  5. I want to thank Dr Emu a very powerful spell caster who help me to bring my husband back to me, few month ago i have a serious problem with my husband, to the extend that he left the house, and he started dating another woman and he stayed with the woman, i tried all i can to bring him back, but all my effort was useless until the day my friend came to my house and i told her every thing that had happened between me and my husband, then she told me of a powerful spell caster who help her when she was in the same problem I then contact Dr Emu and told him every thing and he told me not to worry my self again that my husband will come back to me after he has cast a spell on him, i thought it was a joke, after he had finish casting the spell, he told me that he had just finish casting the spell, to my greatest surprise within 48 hours, my husband really came back begging me to forgive him, if you need his help you can contact him with via email: Emutemple@gmail.com or add him up on his whatsapp +2347012841542 is willing to help any body that need his help.

    ReplyDelete
  6. Great Article
    Image Processing Projects


    Deep Learning Projects for Final Year


    JavaScript Training in Chennai

    JavaScript

    Training in Chennai


    The Angular Training covers a wide range of topics including Components, Angular Directives, Angular Services, Pipes, security fundamentals,

    Routing, and Angular programmability. The new Angular TRaining will lay the foundation you need to specialise in Single Page Application developer.

    Angular Training Project Centers in Chennai

    ReplyDelete
  7. my ex-boyfriend dumped me 7 months ago after I caught him of having an
    affair with someone else and insulting him. I want him back in my life but
    he refuse to have any contact with me. I was so confuse and don't know what
    to do, so I visited the INTERNET for help and I saw a testimony on how a
    spell caster help them to get their ex back so I contact the spell caster
    and explain my problems to him..... he cast a spell for me and assure me of
    15 hours that my ex will return to me and to my greatest surprise the third
    day my peter came knocking on my door and beg for forgiveness. I am so
    happy that my love is back again and not only that, we are about to get
    married. Once again thank you Dr Okosun , you are truly talented and gifted
    contact him on WhatsApp +2348133974847
    Okosunspelltemple33@gmail.com

    ReplyDelete
  8. I was married at 32 and immediately tried to get pregnant. When I was unable to conceive I had blood tests for fertility and was told that I had an FSH (follicle stimulating hormone) of 54 and would not be able to have children. Even though the doctors knew that I had been diagnosed with Hashimoto’s thyroiditis since age 25, no one bothered to check my thyroid levels. my TSH was measured at .001. My Synthroid dosage was lowered. a friend advise me to contact a spiritualist who help with fertility with his medicine, i collected his contact and explain my situation to him he prepared for me a herbal medicine which i took as describe by him. became pregnant very quickly, I had a successful pregnancy. I have my baby august 2017. to get pregnant at age 35 with my 2nd child in september 2019, thank you sir , this is his email contact if you require his help babaka.wolf@gmail.com or Facebook at priest.babaka

    ReplyDelete
  9. There is a great herbal man called Dr voodoo who can cure Hepatitis B virus and other deadly diseases with the use of natural herbs to cure Hepatitis B virus problems. He is from Africa and he is a great doctor and he can also cure you as well if you are have the problem And other deadly disease and here is email address voodoospelltemple66@gmail.com or Whatsapp +2348140120719 HERPES CURE,CANCER CURE,HIV/AIDS CURE,HPV CURE

    ReplyDelete
  10. Borgata Hotel Casino and Spa - Mapyro
    Borgata 경상남도 출장안마 Hotel Casino and Spa 통영 출장샵 - Mapyro, America's number one 여주 출장안마 place to experience affordable 구미 출장안마 gaming, world-class 시흥 출장샵 spa experiences, world-class

    ReplyDelete
  11. Thanks for the view but to know more visit any time at Digital marketing course in Gurgaon

    ReplyDelete
  12. thanks to dr awowo for bringing back my ex husband, after fighting and he decided to divorce me and left with a different woman. he left me and the kids alone living us with nothing, but when i contacted dr awowo he decided to help me and he told me what to do. i did what he ask because it want easy trusting him but i did trust him. but thanks be unto him after 2 days i received a call from my darling husband begging me to come back, and told me he mad a very big mistake. contact dr awowo today email him (drawowo69@gmail.com) or whatsapp +2348119204759

    ReplyDelete
  13. BEST EVER IN THE WORLD. YOU MUST TRY THIS !
    AMAZING WORK GUYS JUST KEEP IT UP !
    SITE IS HERE : Best PDO Threads in Gig Harbor

    ReplyDelete
  14. Thanks for sharing such a great information.. It really helpful to me..I always search to read the quality content and finally i found this in you post. keep it up!

    Digital Marketing Course in Raipur

    ReplyDelete
  15. Your Blog is very nice.
    Wish to see this much more like this. Thanks for sharing your information!
    Best Eye Hospital in Ambikapur

    ReplyDelete
  16. I feel very grateful that I read this. It is very helpful and very informative and I really learned a lot from it.

    ReplyDelete