Qt Forum

    • Login
    • Search
    • Categories
    • Recent
    • Tags
    • Popular
    • Users
    • Groups
    • Search
    • Unsolved

    How to use the function 'cvCreateStructuringElementEx ()'?

    The Lounge
    2
    2
    2253
    Loading More Posts
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes
    Reply
    • Reply as topic
    Log in to reply
    This topic has been deleted. Only users with topic management privileges can see it.
    • I
      isaacEnrique last edited by

      Regards

      I think in my previous post, "Create a structuring element of 3 * 3", I do not clearly established what the problem was; maybe not well understood what I meant.

      The problem is: how to use the function

      cvCreateStructuringElementEx ()

      to create a structuring element of 3 * 3 with origin at the center (obviously a solid rectangular structuring element).

      As I understand it, this is the structuring element that is created by default when none is given ... Right?

      So the question is: what parameters should I pass to the function?

      I tested with the following:

      (case 1)
      cvCreateStructuringElementEx (3, 3, 1, 1, CV_SHAPE_RECT);

      and

      (case 2)
      cvCreateStructuringElementEx (3, 3, -1, -1, CV_SHAPE_RECT);

      In the first case I got an SE is not the one I'm waiting (I think), and that when used to dilate an image, as follows:

      cvDilate (entrada_gris, dilatacion2, ee, iterations);

      obtain a resulting image that is different from that obtained with:

      cvDilate (entrada_gris, dilatacion1, NULL, iterations);

      I think that the results should be the same (ie dilatacion1 = dilatacion2), but it is not.

      In case 1, I conclude that one of the two structural elements (either 'ee' or the structuring element is created when passing NULL to function) is not a rectangular structuring element of 3 * 3 with origin at the center ... Right?

      In the second case an error is generated at runtime.

      Thanks in advance to anyone who can provide some help regarding this issue.

      By the way, I'm working with OpenCV 2.2.0 and 1.2.1 QtSDK under Windows 7 64-bit

      Isaac Pérez
      Programming is understanding.

      1 Reply Last reply Reply Quote 0
      • JKSH
        JKSH Moderators last edited by

        What does the OpenCV documentation say?

        Even though you are using the Qt SDK, your problem is only about how to use an OpenCV function, which is not related to Qt at all. So, you can probably find more help at an OpenCV forum (http://answers.opencv.org ) than at a Qt forum.

        Having said that, please feel free to ask here if you'd like some help with how to link the Qt library to your project, or how to use the Qt SDK. :)

        Qt Doc Search for browsers: forum.qt.io/topic/35616/web-browser-extension-for-improved-doc-searches

        1 Reply Last reply Reply Quote 0
        • First post
          Last post