Ask Your Question

Rad's profile - activity

2020-11-14 07:15:38 -0600 received badge  Popular Question (source)
2020-10-28 01:02:01 -0600 received badge  Notable Question (source)
2020-10-28 01:02:01 -0600 received badge  Popular Question (source)
2017-08-25 13:58:09 -0600 received badge  Student (source)
2016-04-28 01:55:22 -0600 commented question Clicking on a point in an image finds the closest contour points

I don't have c++ environment to check, but based on the logic and provide picture it is sufficient. I didn't see if you discovered contour points used to draw the contour and what parameter regulates the number of them. Let me know if I missed it. Tx.

2016-04-28 01:52:21 -0600 received badge  Scholar (source)
2016-04-26 02:17:36 -0600 received badge  Enthusiast
2016-04-24 14:55:38 -0600 commented answer Clicking on a point in an image finds the closest contour points

Great @Balaji R. I will check this solution and let you know if I can replicate this in c#.net

2016-04-22 13:02:24 -0600 commented question Clicking on a point in an image finds the closest contour points

@LorenaGdL I added my current code. The language used is not important. I need some concrete steps.Tx.

2016-04-22 12:52:33 -0600 commented question Clicking on a point in an image finds the closest contour points

@LorenaGdL I tried something (still learning). I will post some code soon. I could find all the inside and outside contour points of all boundary lines. I don't want all of contours, only one the closest. Another problem is that I would like to reduce the thickness to only 1 pixel so both inside and outside boundaries should meet. If somebody helps me he/she can be paid for this.

2016-04-21 00:24:35 -0600 received badge  Editor (source)
2016-04-21 00:24:07 -0600 asked a question Clicking on a point in an image finds the closest contour points

Update: As suggested. I added my current code that detects all boundaries of each shape (not desired) with another problem that these boundary lines can be a few pixels wide and form inside and outside countour to be recognized

Let say I click on a point inside wanted3 shape/contour (see second image). I would use C#.net OpenCV 2 and/or 3

One Note. The lines denoting shapes can be one or more pixel wide. I would like the recognized points to lay exactly in the middle of that line, so when I do another recognition of surrounding shape I will get an exact point for that shared line recognized in 2 contours

image description

I want the closest contour recognized, that encompasses the pressed point with a mouse left click within it. There can however be a larger encompassing contour (not shown here; think of it as a county encompassing cities/places), and I just want the closest one recognized.

image description

Whan I press inside wanted2 shape I want South-East border to have exactly the same discoverer contour points as wanted3 no matter how thick the bordering line is (so some calculation of where the middle point is necessaryl Thanks Rad

    Sub ProcessImageAndUpdateGUI(sender As Object, arg As EventArgs)
    Try
        If (rdoImageFile.Checked = True) Then                                                                       'if the image file radio button is chosen . . .
            Try
                imgOriginal = New Image(Of Bgr, Byte)(txtFile.Text)                                     'get original image from file name in text box
            Catch ex As Exception
                Return
            End Try
        ElseIf (rdoWebcam.Checked = True) Then                                                                  'else if the webcam radio button is chosen . . .
            Try
                imgOriginal = capWebcam.QueryFrame()                                                                    'get next frame from webcam
            Catch ex As Exception
                Return
            End Try
        Else
            'should never get here
        End If

        If (imgOriginal Is Nothing) Then                                        'if imgOriginal is null
            Return                                                                                  'bail
        End If
        'perform image smoothing
        imgSmoothed = imgOriginal.PyrDown().PyrUp()                                     'Gaussian pyramid decomposition
        imgSmoothed._SmoothGaussian(3)                                                              'Gaussian smooth, argument is size of filter window

        If (ckFilterOnColor.Checked = True) Then                                                                'if filter on color check box is checked, then filter on color
            imgGrayColorFiltered = imgSmoothed.InRange(New Bgr(dblMinBlue, dblMinGreen, dblMinRed), New Bgr(dblMaxBlue, dblMaxGreen, dblMaxRed))
            imgGrayColorFiltered = imgGrayColorFiltered.PyrDown().PyrUp()                       'repeat smoothing process after InRange function call,
            imgGrayColorFiltered._SmoothGaussian(3)                                                                 'seems to work out better this way
        ElseIf (ckFilterOnColor.Checked = False) Then                                                   'if filter on color is not checked,
            imgGrayColorFiltered = imgSmoothed.Convert(Of Gray, Byte)()                 'then convert to gray without filtering
        End If

        'Dim grayCannyThreshold As Gray = New Gray(160)                                 'first Canny threshold, used for both circle detection, and line / triangle / rectangle detection
        'Dim grayCannyThreshold As Gray = New Gray(200)                                 'first Canny threshold, used for both circle detection, and line / triangle / rectangle detection
        Dim grayCannyThreshold As Gray = New Gray(240)                                  'first Canny threshold, used for both circle detection, and line / triangle / rectangle detection
        Dim grayCircleAccumThreshold As Gray = New Gray(100)                        'second Canny threshold for circle detection, higher number = more selective
        Dim grayThreshLinking As Gray = New Gray(80)                                        'second Canny threshold for line / triangle / rectangle detection

        'imgCanny = imgGrayColorFiltered.Canny(grayCannyThreshold, grayThreshLinking)                   'Canny image used for line, triangle, rectangle, and polygon ...
(more)
2016-01-19 02:43:57 -0600 asked a question OpenCV/Emgu.CV: Finding contour point coordinates of a filled polygon using C#.net

I started from EMGU Example (Emgu.CV v2.4.10.1939): http://www.emgu.com/wiki/index.php/Co...

Instead of comparing previous video frame and the next one I am dealing with a screen capture of the primary screen at time1 and another screen capture at time2. Second screen capture brings a minimal difference, especially in one part of the captured image and that is: an outline (closed polygon of n vertices). I applied ThresholdBinary method and this code:

Contour<point> currentContour = contours.ApproxPoly(contours.Perimeter * 0.05, storage); to get the shape of the difference (which for me is a white polygon)

I then cropped that polygon to avoid processing unnecessary parts of the image. image description

the attached images on the right I tried to depict what I want and don't want based on processing left input image. I want to find x,y coordinates (in pixels) of all intersections of vertices of the polygon for the cropped image.

When I would later redraw the polygon I would expect to as close match as possible to this input polygon. I would like to have a reasonable number of straight lines detected so the final shape faithfully resembles input shape on the left.