Edge Detection and OpenCv

Fortunately, one of the examples in the OpenCV Python set is a program named edge.py. The following is that file (with blank lines removed):

Edge Detection and OpenCv

This program uses the Canny image detection algorithm implemented by OpenCV to find the edges in any image. For more on the Canny edge algorithm, refer to http://dasl.mem.drexel.edu/alumni/bGreen/www.pages.drexel.edu/_weg22/can_tut.html or http://opencv-python-tutroals.readthedocs.org/en/latest/py_tutorials/py_imgproc/py_canny/py_canny.html. You captured an image earlier; you can use this program to look at the edges and to also see how setting a different threshold can show more/less edges. Run the program with the image captured earlier and you will see the following:

Edge Detection and OpenCv

You will notice that there is a threshold slide bar setting at the top. If you adjust this threshold up, it will find fewer edges—the edges that have a larger threshold. The picture for a setting of 30 is as follows:

Edge Detection and OpenCv

Now you can see how this process could be translated to an image of a blank floor and a barrier. The following is such an image with a possible barrier:

Edge Detection and OpenCv

You can calibrate the distance to the object based on the pixels and the position of the camera.

..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset
3.16.15.149