How To Read Image-Video-Webcam [1] | OpenCV Python Tutorials for Beginners

In this tutorial, we will learn how to read an image and video placed in a folder using OpenCV. We will also look at how to run a webcam and how to set its parameters.
🚀🚀 My Urdu/Hindi AI KZread Channel 🚀🚀
/ @murtazahassan01
Code & Text Based Version:
www.computervision.zone/cours...
Links:
OpenCV Python Tutorial Playlist:
• How To Install OpenCV ...
Premium Courses:
✔️ Computer Vision Game Development Course:
bit.ly/3ttLZ2s
✔️ Computer Vision with Arduino Course:
bit.ly/3wzLB4m
✔️ Advanced Drone Programming Course:
bit.ly/3qs3v5g
✔️ Learn to Build Computer Vision Mobile Apps:
bit.ly/3uioY1J
✔️ Jetson Nano Premium Course:
bit.ly/3L8uIlF
⚙️⚙️⚙️--My Gear - ⚙️⚙️⚙️
👉 Complete Gear 💈: www.computervision.zone/tech-...
👉 My PC Specs 🖥️: www.computervision.zone/tech-...
👉 My Video Shooting Gear📽️ : www.computervision.zone/tech-...
👉 My Laptops 💻: www.computervision.zone/tech-...
👉 Educational Products🧑‍🎓: www.computervision.zone/tech-...
👉 KZread Starter Kit 🔴: www.computervision.zone/tech-...
Follow Me:
TikTok: bit.ly/3Vo76OQ
Facebook Group: bit.ly/3irDcb7
Discord: bit.ly/3JvyxAM
Facebook Page: bit.ly/3IvpU7W
Instagram : bit.ly/3NdGME3
Website: bit.ly/3ICFTS0
Github: bit.ly/3woU6PS
#ComputerVision
#OpenCV
#CVZone

