Author Topic: OpenCV  (Read 6660 times)

Offline cedric100

  • Single posting newcomer
  • *
  • Posts: 9
OpenCV
« on: November 07, 2013, 02:34:39 am »
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.
« Last Edit: November 07, 2013, 03:56:05 am by cedric100 »

Offline ollydbg

  • Developer
  • Lives here!
  • *****
  • Posts: 5229
  • OpenCV and Robotics
    • Chinese OpenCV forum moderator
Re: OpenCV
« Reply #1 on: November 07, 2013, 02:40:45 am »
You still make a mistake that you start a POLL instead a pure message.

Quote
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.
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.

Offline cedric100

  • Single posting newcomer
  • *
  • Posts: 9
Re: OpenCV
« Reply #2 on: November 07, 2013, 02:51:24 am »
Ah, what a noobie am I. How do I put "code tag" ?

Offline cedric100

  • Single posting newcomer
  • *
  • Posts: 9
Re: OpenCV
« Reply #3 on: November 07, 2013, 02:53:50 am »
And what do you mean by build logs and debugging logs ?

Offline cedric100

  • Single posting newcomer
  • *
  • Posts: 9
Re: OpenCV
« Reply #4 on: November 07, 2013, 02:56:17 am »
Code: [Select]
#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 ?

Offline cedric100

  • Single posting newcomer
  • *
  • Posts: 9
Re: OpenCV
« Reply #5 on: November 07, 2013, 03:00:25 am »
I guess it is.

Offline stahta01

  • Lives here!
  • ****
  • Posts: 6794
    • My Best Post
Re: OpenCV
« Reply #6 on: November 07, 2013, 03:30:21 am »
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++ and Git.
On Windows 7 64 bit and Windows 10 32 bit.
On Debian Stretch, compiling CB Trunk against wxWidgets 3.0.
--
When in doubt, read the CB WiKi FAQ. http://wiki.codeblocks.org

Offline cedric100

  • Single posting newcomer
  • *
  • Posts: 9
Re: OpenCV
« Reply #7 on: November 07, 2013, 03:42:32 am »
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 ?
« Last Edit: November 07, 2013, 03:44:53 am by cedric100 »

Offline cedric100

  • Single posting newcomer
  • *
  • Posts: 9
Re: OpenCV
« Reply #8 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.

Is my topic inlaw ?
« Last Edit: November 07, 2013, 03:56:49 am by cedric100 »

Offline stahta01

  • Lives here!
  • ****
  • Posts: 6794
    • My Best Post
Re: OpenCV
« Reply #9 on: November 07, 2013, 03:58:22 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++ and Git.
On Windows 7 64 bit and Windows 10 32 bit.
On Debian Stretch, compiling CB Trunk against wxWidgets 3.0.
--
When in doubt, read the CB WiKi FAQ. http://wiki.codeblocks.org

Offline cedric100

  • Single posting newcomer
  • *
  • Posts: 9
Re: OpenCV
« Reply #10 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.
« Last Edit: November 07, 2013, 04:10:26 am by cedric100 »

Offline stahta01

  • Lives here!
  • ****
  • Posts: 6794
    • My Best Post
Re: OpenCV
« Reply #11 on: November 07, 2013, 04:27:16 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++ and Git.
On Windows 7 64 bit and Windows 10 32 bit.
On Debian Stretch, compiling CB Trunk against wxWidgets 3.0.
--
When in doubt, read the CB WiKi FAQ. http://wiki.codeblocks.org

Offline cedric100

  • Single posting newcomer
  • *
  • Posts: 9
Re: OpenCV
« Reply #12 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 ?

Quote
The 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" ?

Offline stahta01

  • Lives here!
  • ****
  • Posts: 6794
    • My Best Post
Re: OpenCV
« Reply #13 on: November 07, 2013, 05:10:42 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 ?

Quote
The 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.
« Last Edit: November 07, 2013, 05:15:29 am by stahta01 »
C Programmer working to learn more about C++ and Git.
On Windows 7 64 bit and Windows 10 32 bit.
On Debian Stretch, compiling CB Trunk against wxWidgets 3.0.
--
When in doubt, read the CB WiKi FAQ. http://wiki.codeblocks.org

Offline MortenMacFly

  • Administrator
  • Lives here!
  • *****
  • Posts: 9580
Re: OpenCV
« Reply #14 on: November 07, 2013, 12:13:37 pm »
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: http://www.codeblocks.org/docs/main_codeblocks_en.html
C::B FAQ: http://wiki.codeblocks.org/index.php?title=FAQ