News:

Accounts with zero posts and zero activity during the last months will be deleted periodically to fight SPAM!

Main Menu

OpenCV

Started by cedric100, November 07, 2013, 02:34:39 AM

Previous topic - Next topic

cedric100

Hi,

I am all new in code blocks and I wonder if anyone ever used OpenCV with this IDE. If anyone did so, could you please contact me through Skype (cedric1538), which is, I think, a better way of handling my problem.

Where I think the problem is:
I copied my code from a program that actually worked in order to check whether I set up my computer nicely. But obviously, I did mistakes. Undefined function issue appears when it comes to debug. I know it means that I did not put the right library in the folder. But I did so, and the same message still appear.

After several tries to find the solution, I (unintently) did a bit of chaos on my computer and I think it cannot be solved by simply righting on this forum. I might need someone to control my computer through internet (I do not know how dangerous it is though, because it would be the first time I let someone doing it) and to put some order in my computer for me (because I have no idea how it is supposed to be) in order to make the program working.

Once the solution is found, we will just put in this forum where the issu was and how we fixed it.

I hope this is conveniant to anyone. Thank you.

You can contact me through Skype: cedric1538.

Here is the program I used. It is supposed to activate the webcam and display what is instantanously "sees" on a application page.

#include "cv.h"
#include "highgui.h"

using namespace cv;

int main()
{
   //Create matrix to store image.
   Mat image;
   //initialize capture.

   VideoCapture cap;
   cap.open(0);

   //create window to store image.
   namedWindow("window",1);

   while(1)
   {

       //copy webcam stream to image.

       cap>>image;

       //print image screen.
       imshow("window",image);

       //delay 33ms.
       waitKey(33);

   }

   return 0;
}

I hope you can help me.

ollydbg

You still make a mistake that you start a POLL instead a pure message.

QuoteUndefined function issue appears when it comes to debug. I know it means that I did not put the right library in the folder. But I did so, and the same message still appear.
Please be more specific. (show build logs, debugging logs)

Also, please warp you code in code tags.
If some piece of memory should be reused, turn them to variables (or const variables).
If some piece of operations should be reused, turn them to functions.
If they happened together, then turn them to classes.

cedric100

Ah, what a noobie am I. How do I put "code tag" ?

cedric100

And what do you mean by build logs and debugging logs ?

cedric100

#include "cv.h"
#include "highgui.h"

using namespace cv;

int main()
{
    //Create matrix to store image.
    Mat image;
    //initialize capture.

    VideoCapture cap;
    cap.open(0);

    //create window to store image.
    namedWindow("window",1);

    while(1)
    {

        //copy webcam stream to image.

        cap>>image;

        //print image screen.
        imshow("window",image);

        //delay 33ms.
        waitKey(33);

    }

    return 0;
}


Is that what I was supposed to do ?

cedric100


stahta01

For Build Logs read this FAQ

http://wiki.codeblocks.org/index.php?title=FAQ-Compiling_%28errors%29#Q:_How_do_I_troubleshoot_a_compiler_problem.3F

NOTE: We want "Build Log" NOT "build Messages" in nearly all cases.
Do a re-build (or clean followed by Build) and post the "Build Log".

Tim S.
C Programmer working to learn more about C++.
On Windows 10 64 bit and Windows 11 64 bit.
--
When in doubt, read the CB WiKi FAQ. [url="http://wiki.codeblocks.org"]http://wiki.codeblocks.org[/url]

cedric100

#7
I have no idea how you want me to show it to you, but I was thinking of doing some screen shot pasting on paint and send it in this post, but unfortunately, I do not find the way to do it.

Would someone know how to do it ?

cedric100

#8
Ah, sorry, I just have paid attention to the rules of this forum and I have noticed that I might be against them.

Is my topic inlaw ?

stahta01

