OpenCV TUTORIAL with Python Series #1 - Basic Grayscale - 1

Sdílet
Vložit
  • čas přidán 26. 07. 2024
  • A basic introduction on how to use OpenCV with Python
    Guide: kirr.co/o51uoz
    Mac Install guide: kirr.co/uux6ty
    OpenCV Python Mac Install video: • How to Install OpenCV ...
    Windows Install guide: kirr.co/pcbq03
    OpenCV Python Windows Install video: • How to Install OpenCV ...
    Linux install guide using Pi Awesome: kirr.co/sx77b7
    NEW!! Slack Channel: kirr.co/n7xgvn
    -----
    Amazing Starts Small. Learn to build great products with code.
    Enroll: kirr.co/ni5fia or Subscribe: kirr.co/7l2sv4/
    -----
    Questions? kirr.co/wmdnzz/
    Suggestions? kirr.co/5d7m1r/
    All of my step by step projects: kirr.co/ni5fia/
    My equipment:
    Laptop: amzn.to/2c965EL
    4k Camera: amzn.to/2cb0JeS
    Drone/Aerial Video: amzn.to/2cCUgLq
    Flexible/Travel Tripod for DSLR: amzn.to/2d13rXi (I highly recommend this too: amzn.to/2ckauYr)
    General Purpose Tripod: amzn.to/2d4xNUS
    Webcam: amzn.to/2bZEc7I
    Camera Mic: amzn.to/2cb0PTp
    Studio Mic: amzn.to/2cCdNc3
    Mic Arm (for Studio): amzn.to/2cCepyd
    Shock Mount (for Studio): amzn.to/2c97uLN
    Phone: amzn.to/2c97R8X
    Tablet (and portable external monitor) : amzn.to/2c5Fqdx
    External Hard drives: amzn.to/2c5FvxV
    Headphones (mic used for travel recording): amzn.to/2c5GGNO

