OpenCV Python Tutorial For Beginners 13 - Object Detection and Object Tracking Using HSV Color Space

แชร์
ฝัง
  • เผยแพร่เมื่อ 26 ธ.ค. 2024

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

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

    Your videos are incredible, I have been watching them all day, as I've been working on a CV project and this has been so helpful! You have done such a brilliant job

  • @christopherwestcott3685
    @christopherwestcott3685 5 ปีที่แล้ว +16

    These videos have gotten me up and running quickly with OpenCV. Thank you!!

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

    i felt like the first days that i enjoyed learning how to code. thank you💛

  • @rebekahhumphreys8081
    @rebekahhumphreys8081 5 ปีที่แล้ว +27

    Hi, this video and series really helped me with a project that made my robot track and move towards a pink blob or shape. You are an amazing teacher because before this tutorial I did not know anything about OpenCV and with your help I made something super cool happen so thank you :)

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

      how did you automate it?

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

      @@CrypticFate5 U can implement a python program in Raspberry pi with a camera connected, it's a small computer that runs Linux where u can use its GPIO pins for various peripherals such as motors and sensors.

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

      you probably dont give a damn but does anybody know of a way to get back into an Instagram account..?
      I was stupid lost the account password. I love any tips you can give me!

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

      @Keaton Hezekiah instablaster ;)

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

      @Wyatt Easton thanks for your reply. I found the site thru google and Im in the hacking process atm.
      Looks like it's gonna take a while so I will reply here later with my results.

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

    l_b = np.array([102,165,183])
    u_b = np.array([139,255,255])
    Values that i found to the blue balls.
    Thanks for the videos!

    • @HM-cw8im
      @HM-cw8im 4 ปีที่แล้ว

      Could you please give the values for the red color?

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

    wow, this is actually the first time i've seen these really handy integrated highgui trackbar features. that's super handy for my image processing prototyping!

  • @atharvapatil9763
    @atharvapatil9763 3 ปีที่แล้ว +2

    A more visible lower and upper bound for blue color detection is :
    l_b = np.array([95, 116, 50])
    u_b = np.array([130, 255, 255])

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

    This was my first time to work with OpenCV. Thank you so much.

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

    This is great! I can really use this method for a project I’m working on right now. Thank you!

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

    Simply amazing, I am newby about opencv, nevertheless, the exemples managed on these video series are clear as crystal water. In a whole day, i feel as confident I can begin to handle a simple test by my own. Thanks so much

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

    your videos are amazing. Thanku for such content and effort.

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

    i learn a lot from you , thanks for all the work that you done

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

    Love the way you produce python.

  • @fun-ih5sc
    @fun-ih5sc 4 ปีที่แล้ว +2

    Sir/Anyone
    How cv2.inrange function is working could you please explain a bit.
    And 9:23 line no: 19 , why taking same image frame two times.
    Thank you in advance

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

      if you got the answer then please tell me also

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

      @@abdultaufiq2237 @Abdul Taufiq what is happening here is.. "mask=cv2.inrange(image,LB,UB)"
      It will give you a kind of filter.
      Means when you use "mask" on any image(line no 19 ) then any "pixel" of that image is whose value is in between "LB and UB" will be set to 255(white) otherwise it will be 0(black).

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

    great work and nice explanation

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

    well explained...and executed...

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

    Bravo... many thanks for amazing tutorials ..

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

    Very helpful play list and especially i loved this video :)

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

    you r doing great. Thanks

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

    very useful

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

    Brilliant 🙏🏻

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

    Yogesh is back!

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

    I loved this video. Thank you very much!

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

    Why do we need two same source as frame

  • @ridael-mehdawe4681
    @ridael-mehdawe4681 4 ปีที่แล้ว

    so informative lesson, appreciated

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

    Amazing sir!!!

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

    ur awesome sir

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

    thanks for this level tutorial sir but can you tell me how it is diffferen from the object detection with tensorflow api ?

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

    great one. please we need a practical video on fruits detection. thank you

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

      just add the picture of the fruit with the same code and match its color

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

    Teacher, first congratulations for the channel. I need your help, I have a simple image with a range of 5 placements where the quantity is identified, how do I identify the biggest color type red and say where the X,Y is, and if you can help me, and only for create an alert?

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

    informative video thank u. i had problem i want to extract lower and upper indices for an object, if there is any method to applicate ??

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

    Great work
    !
    thank you
    please when will be the next video

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

    good

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

    can you use the camera to detect the objects color values in HSV or BGR, then use these values along with the track-bar to fine tune the result? thank you great video...:)

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

    What can be done so that it does not detect another blue color. I am building an autonomous vehicle and performing color tracking. What can be done to prevent the vehicle from heading towards another object of the same color?

  • @manpreetsingh4084
    @manpreetsingh4084 6 หลายเดือนก่อน

    Cant we use RGB directly here ?

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

    I wrote the exact same code for the smarties example but its not dynamically changing the color, when i slide the track bar.

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

      my code is also not working ..if u know the solution please let me know

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

      @@surbhiagrawal3951 me too

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

      use cv2.waitKey(1) : tracker will work :)

    • @HM-cw8im
      @HM-cw8im 4 ปีที่แล้ว

      @@deepak223098 Thank you for this :D

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

    that's a great tutorial. thanks a lot. but isn't the maximum value for hue should be 179?

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

    thanks for the content!

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

    Hello, Great video! Can this method be used to track a small black object (7.5cm radius) over a white background going at 75mph(33.5m/s) over a 10 meter frame length captured by the camera? Do you think it would be able to track such a fast small object?

  • @NguyenNhan-yg4cb
    @NguyenNhan-yg4cb 4 ปีที่แล้ว +1

    hey bro, how do you know the blue color is 82 51 51 133, please explain to me. Thank you very much

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

    My trackbar doesn't show the values automatically like in the video. Also the sequence these bars appear in the window is not the same as that in program. That is not the case in this video. The code is exactly the same. Is it because of version difference of opencv? I'm at version 4.2.0

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

      I am also facing the same issue . If you have came up with the solution please help

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

      Please change the ouput screen's name and set it to your current project name/slide name

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

    Hi, Thanks for posting this OpenCV videos. Here I have a doubt why should we use hsv image to mask, why can't we do same on normal bgr (original) image. is there any disadvantage. I wrote same code to mask on original bgr image and working fine (I used same image example you have used). Do we get any problem when I use some other image which has more different colours. Please reply.

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

    how can I add a counter with this so that I can count the number of objects I detection ?

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

    Hi, at first, thank you so much for the video.
    I have a little question. I've trying to track white objects.
    I had tried to use the follow parameters = l_w = ([240,240,240]) , u_w = ([255,255,255)].
    I was not successful. Can you help me with the parameters? What are the best one to detect white objects?
    Thank you!

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

    Thanks bro.,...

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

    How do I do face detection using open cv with mp4 vids?

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

    what program is he using

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

    I want to detect a black color material placed on another black color material....Is this possible?? Do I have to do edge detection in this case??could you explain how??

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

    How would you use this and then have the camera only look at a specific location and tag it when it sees the color you are looking for. I want to put a box on the screen and then whenever the color flys by it I want to have a counter tick off and have that go continuously.

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

    Everything is working very fine and smoothly when I am working on Pycharm, but for some reason I had to switch over to Google Colab and when i ran cv2.namedWindow("Tracking") this is what i got "Your session crashed after requesting an X window. The X Window System is not available in Colab." Any suggestions would ,mean a lot ..Thanks

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

    how do i find the upper and lower hsv values for a specific color??

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

    *thanks*

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

    Why did you read the image every iteration, Is this like, not good for your hard drive ?

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

    Great tutorial
    how can you draw rectangle around the object?

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

    why to convert BGR to HSV color space ?

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

    Output is being displayed, no error, but still tracebar unable to detect color. Can anyone please help me with this?

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

    Wow, it was a excelent video. I'm going to follow your videos. I have a beginner question: how python IDE are you using?? Thank you.

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

    nice work. I try to detect blue circle from real-time webcam and mark circle border on that blue target, I want to develop this in javascript and opencv.js, but HoughCircles not working for videos but it is working on an image, please guide we with this any example.

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

    is it possible to compare the brightness/whiteness of an object in an image(white object with green background) Thank you in advance 😀 I really really need your help.

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

    Hi, our school lab is trying to develop a simple tool to help our vision impair students to recognize the color from testing results. Can you help us? Thx!

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

    if you go to a line you want to copy just Ctrl + D and it duplicates it , pycharms its wicked for linux ;)

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

      Stop programming and start looking for a wife Ted!

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

    why are my hsv upper and lower points aree different ?
    in this video, for blue colour l_b = (110,50,50) and u_b =(130,255,255)
    while i tried, for blue colour l_b= (0,114,0) and u_b = (21,223,255)
    can anyone explain this?

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

    whenever i try to capture video it is giving this error.What to do ??pls help me
    [ WARN:0] global C:\projects\opencv-python\opencv\modules\videoio\src\cap_msmf.cpp (681) CvCapture_MSMF::initStream Failed to set mediaType (stream 0, (640x480 @ 30) MFVideoFormat_RGB24(unsupported media type)

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

    May I know what bitwise_and doing here with the mask?

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

      mask has range values for type of blue he is trying to detect, he and those values with the output from his video capture to only display the blue object

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

    what does line 5 mean?

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

    hi there.. every time i run the program and capture a video from the camera the video stops unless i keep pressing the space or the enter button to keep the video capturing ..anyone here knows the problem ?

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

      In waitkey put 0 between the brackets like this : (0)

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

    i flunked my project because of wrong hsv. i couldnt get the hsv ranges right :(.

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

    Why my tracker system does not change colour

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

      Same problem bro

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

      Please change the ouput screen's name and set it to your current project name/slide name

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

    If your tracker does not work, check if you pass anything inside cv2.waitKey(). (It strange, i know.....)

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

      LOL thx i had that problem

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

      Thanks i had the same problem 🙌 but bro why it's not showing when I'm putting zero in brackets instead of 1

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

      @@syedufaqhaider2796 hey , i alo earlier write (0) ..after i changed to 1 ..its working ..any explanation for this

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

    well actually its funny because i have used this code from so before i watched this

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

    I am getting this error (line 14, in
    hsv = cv2.cvtColor(frame, cv2.COLOR_BGR2HSV) # convert color to HSV
    cv2.error: OpenCV(4.1.1) C:\projects\opencv-python\opencv\modules\imgproc\src\color.cpp:182: error: (-215:Assertion failed) !_src.empty() in function 'cv::cvtColor'
    any help guys I tried fixing it

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

      Check is your image name is right

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

    17:39 little sussy

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

    i think hue is between 0-180 in opencv-python

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

      but ists np when u set 0-255, just talk about details

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

    This code does not work for me.

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

      Me too .. if you have solutions please help

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

      @@smritipradhan6921 type 1 in waitkey

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

    How S & V value become greater than 100

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

    Why we are using ' _, ' in the following line
    " _, frame = cap.read() "

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

      Because we don't need that value. If you need it, then just put a variable
      return, frame = cap.read()

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

      it's just a bool value, which we don't rlly care about.

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

    wow that's perfect body

  • @AbhishekPandey-rl8vz
    @AbhishekPandey-rl8vz 5 ปีที่แล้ว

    I'm getting a
    TypeError: Expected Ptr for argument '%s'
    --> res= cv.bitwise_and(frame,frame,mask=mask)
    Pls resolve it

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

    Only good thing is the English accent 😁😅🤡

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

    Why my tracking window is not showing up