Quote from: cedric100 on November 07, 2013, 03:49:39 AM
Ah, sorry, I just have paid attention to the rules of this forum and I have noticed that I might be against them.

What am I allowed to put on this forum ? And is my topic inlaw ?

How to do/set option X in Code::Blocks (CB) is on Topic.
What option X is needed is NOT on Topic.

So, if you figure out you need linker or compiler option X; you can ask here where to put or set the option in CB.

Tim S.
C Programmer working to learn more about C++.
On Windows 10 64 bit and Windows 11 64 bit.
--
When in doubt, read the CB WiKi FAQ. [url="http://wiki.codeblocks.org"]http://wiki.codeblocks.org[/url]

cedric100

#10
Oh, I see. So, I can ask "how do I configure it", but not which element (library) to put.

It is more like "how to use code blocks ?" and less like "how do you recommand me to code this program ?"

But how do I show you how I configured it. Do I simply tell it to you ? Or I can add a file to this post.

stahta01

Quote from: cedric100 on November 07, 2013, 04:03:15 AM
Oh, I see. So, I can ask "how do I configure it", but not which element (library) to put.

It is more like "how to use code blocks ?" and less like "how do you recommand me to code this program ?"

But how do I show you how I configured it. Do I simply tell it to you ? Or I can add a file to this post.

You post the"Build Log" on a site that support the Library and the Compiler you are using.
The tell you it is missing option X; you then can come here and ask where do I enter in X.

Tim S.
C Programmer working to learn more about C++.
On Windows 10 64 bit and Windows 11 64 bit.
--
When in doubt, read the CB WiKi FAQ. [url="http://wiki.codeblocks.org"]http://wiki.codeblocks.org[/url]

cedric100

So, the "build log" will be in both the site that support the library and in the compiler I am using. Am I right ?

QuoteThe tell you it is missing option X; you then can come here and ask where do I enter in X.

I do not know what you mean by missing option.

And Does "X" correspond to "anything" ?

stahta01

#13
Quote from: cedric100 on November 07, 2013, 04:39:31 AM
So, the "build log" will be in both the site that support the library and in the compiler I am using. Am I right ?

QuoteThe tell you it is missing option X; you then can come here and ask where do I enter in X.

I do not know what you mean by missing option.

And Does "X" correspond to "anything" ?

Yes, what ever user mistake you made is likely because you used the wrong option or missing the right one.

If you PM me once more, I will ask that you be banned from this site!!!

From http://www.catb.org/esr/faqs/smart-questions.html
Quote
Choose your forum carefully

Be sensitive in choosing where you ask your question. You are likely to be ignored, or written off as a loser, if you:

    post your question to a forum where it's off topic

    post a very elementary question to a forum where advanced technical questions are expected, or vice-versa

    cross-post to too many different newsgroups

    post a personal e-mail to somebody who is neither an acquaintance of yours nor personally responsible for solving your problem

Hackers blow off questions that are inappropriately targeted in order to try to protect their communications channels from being drowned in irrelevance. You don't want this to happen to you.

Tim S.
C Programmer working to learn more about C++.
On Windows 10 64 bit and Windows 11 64 bit.
--
When in doubt, read the CB WiKi FAQ. [url="http://wiki.codeblocks.org"]http://wiki.codeblocks.org[/url]

MortenMacFly

Quote from: stahta01 on November 07, 2013, 05:10:42 AM
If you PM me once more, I will ask that you be banned from this site!!!
Its done already for a week. He PM'ed a lot people - that's not acceptable.
Compiler logging: Settings->Compiler & Debugger->tab "Other"->Compiler logging="Full command line"
C::B Manual: [url="https://www.codeblocks.org/docs/main_codeblocks_en.html"]https://www.codeblocks.org/docs/main_codeblocks_en.html[/url]
C::B FAQ: [url="https://wiki.codeblocks.org/index.php?title=FAQ"]https://wiki.codeblocks.org/index.php?title=FAQ[/url]