Пікірлер: 72

  • @happycrazyboy1
    @happycrazyboy13 жыл бұрын

    真的是太好了!說明簡潔有力操作清楚!造福人群!

  • @Egor-sm4bl
    @Egor-sm4bl2 жыл бұрын

    Thank you so much! You have awesome Chanel!

  • @amirhanna6270
    @amirhanna6270 Жыл бұрын

    very helpful thank you

  • @ramiropatricio
    @ramiropatricio4 жыл бұрын

    Excellent explained! Many thanks for the video

  • @murtazasworkshop

    @murtazasworkshop

    4 жыл бұрын

    Glad it was helpful!

  • @santoshgujar5237
    @santoshgujar52372 жыл бұрын

    Thank you, Sir

  • @ashrafelansary8804
    @ashrafelansary88042 жыл бұрын

    Good job 👌🏻

  • @mehrabfiroz3186
    @mehrabfiroz31864 жыл бұрын

    Very Nice

  • @GJ-iy5kj
    @GJ-iy5kj3 жыл бұрын

    Thank you soo much

  • @karmapolicearrestthisgirl4855
    @karmapolicearrestthisgirl48553 жыл бұрын

    Thanks for your good work Hassan.

  • @murtazasworkshop

    @murtazasworkshop

    3 жыл бұрын

    You are most welcome

  • @testlee1833
    @testlee18333 жыл бұрын

    great!Thank you for your video

  • @murtazasworkshop

    @murtazasworkshop

    3 жыл бұрын

    Thanks for watching!

  • @eminyilmaz7645
    @eminyilmaz76454 жыл бұрын

    Thanks a lot for cool tutorial.I have a question about "if cv2.waitKey(1)&0xFF==ord("q"):" part.I searched it but still donnot know.What are they doing and why when we erase them code doesnot work.Could you explain this as simple as you can?

  • @uthoucheong5612
    @uthoucheong56123 жыл бұрын

    Thanks for the video! It is very useful for the beginners! Where can I get the files that you used in the video clip like "lena.png", "testvideo.mp4"?

  • @zchowdhury3073
    @zchowdhury30734 жыл бұрын

    Thank you for your much informative class

  • @murtazasworkshop

    @murtazasworkshop

    4 жыл бұрын

    You are very welcome

  • @08ayansatt33

    @08ayansatt33

    2 жыл бұрын

    How will you open the image and video file in the resource folder?

  • @yuangchengyuancheng4460
    @yuangchengyuancheng44604 жыл бұрын

    Very awesome. Thank you so much.

  • @seriezt

    @seriezt

    4 жыл бұрын

    My pycharm only show qt.qpa.plugin: Could not find the Qt platform plugin "cocoa" in "" This application failed to start because no Qt platform plugin could be initialized. Reinstalling the application may fix this problem.

  • @seriezt

    @seriezt

    4 жыл бұрын

    How to fix it?

  • @leemartin3253

    @leemartin3253

    4 жыл бұрын

    @@seriezt I'm getting the same error

  • @leemartin3253

    @leemartin3253

    4 жыл бұрын

    @@seriezt It's a problem with the current version of the opencv-python package. Uninstall it then install the previous version.

  • @murtazasworkshop

    @murtazasworkshop

    4 жыл бұрын

    @@seriezt i recommend using the python 3.7 .

  • @chrispapadopoulos7995
    @chrispapadopoulos79953 жыл бұрын

    awesome video training thankyou, can you please explain how I can make a resource foulder so that I can store my img files

  • @b40prakashkumarm11

    @b40prakashkumarm11

    3 жыл бұрын

    Right click on ur project folder. Then click new ->Directory

  • @abhiramvankayala5665
    @abhiramvankayala56653 жыл бұрын

    cv2.error: OpenCV(4.5.2) C:\Users unneradmin\AppData\Local\Temp\pip-req-build-m8us58q4\opencv\modules\highgui\src\window.cpp:404: error: (-215:Assertion failed) size.width>0 && size.height>0 in function 'cv::imshow' any body know about this error?

  • @carloseduardofrancoacosta1736

    @carloseduardofrancoacosta1736

    Жыл бұрын

    I had the same error, just paste the image Lenna in the same folder you are working on (if you have visual studio like you can paste it directly froma File explorer), then, inside the imread ("The_name_of_the_folder_you_are_worrking_on/Lenna.png") and that's it

  • @TheMisteree1
    @TheMisteree14 жыл бұрын

    Hey, thanks for the video. I found the lena.png file mentioned in the video however I cannot find the testvideo file. Any help appreciated!

  • @murtazasworkshop

    @murtazasworkshop

    4 жыл бұрын

    I have added the Resources Folder. github.com/murtazahassan/OpenCV-Python-Tutorials-for-Beginners/tree/master/Resources

  • @TheMisteree1

    @TheMisteree1

    4 жыл бұрын

    @@murtazasworkshop Thank you!

  • @nurzulfa

    @nurzulfa

    3 жыл бұрын

    @@murtazasworkshop how to insert the resources file? im newbie :)

  • @YeXiuu46
    @YeXiuu467 ай бұрын

    i am having problem with the code File "C:\Users\user\PycharmProjects\opencv\test.py", line 12, in sucess,img = cap.read() KeyboardInterrupt

  • @sushmanaik2228
    @sushmanaik22283 жыл бұрын

    thank you. how to know the default frame width and height of webcamera?

  • @peterjigstad9755

    @peterjigstad9755

    3 жыл бұрын

    import cv2 HIGH_VALUE = 10000 WIDTH = HIGH_VALUE HEIGHT = HIGH_VALUE cap = cv2.VideoCapture(0) fourcc = cv2.VideoWriter_fourcc(*'XVID') cap.set(cv2.CAP_PROP_FRAME_WIDTH, WIDTH) cap.set(cv2.CAP_PROP_FRAME_HEIGHT, HEIGHT) width = int(cap.get(cv2.CAP_PROP_FRAME_WIDTH)) height = int(cap.get(cv2.CAP_PROP_FRAME_HEIGHT)) print(width,height) cap.release()

  • @sushmanaik2228

    @sushmanaik2228

    3 жыл бұрын

    @@peterjigstad9755 thank you

  • @ShivamYadav-ud8wn
    @ShivamYadav-ud8wn Жыл бұрын

    how to make that resources folder

  • @abammullet
    @abammullet9 ай бұрын

    where can i get resources library from opencv file..please help me😌😌

  • @aohai7537
    @aohai7537 Жыл бұрын

    hi sir. i have a question: I don't know how to add the img.png into the pycharm program.

  • @carloseduardofrancoacosta1736

    @carloseduardofrancoacosta1736

    Жыл бұрын

    You can do it directly from the file explorer

  • @user-be8tc5kl6d
    @user-be8tc5kl6d2 жыл бұрын

    Face Liveness Detection That With Web App For Registration Process please do this project

  • @saiprasad3656
    @saiprasad36564 жыл бұрын

    I am unable to play video from my webcam getting error as error: (-215:Assertion failed) size.width>0 && size.height>0 in function 'cv::imshow'

  • @murtazasworkshop

    @murtazasworkshop

    4 жыл бұрын

    try changing the camera id from 0 to 1 or 2

  • @peterjigstad9755

    @peterjigstad9755

    3 жыл бұрын

    Check your camera permission. Go to the settings of windows 10, permission to access camera must be enabled to your application. Settings > Privacy > Camera > Allow desktop apps to access your camera = On.

  • @watodo1688
    @watodo1688 Жыл бұрын

    It shows cannot find reference'imread' in 'init_.py'

  • @tec.passion6113
    @tec.passion61134 жыл бұрын

    thanks for awesome videos and training ; I got an errer ( File "D:/Python 2020/opencv/venv/test.py", line 12, in cv2.imshow("lena.png") TypeError: imshow() missing required argument 'mat' (pos 2)

  • @peterjigstad9755

    @peterjigstad9755

    3 жыл бұрын

    You must declare the function with correct arguments. The line should be: cv2.imshow("your testwindow title",img)

  • @carloseduardofrancoacosta1736

    @carloseduardofrancoacosta1736

    Жыл бұрын

    I had the same error, just paste the image Lenna in the same folder you are working on (if you have visual studio like you can paste it directly froma File explorer), then, inside the imread ("The_name_of_the_folder_you_are_worrking_on/Lenna.png") and that's it

  • @rahulrockerrocker2393
    @rahulrockerrocker23932 жыл бұрын

    What skill should I learn to study opencv Please anyone

  • @CREATIVEINNOVATOR
    @CREATIVEINNOVATOR Жыл бұрын

    I installed all the packages but pycharm is not auto filling the functions

  • @LoveFood1332

    @LoveFood1332

    Жыл бұрын

    same , did u found out ?

  • @CREATIVEINNOVATOR

    @CREATIVEINNOVATOR

    Жыл бұрын

    @@LoveFood1332 no I don't know what is the problem. It's not auto filling but all the functions are working

  • @serdalcitak6539
    @serdalcitak65394 ай бұрын

    Why is it played too fast in my phycharm ? Code is exactly same but what should I change to have my video played in normal speed ?

  • @bheiafranco1252
    @bheiafranco12524 жыл бұрын

    Hai , i have an error says 'crd' is not defined? why is this? tnx

  • @murtazasworkshop

    @murtazasworkshop

    4 жыл бұрын

    Share a screenshot .and i will have a look .

  • @bheiafranco1252

    @bheiafranco1252

    4 жыл бұрын

    How can I reach you through?

  • @murtazasworkshop

    @murtazasworkshop

    4 жыл бұрын

    @@bheiafranco1252you can contact me here: facebook.com/murtazasworkshop/

  • @d.lloydjenkinsjr

    @d.lloydjenkinsjr

    4 жыл бұрын

    Wasn't it 'ord'?

  • @dineshm4582
    @dineshm45823 жыл бұрын

    hai i have this error how to resolve it cv2.error: OpenCV(4.5.1) C:\Users\appveyor\AppData\Local\Temp\1\pip-req-build-xeqjxthj\opencv\modules\highgui\src\window.cpp:376: error: (-215:Assertion failed) size.width>0 && size.height>0 in function 'cv::imshow'

  • @azrilhaidar7476

    @azrilhaidar7476

    3 жыл бұрын

    Yes have that problem too, can you resolve it sir? Thx

  • @dineshm4582

    @dineshm4582

    3 жыл бұрын

    @@azrilhaidar7476 yes I ill send you later

  • @azrilhaidar7476

    @azrilhaidar7476

    3 жыл бұрын

    @@dineshm4582 can you resolve it sir? Can share the program here? Thx

  • @akanshakhedia533

    @akanshakhedia533

    3 жыл бұрын

    @@azrilhaidar7476 please check if the image is in the same location as mentioned. It returns this error when the file is not in the location given. Check if the spellings are right

  • @hiteshbhojne6852

    @hiteshbhojne6852

    3 жыл бұрын

    If anyone gets the solution plz help me as well plz

  • @WelcomeToMyMetaverse
    @WelcomeToMyMetaverse3 жыл бұрын

    i am having problem with the code ....cam and video playback i not working....( if cv2.waitkey(1) & 0xFF == ord('q'): AttributeError: module 'cv2.cv2' has no attribute 'waitkey') Error ,with this error...

  • @rahab5807

    @rahab5807

    3 жыл бұрын

    cv2.waitKey, not cv2.waitkey

  • @buraksozugecer
    @buraksozugecer3 жыл бұрын

    bro thanks for everythings but please stop mouth smack :D