Find and Draw Contours - OpenCV 3.4 with python 3 Tutorial 19

แชร์
ฝัง
  • เผยแพร่เมื่อ 15 ก.ย. 2024
  • We’re going to see in this tutorial how to find and draw the contours.
    Contours are simply the boundaries of an object.
    Tutorial and source code: pysource.com/20...
    ➤ Full Videocourses:
    Object Detection: pysource.com/o...
    ➤ Follow me on:
    Instagram: / pysource7
    LinkedIn: / pysource
    ➤ For business inquiries:
    pysource.com/c...

ความคิดเห็น • 93

  • @pysource-com
    @pysource-com  2 ปีที่แล้ว +1

    ►► You can Build a Computer Vision software to DETECT and TRACK any Object.
    → 4-Step FREE Workshop pysource.com/blueprint-workshop-signup/

  • @sercanalnca1962
    @sercanalnca1962 2 ปีที่แล้ว

    Meeeeen , i don’t know how many time say to thank you soo muuucchh. I am beginner for computer vision in Python. In this tutorial you teach me too much think. I am very very happy because i have some project idea in my mind.

  • @aqibkhan5091
    @aqibkhan5091 5 ปีที่แล้ว +1

    Lots of love from India ..your channel made things much easier for me..please add some more advance projects on open CV

  • @inigoelias5690
    @inigoelias5690 2 ปีที่แล้ว

    Excellent brother, this is so useful and fascinating. Greetings from Mexico.

  • @apachon
    @apachon 6 ปีที่แล้ว +1

    Thanks for this video.i just started learning open cv , and this is helping a lot to understand how it works .

  • @yangyong6245
    @yangyong6245 4 ปีที่แล้ว +1

    Good video!!, I learned a lot of knowledge about Contour detect.

  • @peenchinggyu6024
    @peenchinggyu6024 6 ปีที่แล้ว

    thank you.. ive tried it at opencv2 and python2.7 and it works too

  • @4bart4ley4
    @4bart4ley4 5 ปีที่แล้ว

    Thank you man! your so helpful! hope your channel continue to grow! subscribed and liked!

  • @dasamantharaorohit2866
    @dasamantharaorohit2866 6 ปีที่แล้ว +1

    awesome one bro looking for the tutorial for box shaped detection which you talked at last :) (Nice Work)

  • @saeedAhmed-ck3ot
    @saeedAhmed-ck3ot 6 ปีที่แล้ว +1

    You really helped me, I learned a lot,
    thank you.

  • @bhimsendabby
    @bhimsendabby 6 ปีที่แล้ว

    Firstly I totally confused about contour but sir you really helped me so thanku sir

  • @Siqiuuu
    @Siqiuuu 11 หลายเดือนก่อน

    great video!😁😁😁

  • @ertancakr9432
    @ertancakr9432 5 ปีที่แล้ว

    Thank you, This video helped me so much for my project.

  • @maulanamahmuddin5826
    @maulanamahmuddin5826 4 ปีที่แล้ว +2

    hi i have a problem in cv2.drawContours(frame, contours, -1, (0, 255, 0), 3)
    problem: error: (-215:Assertion failed) npoints > 0 in function 'drawContours'
    Can someone help me

  • @zahrahaghgu6115
    @zahrahaghgu6115 5 ปีที่แล้ว

    Thank you so much for this practical video

  • @PFstoker
    @PFstoker 4 ปีที่แล้ว

    Thank you very much ! Simple and clear 😁

  • @jorgeivanavaloslopez2206
    @jorgeivanavaloslopez2206 3 ปีที่แล้ว

    it is more efficient to take the perimeter than the area.
    code:
    for contour in contours:
    perimeter = contour.shape[0] # We get the perimeter of each contour
    if perimeter > 100:
    cv2.drawContours(frame, contour, -1, (0,255,0), 3)

  • @luqmansen
    @luqmansen 5 ปีที่แล้ว

    Great explanation, great video, thanks a lot !

  • @avachavoshi574
    @avachavoshi574 4 ปีที่แล้ว

    Very helpful, Thank you very much!

  • @chetancc
    @chetancc 3 ปีที่แล้ว

    Hi Sergio, thanks for sharing in depth knowledge. I have been following your videos since long time. Can you please let me know how can we blur this object in such way that its not clearly visible after detecting in video?

  • @brunofranco3421
    @brunofranco3421 3 ปีที่แล้ว

    Great work!

  • @minhtiennguyen4870
    @minhtiennguyen4870 6 ปีที่แล้ว

    your video is great, thank you so much ...

  • @huracan311
    @huracan311 4 ปีที่แล้ว

    many thanks i'ts perfect for my project

  • @erfanebrahimi9748
    @erfanebrahimi9748 3 ปีที่แล้ว

    great tutorial, thank you.

  • @brunofranco3421
    @brunofranco3421 ปีที่แล้ว

    2023 update:
    you should change it to:
    contours,hierachy=cv2.findContours(thresh,cv2.RETR_TREE,cv2.CHAIN_APPROX_SIMPLE)

  • @user-lk5lj6vm7o
    @user-lk5lj6vm7o ปีที่แล้ว

    thank you

  • @solehahnur1823
    @solehahnur1823 5 ปีที่แล้ว +1

    Sir,can you help me on how to get the centre coordinate of the contour

  • @TalesCembraneliDantas
    @TalesCembraneliDantas 6 ปีที่แล้ว

    Tks again for the class...

  • @aniketninawe1228
    @aniketninawe1228 3 ปีที่แล้ว

    awesome

  • @mahmou6
    @mahmou6 4 ปีที่แล้ว

    12:00 draw contour's if-statement if area is larger or smaller a certain value. (self-note)

  • @kirangouds
    @kirangouds 6 ปีที่แล้ว

    this is really great video thank you, make more videos

  • @HenriqueKomoto
    @HenriqueKomoto 5 ปีที่แล้ว

    Thank you! Nice video.

  • @PranavArrora
    @PranavArrora 5 ปีที่แล้ว

    Hi , Thanks for such lucid explanation . I have a question , if we can find a center(centroid) using Moments in an image , how can we calculate the end points (width and height) in the direction of the centroid WITHOUT using minboundRect

  • @Nico9538
    @Nico9538 5 ปีที่แล้ว

    this video really helped

  • @juandavidbarrerol1510
    @juandavidbarrerol1510 5 ปีที่แล้ว

    Great video, I have a question, is there a way to count how many objects are a in the video ?

  • @venkatasubramaniamr6982
    @venkatasubramaniamr6982 3 ปีที่แล้ว

    Hi How to identify the lower and upper value for specific color... is there any logic

  • @yangyong6245
    @yangyong6245 4 ปีที่แล้ว

    Dear, I have one question. Please tell me about the way to set lower and Upper value.

  • @karimkohel3240
    @karimkohel3240 4 ปีที่แล้ว

    dude you're awesome

  • @ujwalkaka
    @ujwalkaka 6 ปีที่แล้ว

    great work. Could u make a tutorial on how to find the tail length of vehicles in a video? really been struggling with this problem

    • @ujwalkaka
      @ujwalkaka 6 ปีที่แล้ว

      *length from a starting point

    • @pysource-com
      @pysource-com  6 ปีที่แล้ว

      I might do that in the future, but still I have a lot of other material to release before that :)

  • @AriBernsteinM
    @AriBernsteinM 5 ปีที่แล้ว

    Thanks, this was super helpful but why use HSV? I had trouble making my contours work using HSV but no trouble just using RGB

  • @firefoxyouth
    @firefoxyouth 5 ปีที่แล้ว

    je suis le 3700 abonnement.. You should have more :)

  • @arzooranipa1807
    @arzooranipa1807 5 ปีที่แล้ว +2

    _ , cnts , _ = cv2.findContours(mask, cv2.RETR_TREE, cv2.CHAIN_APPROX_NONE)
    ValueError: not enough values to unpack (expected 3, got 2)
    please help me to solve this error

    • @ismet1574
      @ismet1574 5 ปีที่แล้ว

      Could you find that error's solution?

    • @bassambenidir1729
      @bassambenidir1729 4 ปีที่แล้ว +1

      by doing this it should work
      contours, hierarchy = cv2.findContours(mask, cv2.RETR_TREE, cv2.CHAIN_APPROX_NONE)

    • @RafiKhalil
      @RafiKhalil 3 ปีที่แล้ว

      @@bassambenidir1729 Thanks brother.

  • @matters8535
    @matters8535 3 ปีที่แล้ว +1

    I love you

  • @CarstenMeyer
    @CarstenMeyer 5 ปีที่แล้ว

    Is there an easy way to compare shapes with matchShapes() but scale variant? To distinguish between objects with the same shape but different size.

  • @subhranilagasti6604
    @subhranilagasti6604 4 ปีที่แล้ว

    I want to find the following features -(area, centroid, orientation)of an object using open cv . Please help

  • @nlimbu2520
    @nlimbu2520 5 ปีที่แล้ว

    Thank you.

  • @seyedalihejazi4926
    @seyedalihejazi4926 5 ปีที่แล้ว

    hi can you do a video about noise reduction and its technniches.

  • @harshiths4270
    @harshiths4270 5 ปีที่แล้ว

    Could you elaborate on what are lower and upper blue?

  • @soufien7354
    @soufien7354 3 ปีที่แล้ว

    why this error
    TypeError: Expected Ptr for argument 'contours'
    how i solve it ?

  • @beastmonster1141
    @beastmonster1141 5 ปีที่แล้ว

    Great video! How can I localize contours for only rectangular shaped objects (license plate)?

    • @pysource-com
      @pysource-com  5 ปีที่แล้ว

      check one of my latest video is about shape detection, you'll find the answer you're looking for.

  • @erfanebrahimi9748
    @erfanebrahimi9748 3 ปีที่แล้ว

    Does anyone how to apply a trained classifier to detected objects with active contour? Like a applying a classifier to detect the color of detected object.

  • @AmitKumar-yq3lx
    @AmitKumar-yq3lx 5 ปีที่แล้ว

    you are awesome

  • @matheobermudez7847
    @matheobermudez7847 4 ปีที่แล้ว

    good video! thanks. I got a question, how did you calculate the upper and lower blue values, because you said it just worked for you? thank you again.

    • @pysource-com
      @pysource-com  4 ปีที่แล้ว

      Hi Matheo, I have another video tutorial where I explain that.
      Look on my channel for "HSV colorspaces"

    • @matheobermudez7847
      @matheobermudez7847 4 ปีที่แล้ว

      @@pysource-com ok thank you!

  • @rz1359
    @rz1359 5 ปีที่แล้ว

    Thanks

  • @jeevanshrestha8888
    @jeevanshrestha8888 5 ปีที่แล้ว

    i want to know the position of that object.......any video.....

  • @MrDiegoaz3
    @MrDiegoaz3 6 ปีที่แล้ว

    Hello! Good tutorial! How can I track X and Y in order to determinate the direction?

    • @pysource-com
      @pysource-com  6 ปีที่แล้ว

      Hi Diego,
      still it's not possible to determinate direction of the object from just this source code.
      Be aware that we're only working frame by frame, with images, there is no connection between them.
      what you asked it's a bit more advanced, please wait a bit and I'm going to do a video about that as well.

  • @SAMETELMACI
    @SAMETELMACI 3 ปีที่แล้ว

    ı want a draw rectangle of detected object how can ı

  • @egemenokur2807
    @egemenokur2807 5 ปีที่แล้ว

    hank you soooo much

  • @silaskierstein4411
    @silaskierstein4411 2 ปีที่แล้ว

    So fucking cool brah

  • @aimanfariz7642
    @aimanfariz7642 2 ปีที่แล้ว

    I followed exactly this video, and I got an error:
    not enough values to unpack (expected 3, got 2), can you help?

    • @pysource-com
      @pysource-com  2 ปีที่แล้ว

      you need to change the in the line where there is:
      _, contours, _ = ...
      with:
      contours, _ = ...
      as with newste version of Opencv 4.x it extracts only two values instead of three.

  • @maumunguia6384
    @maumunguia6384 5 ปีที่แล้ว

    How I can do this with images instead of video?
    I need to get the countors of an image and then get all the points of the countors
    BTW excellent video

  • @bru6626
    @bru6626 5 ปีที่แล้ว +1

    why cv2.findcontours is not working for me
    man Im stressing now

  • @abdulkerimshobbytips6817
    @abdulkerimshobbytips6817 3 ปีที่แล้ว

    hello sir while i try to generate a controur i get this error "_, contours, _ = cv2.findContours(red_mask, cv2.RETR_TREE, cv2.CHAIN_APPROX_SIMPLE)
    ValueError: not enough values to unpack (expected 3, got 2)" can you help me please ?

  • @username_6948
    @username_6948 5 ปีที่แล้ว

    tysm

  • @ivancol5576
    @ivancol5576 6 ปีที่แล้ว

    How can I do this on Android ?

    • @pysource-com
      @pysource-com  6 ปีที่แล้ว

      unfortunately I can't help you as I'm not familiar with Opencv for android.
      you can check docs here opencv.org/platforms/android/

  • @rusich.450
    @rusich.450 5 ปีที่แล้ว

    zero dislikes lol

  • @mahmouds12
    @mahmouds12 3 ปีที่แล้ว

    Thank you