OpenCV Python Tutorial For Beginners 25 - Detect Simple Geometric Shapes using OpenCV in Python

preview_player
Показать описание
In this video on OpenCV Python Tutorial For Beginners, I am going to show How to Detect Simple Geometric Shapes using OpenCV in Python.

The function retrieves contours from the binary image. The contours are a useful tool for shape analysis and object detection and recognition.

OpenCV is an image processing library created by Intel and later supported by Willow Garage and now maintained by Itseez. opencv is available on Mac, Windows, Linux. Works in C, C++, and Python.
it is Open Source and free. opencv is easy to use and install.

Starting with an overview of what the course will be covering, we move on to discussing morphological operations and practically learn how they work on images. We will then learn contrast enhancement using equalization and contrast limiting. Finally we will learn 3 methods to subtract the background from the video and implement them using OpenCV.

At the end of this course, you will have a firm grasp of Computer Vision techniques using OpenCV libraries. This course will be your gateway to the world of data science.

Feel the real power of Python and programming! The course offers you a unique approach of learning how to code by solving real world problems.

#ProgrammingKnowledge #ComputerVision #OpenCV
★★★Top Online Courses From ProgrammingKnowledge ★★★

★★★ Online Courses to learn ★★★

★★★ Follow ★★★

DISCLAIMER: This video and description contains affiliate links, which means that if you click on one of the product links, I’ll receive a small commission. This help support the channel and allows us to continue to make videos like this. Thank you for the support!
Рекомендации по теме
Комментарии
Автор

For anyone wondering: the parameter epsilon in the method approxPolyDP represents the maximum distance between the shape and the approximation. If epsilon = 0 then the approximation will be really precise. But the bigger epsilon gets, the further you allow your approximation to be less rigorous, and an epsilon that's too big will simply not detect shapes properly.

Trying the code as it is in the video on some random shapes image I found on google, I get that 0.01*cv2.arcLength(contour, closed=True) is actually an approximation that's "too good" (as in it'll try and draw more than 3 edges on a triangle). I put epsilon = 3 and it seems to do the job fine. Depending on what you're coding and how precisely you want to detect, play around with the epsilon value.

TheNightFox
Автор

You're awesome. Your Github Gist works

BipinJethwani
Автор

great. Thank you for this video.It helped me a lot.

TrungNguyen-tmfd
Автор

Can you help me with the "trackbar" to find the threshold values?

parthasaha
Автор

Hi guys I was just wondering if I could use this code for nuts shape classification and detection?
any help is appreciated.

gurakashsidhu
Автор

If with the above problem, I want to identify parallelogram, what should I do? Looking forward to your support. Thank!

lewlew
Автор

hi thanks for the tutorial
can you tell us how we can do it in real time ? not just for an image, and thank you

abdeldjalilettaharboucetta
Автор

Will this python program work in real time geometric shapes detection.??

JalalKhan-weth
Автор

How to get there x, y coordinates values

memonaijaz
Автор

Hello. Can you please tell how can we detect the same in live video.

saipatil
Автор

sir what is the aspect ratio for rectangle because i want do for trapozoids also...!

tcusepw
Автор

where do I find the shapes.jpg file? I could not find it in OpenCV github

chapaalejandro
Автор

where could I download the shapes.jpg for testing? Thanks a lot

xueyuanye
Автор

do you have a live version of this which can detect from webcam, please

henokadisumebratu
Автор

We can also use
width == height instead of using aspect ratio, it will work as same as the ratio and it is simple to understand. (If w == h: "square")

Its-Not-Funny
Автор

what if the object is a vehicle or plant? we can definitely identify them but how can we name it? like we used 3 sides for triangle and so on. What can be the logic to name car and say cactus?

surajveertalreja
Автор

I can't find the shapes image. Help?

sethwhite
Автор

I'm getting error in line 5 .. Should I need to save the 'shapes.jpg' to a specific path?

shivakumark
Автор

No matter what I try, I get the error - "too many values to unpack (expected 2)" on the countours definition line. I am running directly from the repo and with the downloaded image file noted in comments.

btigenie
Автор

How can i get there x, y coordinates values?

memonaijaz
visit shbcf.ru