python - OpenCV, area between two curves -


I work with the library in OpenCV Python . The question is whether to select the roi field separately in two different parts? Curves are defined by two quadric polynoms.

Enter image details here

I curve 1 and curve You want to know the count of black pixels in the restricted area between 2

You can create a mask by drawing, But from your equation you should have the following data,

  • center ??? The center of the oval (here I used the center of the image).
  • Axes half of the size of the oval main axes (here I have used the picture size / 2 and image size / 4 respectively respectively for both).
  • Angle ??? Elliptic rotation angle in degree, (here I used 0)
  • startAngle â ???? Begin the angle of elliptic arc in the degree (here I used 0)
  • Andangle â ???? End the angle of oval arc in the degree. (Here I used the -180)

    If you get the above data for both the curve, then you can draw just like thickness = cv_fild,

    1. Make the largest oval with the first color = 255.
    2. Now create the second oval with color = 0.

      See an example,

        mat source (480,640, cv_8 UC3, scalar (0,0,0)); Oval (source, point (SRCCL / 2, SRCR / 2), size (SRCCL / 2, SRCRO / 2), 0, 0, -180, scalar (0,0,255), -1, 8, 0); Oval (source, point (SRC cols / 2, src.rows / 2), size (src.cols / 4, src.rows / 4), 0, 0, -180, scalar (0,0,0) -1,8, 0);   

      Enter image details here

      < Strong> Drag it onto a single channel image, if you want to use it as a mask.

      Edit: -

      to find area

      then use to get white pixel count .

Comments

Popular posts from this blog

Pass DB Connection parameters to a Kettle a.k.a PDI table Input step dynamically from Excel -

multithreading - PhantomJS-Node in a for Loop -

c++ - MATLAB .m file to .mex file using Matlab Compiler -