Komentáře • 103

  • @zyt2712
    @zyt2712 Před rokem

    this is the best teacher regarding the opencv camera feature, thumbs up thanks

  • @nerioamaral4045
    @nerioamaral4045 Před 2 lety

    I really enjoyed this video lad. big thumbs up for me

  • @anthonylanza4936
    @anthonylanza4936 Před 5 lety

    Awesome video. Very simple and clear explanations on every step.

  • @zeel5053
    @zeel5053 Před 5 lety

    Thanks for the tutorials!

  • @harsh-haria
    @harsh-haria Před 5 lety +47

    if the frame opens and then crashes then add this at the bottom of your code:(if is inside the while loop)

    if cv2.waitKey(20) & 0xFF == ord('q'):
    break
    It helped me with the same problem.

  • @ayush612
    @ayush612 Před 5 lety

    Wow awesome Tutorial Sir!!

  • @huyennguyen88
    @huyennguyen88 Před 4 lety +1

    thanks you, awesome video very helpful!

  • @johnpaulm.batusa9534
    @johnpaulm.batusa9534 Před 5 lety

    Hello Sir! New subscriber here :D Hoping to learn a lot from you :D So far so good! More power!

  • @akashchaudhary3309
    @akashchaudhary3309 Před 6 lety

    That's an amazing tutorial. Please make another one.. Love from india

  • @005shivitanwar3
    @005shivitanwar3 Před 4 lety

    I rely enjoyed this one🧡

  • @harshraval3099
    @harshraval3099 Před 6 lety

    Amazing teacher. i wish i could meet you sir !!!

  • @tushant04
    @tushant04 Před 6 lety +15

    open cv with raspberry pi I want to see in very near future :)

  • @0mik3mik3
    @0mik3mik3 Před 4 lety

    Thank you a lot!

  • @cody3509
    @cody3509 Před 5 lety

    thanks man, awesome video very helpful! Also most program videos are dull thanks for not being monotone

  • @shashanksharmadon4295
    @shashanksharmadon4295 Před 4 lety

    awesome......

  • @MrSiciro
    @MrSiciro Před 5 lety

    Wow I keep on coming back to this tutorial. Just a question. How would importing a gstreamer feed work in windows with this method?

  • @fmplan
    @fmplan Před 5 lety

    very nice

  • @shrinithamonica4668
    @shrinithamonica4668 Před 5 lety +1

    can you please upload a video on emotion recognition using facial expressions

  • @nurujjamankhan3332
    @nurujjamankhan3332 Před 3 lety

    Good Brother

  • @debmalyachatterjee377
    @debmalyachatterjee377 Před 3 lety

    And this is going to be my final year project.

  • @ajinzrathod
    @ajinzrathod Před 5 lety

    God Bless u Bro

  • @hanafizahanafi2475
    @hanafizahanafi2475 Před 5 lety

    Hi, do have any tutorials for opencv camera calibration using python?

  • @markomaksimovic6285
    @markomaksimovic6285 Před 6 lety +2

    Goos job great tutorial create another one pls 😃😃😃

  • @prasoonkarmacharya4054
    @prasoonkarmacharya4054 Před 6 lety +6

    Idea: OpenCV and flask integration for remote viewing on a browser

  • @digital_down
    @digital_down Před 5 lety

    What can I include to put all 4 window captures into a single window?

  • @DerickAHo
    @DerickAHo Před 5 lety

    does cv2 contain an averaging method for grayscaling?

  • @shanmukhshanu2411
    @shanmukhshanu2411 Před 5 lety

    thankyou sir it was a wonderful tutorial moreover sir when i run the code its taking too much time to on the camera may i know why is this happening

  • @FelixGB_
    @FelixGB_ Před 5 lety +1

    Hi! I have a question as I cannot understand why this code behave differently on my side.
    Following this basic code, instead of having a continious video feed in the "frame", when I run the python script, the VideoCapture(0) is executed then nothing happen, until I close my webcam.
    When I do close the webcam, I have the frame window opening with the last frame from the video feed, I assume, displayed.
    I do not understand why I do not get a continuously feed ?
    If anyone has some idea / fix, it would be great!
    Thanks alot!

  • @zaidalamarey771
    @zaidalamarey771 Před 5 lety

    best teacher everrrrr>>>>can you make some thin like attendance system that count people

    • @amrinjaffni4268
      @amrinjaffni4268 Před 5 lety

      Maybe you can put a camera, and that camera link to this code...when the camera record a face, it will find if there is any same face in a database, and if there is, then that person attendance is taken

  • @sopwithcamel8696
    @sopwithcamel8696 Před 5 lety +2

    Please make a video on how to setup a virtualenv on mac!!!

  • @puniteshpoojary7214
    @puniteshpoojary7214 Před 5 lety

    In ./Scripts/activate
    What's inside the script folder and where is it

  • @benshapiro2wt298
    @benshapiro2wt298 Před 5 lety

    How do i get my DSLR to work with this????? i have tried everything!! I think you need to set the dslr as a video device but i cant find out how :( i am soooo frustrated with this i literally just want it to capture from my canon

  • @ryan_j9235
    @ryan_j9235 Před 5 lety

    Which ide are you using??

  • @deepghodasara7952
    @deepghodasara7952 Před 5 lety

    ret, frame = cam.read() # what is 'ret' for this line???

  • @RaadYacu
    @RaadYacu Před 6 lety +1

    How about both? Time lapse and Facial Recognition. Great video by the way. I like the line by line

  • @donbaga
    @donbaga Před 2 lety

    what does ret refer to?

  • @cbernier3
    @cbernier3 Před 5 lety +7

    Dude, your playlist is backwards.

  • @sauravraghuvanshi611
    @sauravraghuvanshi611 Před 5 lety

    my frame so error that frame not responding. So please help me.
    i am using jupyter notebook.

  • @SonuRaj-er1hn
    @SonuRaj-er1hn Před 4 lety

    How to make screen sharing with pythons can u make videos on screen sharing with pythons? Please

  • @pnitinvsr2247
    @pnitinvsr2247 Před 5 lety +6

    I am getting an error that my frame(Not Responding).....What shall i do

  • @amrinjaffni4268
    @amrinjaffni4268 Před 5 lety

    Hi, im new to pytyon and also opencv...i have a question,
    ret, frame = cap.read()
    Why does this line takes two variables? And what does that "ret" is for?

    • @zen6767
      @zen6767 Před 5 lety +1

      cap.read() returns two values
      Take this for example
      x, y = 1, 2
      print(x)
      # outputs 1
      print(y)
      # outputs 2
      It cal also be a tuple
      x, y = (1, 2)

  • @yureshkarunanayake5761

    python 2 users may stuck at the mid.ex- not viewing frame . don't get rid.complete the code and then run.

  • @internet_explorer96
    @internet_explorer96 Před 6 lety +6

    Great Tutorial Sir..BTW am stuck in this step. The frame window is not responding, and showing a grey blank screen. Please help.

    • @galaxylps4287
      @galaxylps4287 Před 6 lety +7

      Maybe you need to add this at the bottom of your code:
      if cv2.waitKey(20) & 0xFF == ord('q'):
      break
      It helped me with the same problem.

    • @LeonSafal
      @LeonSafal Před 5 lety

      it worked thanks galaxy gaming

    • @Skaxarrat
      @Skaxarrat Před 5 lety

      Thanks man

    • @Alan_christo
      @Alan_christo Před 5 lety

      thanks, it worked :)

  • @aimenbahri
    @aimenbahri Před 6 lety +3

    first like first comment

  • @sidkumar5135
    @sidkumar5135 Před 4 lety

    I cannot close the frame on Mac it is giving a spinning ball on the cursor

  • @jaysamirhegshetye5660
    @jaysamirhegshetye5660 Před 4 lety

    What is 0xFF ??

  • @questionablecommands9423
    @questionablecommands9423 Před 4 lety +1

    If you found the line `if cv2.waitKey(20) & 0xFF == ord('q')` confusing, then you weren't alone.
    I don't see a legitimate need for the bitwise operator here. `if cv2.waitKey(20) == ord('q')` will work just fine.

    • @wayne4591
      @wayne4591 Před rokem +1

      It was said that sometimes the cv2.waitKey will return some wired values that go beyond 0-255, with this bitwise operation you ensure that the final product will not go beyond this range.

    • @questionablecommands9423
      @questionablecommands9423 Před rokem

      @@wayne4591 Oh, crap! That would explain a thing or two about oddities I've run into.

  • @rawanhumod6275
    @rawanhumod6275 Před 5 lety

    Thank you for your great work, i tried it after installing opencv but it says “importError : no module named cv2

    • @harsh-haria
      @harsh-haria Před 5 lety

      download the cv2 module first and then try the same

    • @farhaan594
      @farhaan594 Před 3 lety

      You have to go to open a command line and type 'pip install opencv-python'

  • @prathmeshchopade6263
    @prathmeshchopade6263 Před 5 lety +6

    this code open the frame but suddenly it crashes the camera frame and unable to show video.

    • @jeevanshrestha8888
      @jeevanshrestha8888 Před 5 lety +1

      same here.....#frame(not responding) help

    • @rafazirou8949
      @rafazirou8949 Před 5 lety

      same here

    • @harsh-haria
      @harsh-haria Před 5 lety +6

      add this at the bottom of your code:

      if cv2.waitKey(20) & 0xFF == ord('q'):
      break
      It helped me with the same problem.

    • @digital_down
      @digital_down Před 5 lety +2

      HARSH HARIA you’re the real mvp

  • @005shivitanwar3
    @005shivitanwar3 Před 4 lety +1

    My frame is not responding

  • @shauwn7
    @shauwn7 Před 5 lety +3

    My webcam(frame) crashes when i run the code, any sort of way to fix this?

    • @harsh-haria
      @harsh-haria Před 5 lety +3

      add this at the bottom of your code:

      if cv2.waitKey(20) & 0xFF == ord('q'):
      break
      It helped me with the same problem.

    • @iArslanKhan
      @iArslanKhan Před 4 lety

      Dont forget to import Numpy as well

    • @RaviShankar-qe1fi
      @RaviShankar-qe1fi Před 4 lety

      @@iArslanKhan camera blacks out after few seconds ,what to do ?

  • @sapnasharma365
    @sapnasharma365 Před 5 lety +1

    hello!
    after running the "python camera-test.py" command, in my case, frame is displayed on the screen but it is not responding. It's only showing a grey screen... no image. On closing the frame, a dialog box is displayed with message, 'python is not responding'. Can anyone provide me the reasons behind it and possible solution?

    • @moritzp.2920
      @moritzp.2920 Před 5 lety +1

      i don't know the reason, but if you add the following to the end of your main loop it'll work :)
      if cv2.waitKey(20) & 0xFF == ord('q'):
      break

    • @79prasun
      @79prasun Před 5 lety

      @@moritzp.2920 Please have a look here...docs.opencv.org/2.4/modules/highgui/doc/user_interface.html...It says "This function should be followed by waitKey function...." Probably because since the cv2.imshow() call is inside an infinite loop...you need a sort of sleep or wait mechanism so that there is a forced thread switch...and you get to see the snap taken by webcam..:-)

  • @badme9121
    @badme9121 Před 6 lety +1

    I want to learn open CV python from basic so is there any website tutorial or CZcams

  • @herrdesai6853
    @herrdesai6853 Před 4 lety

    camera is shutting down and error report is generated

  • @xlr8368
    @xlr8368 Před 5 lety +1

    more

  • @nitinjoshi5459
    @nitinjoshi5459 Před 4 lety

    Bro its showing frame not responding then what to do.

    • @BharCode09
      @BharCode09 Před 4 lety

      add that interrupt snippet (waitKey and 'q'), which he adds later. It will work.

  • @HuyNguyen-nb6mf
    @HuyNguyen-nb6mf Před 5 lety

    Can you help me fix error: (-215:Assertion failed) size.wi
    dth>0 && size.height>0 in function 'cv::imshow'?Please!

    • @rawkstar952
      @rawkstar952 Před 5 lety

      im having the same error. did u fix it?

    • @HuyNguyen-nb6mf
      @HuyNguyen-nb6mf Před 5 lety

      @@rawkstar952 Let you try to buy new webcam and conect with laptop?

    • @rawkstar952
      @rawkstar952 Před 5 lety

      @@HuyNguyen-nb6mf i fixed it as soon as i replied to you. i just forgot to put a 0 in the first method

    • @005shivitanwar3
      @005shivitanwar3 Před 3 lety

      I also get same error.
      Help me out plz

  • @badme9121
    @badme9121 Před 6 lety

    I m not good in English so my question is. It is important that NUMPy should learn before OPENCV learn

  • @_Bashar
    @_Bashar Před 6 lety +3

    the audio is barely hearable

  • @theconventionalguy
    @theconventionalguy Před 4 lety

    Your code is not available on your github account. Can u send it to me on my email pls?

  • @nguyenvanthinh9344
    @nguyenvanthinh9344 Před 5 lety +2

    open cv with raspberry pi I want to see in very near future :)