Note that there are some explanatory texts on larger screens.

plurals
  1. POExtending a contour in OpenCv
    primarykey
    data
    text
    <p>i have several contours that consist of several black regions in my image. Directly adjacent to these black regions are some brighter regions that do not belong to my contours. I want to add these brighter regions to my black region and therefor extend my contour in OpenCv.<br> Is there a convenient way to extend a contour? I thought about looking at intensity change from my gradient-image created with <code>cv::Sobel</code> and extend until the gradient changes again, meaning the intensity of pixel is going back to the neither black nor bright regions of the image. </p> <p>Thanks!</p> <p>Here are example images. The first picture shows the raw Image, the second the extracted Contour using Canny &amp; findContours, the last one the Sobel-Gradient intensity Image of the same area. I want to include the bright boundaries in the first image to the Contour.</p> <p><img src="https://i.stack.imgur.com/QmApm.png" alt="enter image description here"> <img src="https://i.stack.imgur.com/UfDdd.png" alt="enter image description here"> <img src="https://i.stack.imgur.com/KOVr9.png" alt="enter image description here"></p> <p>Update: Now i've used some morphological operations on the Sobelgradients and added a contour around them (see Image below). Next step could be to find the adjacent pair of purple &amp; red contours, but it seems very much like a waste of procession time to actually have to search for directly adjacent contours. Any better ideas?</p> <p><img src="https://i.stack.imgur.com/PN69J.png" alt="enter image description here"></p> <p>Update 2: My solution for now is to search for morphed gradient (red) contours in a bounding box around my (purple) contours and pick the one with correct orientation &amp; size. This works for gradient contours where the morphological operation closes the "rise" and "fall" gradient areas like in Figure 3. But it is still a bad solution for cases in which the lighted area is wider then in the image above. Any idea is still very much appreciated, thanks!</p>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload