Hand Distance Measurement with Normal Webcam + Game | OpenCV Python

  Рет қаралды 171,447

Murtaza's Workshop - Robotics and AI

Murtaza's Workshop - Robotics and AI

Күн бұрын

In this project we will find the distance between a single camera and a hand. We will use basic mathematics to create this application. We will also create a simple game using this method.
🚀🚀 My Urdu/Hindi AI KZbin Channel 🚀🚀
/ @murtazahassan01
✔️ ✔️ ✔️ Computer Vision Game Development Course✔️ ✔️ ✔️
www.computervision.zone/cv-ga...
Download Code:
www.computervision.zone/cours...
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-...
👉 KZbin 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

Пікірлер: 98
@murtazasworkshop
@murtazasworkshop 2 жыл бұрын
If you are getting an error getting the x and y value using hand['lmList'][8] then use hand['lmList'][8][:2] instead. This is because the latest version of cvzone consits to x,y,z values instead of only x,y. So you have to define that you only need the first two elemnts by adding [:2]
@tibettenballs4962
@tibettenballs4962 2 жыл бұрын
Best most unique tutorials… his website has variants of the YT projects. I’ve been mashing parts of what he teaches into my own apps. Thanks for your unique approach.
@1-minutesanimation853
@1-minutesanimation853 2 жыл бұрын
Man this guy's imagination with cvzone or mediapipe would never stop
@muradmehrababrar4133
@muradmehrababrar4133 2 жыл бұрын
You are THE BEST tutor for python and OpenCV !
@venkir1408
@venkir1408 2 жыл бұрын
Fantastic, I really enjoyed this hands on session. Very informative and though its 1 Hr it was very usefull. Great one I seen after a long time.
@eemanmajumder
@eemanmajumder 2 жыл бұрын
Hey seriously your tutorials help a lot and I have a request please dont become like others and start making premium tiers I am poor and seriously this is my only way of learning opencv
@rubialugattimoreira1978
@rubialugattimoreira1978 2 жыл бұрын
Always great content!
@dinmalikogli5983
@dinmalikogli5983 2 жыл бұрын
MashaAllah bro I am watching all of your CV videos and they are very helpful. Hi from Uzbekistan
@yousefwaelsalehelsaidkhalil
@yousefwaelsalehelsaidkhalil 8 ай бұрын
This Is A Really Amazing Channel! I Was Searching For AI Projects And Computer Vision And I Found It Pretty Easy While Its A Very Important Source For Learning. Please Continue Uploading Videos Like This With Explanation.
@SuperbonyTheCat
@SuperbonyTheCat 2 жыл бұрын
with a single camera ! respect ! 😺 first seen in "Minority Report" (2002)
@YazeedAlkosai
@YazeedAlkosai 2 жыл бұрын
great work with very unique ideas.
@microsoftsarker
@microsoftsarker 2 жыл бұрын
Thanks brother, it worked!! I watched many video but only this worked!! I am very thankful to you!., LIKED AND SUBSCRIBED
@faizalam8425
@faizalam8425 2 жыл бұрын
Thank you so much, Sir. Appreciate your work.
@hotspicylife3388
@hotspicylife3388 2 жыл бұрын
Can I ask something sir? Is your program can be used for outdoor? Like how will different ammount of light intensity affect your program and such. My school project is kind of similiar to yours so I can't help but wonder. Thankyou! Edit : Also, imagine if you install the measurement program with full body tracking into a robot. That would be awesome! Just like from "Real Steel" Movie
@BagusBangets
@BagusBangets 2 жыл бұрын
Powerful bhai👍
@johnryan8645
@johnryan8645 10 ай бұрын
I love that you did a curve fit example! But the hand is a line on a sphere of radius r. 4/3pi*r3…. And we have spherical distortion as we move to the sides. All doable, and worth doing to make a more generalized distance estimator. Nevertheless, I enjoyed the video. Great job!
@saeedalikhan7128
@saeedalikhan7128 2 жыл бұрын
thanks sir for your Informative video
@santoshgujar5237
@santoshgujar5237 2 жыл бұрын
Beautiful, Sir, Thank you, Sir
@senaysew8231
@senaysew8231 2 жыл бұрын
Thanks you great man!
@yasirali8409
@yasirali8409 2 жыл бұрын
Great sir 👍
@vittal255
@vittal255 2 жыл бұрын
Namaste Sir, I regularly watch your videos and by watching your videos i developed interested in Computer Vision and made some cool application.. Sir how to get the direction of the bounding boxes , this feature is needed for one of my application. I would really appreciate your guidance.
@nanayawforson9306
@nanayawforson9306 Жыл бұрын
I really admire your works. How do you compile these projects as mobile app or desktop application for users?
@michelvancaneghem
@michelvancaneghem 2 жыл бұрын
If you use Thales' theorem, then we find for the distance : y = 6000 / x, which is still approximate because it is not a perfect camera
@kenichimori8533
@kenichimori8533 2 жыл бұрын
Define x = 7000 ppp
@Labbsatr1
@Labbsatr1 Жыл бұрын
Thank you so much
@TuanTran-xj6te
@TuanTran-xj6te 2 жыл бұрын
真好,非常好。
@tahirullah4923
@tahirullah4923 2 жыл бұрын
very nice sir. SIR can you make a vedio based on distance measurement from any reference point i.e from wall or from or bottle or any other object
@gplgomes
@gplgomes 2 жыл бұрын
Great video. A improve: for a distance between hands dots of "d" for a "L" lengh then if you have a new "d1" so the new distance "L1" will be L1= L d/d1. In your case we get L1=300*20/d1 or L1=6000/d1
@yade1234
@yade1234 2 жыл бұрын
Hey, could you refer me to the mathematical property that allow us to derive this? or how it's done from Thales' theorem?
@gplgomes
@gplgomes 2 жыл бұрын
@@yade1234 it from Thales Theorem. Murtaza made a new video "Face Distance" which he is using and explaining this propriety: kzbin.info/www/bejne/oKTSlmSDZ6adfM0
@gplgomes
@gplgomes 2 жыл бұрын
Basiclly is a tangent rule or a triangle similarity.
@yade1234
@yade1234 2 жыл бұрын
​@@gplgomes Oh hey thanks for the link too, I saw the video and it made great sense to me. Still I was wondering how we were able to perform distance measurement with just one real world measurement unlike the video where we were calculating the focal length and then had to use it along with the real world distance between the eyes. Whereas in this formula we are only using that one real world measurement of the hand from the camera and it's still giving very good results.
@gplgomes
@gplgomes 2 жыл бұрын
​@@yade1234 , it is a proportional result. It is based on a knowing object (distance between the eyes) at a specific distance, then it can calculate on other distances. The first step is the calibration, wich is used for other mensuras.
@nikolamilovanovic8651
@nikolamilovanovic8651 2 жыл бұрын
First like, then watch👍
@actionkey8042
@actionkey8042 2 жыл бұрын
AWESOME
@manouchehryousefi936
@manouchehryousefi936 Жыл бұрын
Thanks
@arrvind7385
@arrvind7385 2 жыл бұрын
wow amazing
@oswaldkit
@oswaldkit 2 жыл бұрын
Cool!
@carlossanpablo3477
@carlossanpablo3477 2 жыл бұрын
Te quiero joder, me has solucionado la vida muchisimo
@thegamechanger7157
@thegamechanger7157 2 жыл бұрын
Yeah thats it. The size, I have manage that. The actual size or near accurate height but the cctv companies needs to sent the specifications of the camera
@Gahyeon22
@Gahyeon22 11 ай бұрын
Hi I used vscode. And I watched a video of you using mediapipe to extract hand skeleton and stack blocks. I have a question here. I want to add how far the webcam is from the hand. However, the code in this video does not extract hand skeleton when applied to Unity. I want you to tell me why and how
@simam7
@simam7 Жыл бұрын
what were u using, vscode? or what
@julianoandriolloteixeira
@julianoandriolloteixeira 7 ай бұрын
Hello, is it possible to create software that identifies the speed of an object in a video? Please
@itheblackwolfofmyfamily
@itheblackwolfofmyfamily 2 жыл бұрын
You’re hero my brother, and I love your videos, but I have a question. I want to become a Computer vision engineer, so what language do you think I should learn? Python or C++? Thank you for the educational contribution, and keep us the good work.
@jean-charlesrisch7841
@jean-charlesrisch7841 2 жыл бұрын
Python is all you need !
@ajaymin28
@ajaymin28 2 жыл бұрын
Python is ok, but c++ runs faster than python. use c++ when optimization/speed is important.
@wadahadlan
@wadahadlan 2 жыл бұрын
I agree with both sentiments. Start your project in Python, by then you would have internalized paradigms, and porting to C++ could be an excellent first project in that language
@Diego-rb9vo
@Diego-rb9vo 2 жыл бұрын
Thank you very much for sharing this for free sir with computer vision would there be a way to do that with recognition of hand gestures to make a first person shooter where a hand gesture indicates whether to shoot or not, another indicates to change weapons, etc?
@ssuthan1337
@ssuthan1337 2 жыл бұрын
He has another tutorial on finger counting which you might find useful
@Diego-rb9vo
@Diego-rb9vo 2 жыл бұрын
@@ssuthan1337 thank you
@shrijeetbiswas1640
@shrijeetbiswas1640 Жыл бұрын
i tried to re crate this, however i have made a strange observation the distance still changes when you flip your hand keep it in the same position, for example try showing Palm and Thumb Up sign , the distance will change even if your hand is at the same position.
@himanshukulkarni9535
@himanshukulkarni9535 2 жыл бұрын
First like first comment
@ahmadaladawi1633
@ahmadaladawi1633 2 жыл бұрын
Thanks, just wondering if the measurement is different from one camera to another as you were using an external camera that has a different location from our laptops' cameras. great work and thanks again :)
@dogukantombul1045
@dogukantombul1045 10 ай бұрын
what if I dont use my computers camera and dont use videocapture. How do I do that? Because read() function wont work also
@saha2537
@saha2537 2 жыл бұрын
How can i get 3D coordinate(x,y,z) not only depth
@nrdesign1991
@nrdesign1991 2 жыл бұрын
This might be great for measuring with calibrated markers. Or measuring the distance between the hands in space, by determining the distance to the camera, and also between the hands.
@martondemeter4203
@martondemeter4203 2 жыл бұрын
The cover image, where it highlights his hand as 44cm is how guys see themselves before the first date:D jk, nice content (I know it is the distance)
@lindiabut1277
@lindiabut1277 Жыл бұрын
hello sir, can i ask? how to make thats in website, or it can use more library like flask?, im trying using flask and thats(hand distance measurement) got error, can any one help me?
@aabu4348
@aabu4348 8 ай бұрын
Can it become more precise like at mm level
@stacymaimoon4189
@stacymaimoon4189 2 жыл бұрын
So , by using this approach you can only estimate the distance if you pre-calibrated? (measuring band). Which, of course, makes it slightly less practicable. Otherwise if cvzone does not support depth measuring (which I strongly suppose), there is no way to achieve this. It would be interesting if you could make a video of the same stuff, but using a Kinect or a similar sensor. TIA.
@pranavsreedhar1402
@pranavsreedhar1402 2 жыл бұрын
one could try to estimate distance by finding its relationship with FOV angle by correlating it to the area occupied by the hand within the frame. a larger FOV leads to lesser accuracy with increasing distance and a smaller FOV would lead to better results at the cost of lesser detectable/usable area. A kinect or a similar sensor would generally be costlier and be very specific in terms of implementation and would obviously be using more advanced tech than a webcam. Im guessing the tape measurement is a easier way to calibrate than to find out the FOV of say cheap chinese webcam with no clear specifications. a far cheaper alternative would be to use a portable TOF sensor like the vl53l0x. it gives an accurate measurement of the distance from an object in a narrow FOV and we can use that to extend to the rest of the camera FOV if done properly. this would to some extent avoid the tape measurement process at the cost of one sensor. either ways this calibration is a one time thing for a particular camera.
@sanilalkuttimon1755
@sanilalkuttimon1755 2 жыл бұрын
❤️❤️❤️
@user-bd5ou9rr6e
@user-bd5ou9rr6e 6 ай бұрын
the game is good
@naeemtastic
@naeemtastic 2 жыл бұрын
Hello, Random doubt but can we combine all code from every one of your video e.g : virtual keyboard, zoom gesture, etc..., can we combine all of them?
@mohdshadab1755
@mohdshadab1755 2 жыл бұрын
Can anyone help me to how to make this project and which software are use by admin . Can anyone help me pls pls
@venkatesh2788
@venkatesh2788 2 жыл бұрын
Can you change into web app
@learncse
@learncse 2 жыл бұрын
Help me solve this Error please. File "main.py", line 26, in if hands: ValueError: The truth value of an array with more than one element is ambiguous. Use a.any() or a.all()
@rycke6252
@rycke6252 2 жыл бұрын
your 'hands' var is an vector/tuple/set ou dict, soo an 'if' operation is not permited since a vector can has multiple values: hands = [True, False] if hands: # the code should get in or out of if?
@meghanair3789
@meghanair3789 2 жыл бұрын
Does this project use Haar Cascades?
@phuchothe7449
@phuchothe7449 5 ай бұрын
Can I ask you something sir? Can I port this to arduino ?
@mehdimbb3622
@mehdimbb3622 Жыл бұрын
Can i use mm for code??
@rohanbarnwal5940
@rohanbarnwal5940 2 жыл бұрын
Sir how to do it with face??
@srezaziaee
@srezaziaee 2 жыл бұрын
I could only install Mediapipe==0.8.10 and cvzone==1.5.6 packages in pycharm, it doesn't work for me on vscode or jupyter lab 1-don't forget to use python 3.7.6the default interpreter in your env 2-You can install 2 packages successfully settings >> project:xxx >> PythonInterpreter as Morteza demonstrated 3- This is really important to Downgrade protobuf to 3.20.1 (the last version up to now 4.21.1 doesn't match with mediapipe until now)
@michaelderamus662
@michaelderamus662 2 жыл бұрын
I keep getting the following error message, and I'm not sure why. "TypeError("expected x and y to have same length")"
@michaelderamus662
@michaelderamus662 2 жыл бұрын
I found the issue, I was missing an element in the 'y' dictionary.
@rjgonzalez8108
@rjgonzalez8108 2 жыл бұрын
What camera is the "new" camera?
@murtazasworkshop
@murtazasworkshop 2 жыл бұрын
Canon m50
@rjgonzalez8108
@rjgonzalez8108 2 жыл бұрын
@@murtazasworkshop Thanks
@ShubyDuan
@ShubyDuan 2 жыл бұрын
This is not generalizable to different people. You calibrated the algorithm to basically the width of your hand. Distance measurements will be off for other people.
@mehdimbb3622
@mehdimbb3622 Жыл бұрын
mm Milimetr Exampel= 21/34mm Or 24/67mm. . . . .
@mehdimbb3622
@mehdimbb3622 Жыл бұрын
Hi bro Can i u give me this code??
@Devlost_
@Devlost_ 2 жыл бұрын
Sir I have a question...please help me sir....how can I add Open cv to my CCTV camera??please help sir please
@majsur7441
@majsur7441 2 жыл бұрын
you cant just add it to cctv camera, but you can do it by having your cctv camera connected to the computer and use it as a camera
@Devlost_
@Devlost_ 2 жыл бұрын
@@majsur7441 okkk....I can access my CCTV by its software....
@username-dh4tq
@username-dh4tq Жыл бұрын
×÷× : @@Devlost_
@muhshamelahi3051
@muhshamelahi3051 5 ай бұрын
lmList = hands[0]['lmList'] ~~~~~~~~^^^^^^^^^^ TypeError: list indices must be integers or slices, not str help me with this error
@behcettas8533
@behcettas8533 Ай бұрын
did you solve this problem?
@frankchina2055
@frankchina2055 2 жыл бұрын
too many values to unpack (expected 2) Bug why?
@murtazasworkshop
@murtazasworkshop 2 жыл бұрын
If you are getting an error getting the x and y value using hand['lmList'][8] then use hand['lmList'][8][:2] instead. This is because the latest version of cvzone consist to x,y,z values instead of only x,y. So you have to define that you only need the first two elements by adding [:2]
@longle4030
@longle4030 Жыл бұрын
Has anyone here done this project yet?
@kenichimori8533
@kenichimori8533 2 жыл бұрын
Bill Gates Banzai‼︎
@nidhijain8618
@nidhijain8618 2 жыл бұрын
ho is your son what is his name
@peacegtv7827
@peacegtv7827 2 жыл бұрын
Someone is already making a paper out of this tutorial and publishing it like its their own. 🤣🤣🤣 🤡🤡🤡
@user-uh2cr9so8l
@user-uh2cr9so8l 2 жыл бұрын
Hand detection is hardly novel is it? Or is that the joke?
@peacegtv7827
@peacegtv7827 2 жыл бұрын
@@user-uh2cr9so8l Its not a joke LOL some so called "AI Expert" from their local hometown is already trying to make a paper about this and present in a conference like IEEE LOL!!!
Top 25 Computer Vision Projects 2021
6:01
Murtaza's Workshop - Robotics and AI
Рет қаралды 192 М.
REAL TIME OBJECT MEASUREMENT | OpenCV Python (2020)
53:25
Murtaza's Workshop - Robotics and AI
Рет қаралды 238 М.
The Worlds Most Powerfull Batteries !
00:48
Woody & Kleiny
Рет қаралды 27 МЛН
Watermelon Cat?! 🙀 #cat #cute #kitten
00:56
Stocat
Рет қаралды 17 МЛН
СНЕЖКИ ЛЕТОМ?? #shorts
00:30
Паша Осадчий
Рет қаралды 1,9 МЛН
Sigma Girl Education #sigma #viral #comedy
00:16
CRAZY GREAPA
Рет қаралды 111 МЛН
Build an Object Detector for Any Game Using YOLO
22:40
Moises de Paulo Dias
Рет қаралды 35 М.
I Made 200 Python Projects...Here Are My 5 FAVORITES
11:23
Tech With Tim
Рет қаралды 132 М.
100 Computer Vision Projects for 2023
43:47
Murtaza's Workshop - Robotics and AI
Рет қаралды 47 М.
Distance to objects using single vision camera.
9:05
Shahriar Sayeed
Рет қаралды 70 М.
5 Things You Don't Need on Your Resume Anymore
15:38
Don Georgevich
Рет қаралды 417 М.
I ignored this incredible Neovim plugin for years!
9:03
Tom on the Internet
Рет қаралды 5 М.
Object Tracking with Opencv and Python
30:03
Pysource
Рет қаралды 591 М.
Auto-Measuring with OpenCV + Python - Try It Yourself
25:17
Clayton Darwin
Рет қаралды 78 М.
The Worlds Most Powerfull Batteries !
00:48
Woody & Kleiny
Рет қаралды 27 МЛН