Тёмный

Identify objects moving on a conveyor belt using Opencv with Python 

Pysource
Подписаться 61 тыс.
Просмотров 74 тыс.
50% 1

In this tutorial I will explain how to identify objects which are moving on a conveyor belt.
This is a really simple prototype built using a really small conveyor belt and a raspberry pi to control it.
Tutorial and Source code: pysource.com/2...
➤ Full Videocourses:
Object Detection: pysource.com/o...
➤ Follow me on:
Instagram: / pysource7
LinkedIn: / pysource
➤ For business inquiries:
pysource.com/c...

Опубликовано:

 

26 сен 2024

Поделиться:

Ссылка:

Скачать:

Готовим ссылку...

Добавить в:

Мой плейлист
Посмотреть позже
Комментарии : 106   
@pysource-com
@pysource-com 2 года назад
►► You can Build a Computer Vision software to DETECT and TRACK any Object. → 4-Step FREE Workshop pysource.com/blueprint-workshop-signup/
@lyovmyshkin7561
@lyovmyshkin7561 4 года назад
Your content is very high quality, it will be no time until your channel gets very very successful.
@pcbworks
@pcbworks 4 года назад
Great ! This is what I've been working on as an undergraduate. Thanks for sharing !
@zedespook
@zedespook 3 года назад
Thank you for this amazing tutorial. I know I'm a year late, but I guess knowledge is never outdated, even if the information is. I encountered the "ValueError" while following your tutorial, but you just have to remove the "_" variable at the START of the line, that's all. I loved your video, and amazed by the simplicity of the code, and the complexity of the result.
@haydenpulchinski4836
@haydenpulchinski4836 10 месяцев назад
Amazing, this was exactly what I needed. I appreciate your upload!
@Loperas2012
@Loperas2012 2 года назад
Really impressive and straightforward instructions!! You win one more follower ;-)
@JuusoKolehmainen
@JuusoKolehmainen 4 года назад
I'm in the works of building myself an conveyor belt for my fiber laser and i was thinking of doing something silly like marking the nuts with our hacklab logo via this system. Information was very well put out and will be definitely bookmarked thank you :)
@deepanjan1234
@deepanjan1234 3 года назад
This is really a great tutorial. Can we do something on cumulative counting of the number of small and big nuts on the belt real time ? Many thanks for all of your videos.👍
@yahyakhaddam
@yahyakhaddam 4 года назад
Respect man ! You deserve 1m subscriber ..
@woosal-kc7tr
@woosal-kc7tr 4 года назад
Interesting idea and project, thanks for the share!
@阿陞-w8i
@阿陞-w8i 3 года назад
That's exactly what I need, thank you!
@simonkh7278
@simonkh7278 Год назад
thx! nice approach. Looking to use recognition for ewaste like pcb to udentify grade and components
@abineshanand4737
@abineshanand4737 4 года назад
Good one, you could still make the roi at the end of the conveyor much smaller and adjust condition for the small nuts to fall without the conveyor being stopped seeing the larger nuts in the ROI. Anyways a good project.
@259klass9
@259klass9 4 года назад
Great project and very well explained Sir, even greater if it could count the different nuts
@spideyyy4203
@spideyyy4203 3 года назад
Very Helpful man ...... thankyou!!
@benyounesoukarfifstm8782
@benyounesoukarfifstm8782 4 года назад
Thank sir four ur great idea. I really appreciate it. I hope you will post more projects like this one. 👍👍👍
@omaraissani6255
@omaraissani6255 4 года назад
Great content, i've watched a lot of ur videos last days, let me correct for u a sentence that u seem to say a lot, you say: "a is equals to...", it should be either, "a is equal to" (without the s) or "a equals to".
@pysource-com
@pysource-com 4 года назад
thank you, I wasn't aware of that, I've just noticed it now rewatching my video. I guess I pronunced it wrong so many times that it just came natural to me that way :)
@hannahlambdaa
@hannahlambdaa 4 года назад
@@pysource-com don't worry too much about it. It is the content we are after not the form. We all have automatic patches in our brains for these things:-) Great video, as always!! Thanks
@jayanthkumar8927
@jayanthkumar8927 3 года назад
Hi, I wanted to identify some ten objects and segregate them into two categories. Ex: if the object is nut then the stepper motor (belt) should move clockwise, and if the object is bolt then the stepper motor should move anticlockwise, etc. So how do I program that?
@jayanthkumar8927
@jayanthkumar8927 3 года назад
​ @Pysource Can you explain this part, or can you make another video for this.
@bigturbofan3642
@bigturbofan3642 2 года назад
@@jayanthkumar8927 you would need a machine learning model probably or you could decide based on the size
@agrivaruth9453
@agrivaruth9453 4 года назад
i very like all your tutorial and easy to learn from you. would you like to make tutorial about "measuring distance between two objects in real time use opencv and python". i really need that as soon as possible
@bolzanoitaly8360
@bolzanoitaly8360 2 года назад
Thanks for your amazing code and project, but you did not show us how to connect and configure the hardware? Thanks Please, respond with many thanks
@pysource-com
@pysource-com 2 года назад
The main purpose of this video was to focus just on the computer vision aspect of the project. The hardware part is actually the simplest one, and there is some reference about it on the blog post (link below in the description). Mostly the python code is connected to a Relay that turns on/off the motor.
@bolzanoitaly8360
@bolzanoitaly8360 2 года назад
Ok, thanks, a lot, I have another issue with the Python Editor that you are using namely 'Thonny', my cv2 is not working, and giving me the error as below:- import cv2 ModuleNotFoundError: No module named 'cv2' Even, I have installed cv2 packages from Tools--> Manage Packages, Can you help me what to do, please? Thanks, in Advance. best regards Gul
@sermadreda399
@sermadreda399 2 года назад
Great video thank you for sharing
@maloukemallouke9735
@maloukemallouke9735 4 года назад
Thank you so much for sharing, in this situation it easier to identify items because the background it's black color but how you can deal with the background changing color? Thank's.
@Omundodoarthur
@Omundodoarthur 4 года назад
Instead of an arm ele can use a diverter gate in the end of belt. Congratulations for project!
@drewenia
@drewenia 3 года назад
Hello and thank you... How do you show the x and y coordinates on the screen? I have a raspberry device too Thanks for reply
@triponvlad7516
@triponvlad7516 2 года назад
Hi. What kind of motor do you use? And can you tell me what kind of power supply do you use? Thanks a lot.
@akshayjaryal8930
@akshayjaryal8930 4 года назад
Thanks for this Informative tutorial.........Please post a tutorial of custom object detector using yolov4!
@andreasmarkussen
@andreasmarkussen 2 года назад
Great video - Where did you buy the conveyer belt from? We are building larger conveyors, but we would like some small conveyors for learning and testing.
@pysource-com
@pysource-com 2 года назад
thanks. unfortunately this is not available for sale, it's a small steel conveyor made by a blacksmith
@prashkd7684
@prashkd7684 Год назад
Wow. I have a box full of mixed nuts, bolt screws etc and would love to have something lke this to organise them property so I don't have to go through them all at the last minute.
@ihsanaydemir6691
@ihsanaydemir6691 3 года назад
Thank you. Amazing tutorial. I have one questions. Does it matter which pins of the Raspberry pi board are connected to the relay?
@pysource-com
@pysource-com 3 года назад
Yes it matters. There are specific pins to use for the servo motors. Personally I used a servo hat which made this process much simpler to install. I recommend to check servo hat for servo motors by adafruit
@photoelectrieffect
@photoelectrieffect 3 года назад
hi i cannot install conveyor_lib i try to import conveyor_lib in pychram (python3.6) but Error No module named 'conveyor_lib' can tell me about it
@saikatmondal809
@saikatmondal809 4 года назад
It is a very nice project. But how you created the conveyor_lib to control the relay. Can you please share the code of this library.
@mariammoufaddal5651
@mariammoufaddal5651 Год назад
Have you been able to figure out the conveyor_lib ?
@abubakarsaleem5167
@abubakarsaleem5167 Год назад
​@@mariammoufaddal5651 conveyor_lib is used by a file_handling technique which is basically a name of python file which is used to link ResberryPi signals with "main.py" file.As u can see the "import conveyor_lib" in third line of "conveyor_lib.py" file in which they were calling "conveyor_lib" from the conveyor_lib.py file. These are basically two files "conveyor_lib.py" and "main.py" which u will get by registering to the blog of this tutorial which they have mentioned in the description.
@mariammoufaddal5651
@mariammoufaddal5651 Год назад
@@abubakarsaleem5167 thank you
@muhammadsaahir2664
@muhammadsaahir2664 2 года назад
i am getting a none type error when using that system to zoom in on the conveyor belt, any fixes
@basitrizvi-kp8so
@basitrizvi-kp8so 5 месяцев назад
can this code be used to detect rgb boxes on the conveyor?
@photoelectrieffect
@photoelectrieffect 3 года назад
in line 17 Error This error ValueError: not enough values to unpack (expected 3, got 2) pls tell me
@rjb-y4v
@rjb-y4v 8 месяцев назад
did you give private teaching?
@0007harshal
@0007harshal Год назад
Heloo sir can we built a counter system with digital outputs
@chamberselias1903
@chamberselias1903 2 года назад
Year late but I’m not getting the rgb and x,y values on my output frame
@kkwang2019
@kkwang2019 4 года назад
nice tutorial
@juandavidbarrerol1510
@juandavidbarrerol1510 4 года назад
great project
@SuchithGowda-y8u
@SuchithGowda-y8u Год назад
how in frame x and y values are came to focus on belt
@OscarEduardoRendonsotelo
@OscarEduardoRendonsotelo 3 года назад
Fantastic 😳
@soumyashekhar7340
@soumyashekhar7340 2 года назад
How to identify grooved metal and non grooved metal using ml?
@Zumon_label
@Zumon_label 2 года назад
What if I want to detect object based on their color and shape? not only size?
@MEan0207
@MEan0207 3 года назад
Thank you
@tomplieninger8941
@tomplieninger8941 4 года назад
Hey, I have a short question on the Tetris series. I know you probably get asked this a lot, but is this series still running or did you stop Programming further? I hope for a quick respond :D
@pysource-com
@pysource-com 4 года назад
Hi, unfortunately I decided to suspend the series because It is going to take too long to complete it, instead I'm focusing on other projects for the videos.
@dogukangok1565
@dogukangok1565 4 года назад
Sir, how can we activate servo motors depends on detected object ?
@luqmanharits1456
@luqmanharits1456 2 года назад
Realy nice
@dkibe6006
@dkibe6006 3 года назад
What if the objects are not in a straight line can it also count well?
@bhaktigarje2651
@bhaktigarje2651 2 года назад
Sir which software you have used for programming?
@shivamvenkat
@shivamvenkat Год назад
I would like to get the system , can you provide a contact ?
@kishorekumar7571
@kishorekumar7571 4 года назад
Sir how to measure a human body measurements using open cv ..help me sir
@rog0079
@rog0079 4 года назад
great video !! can u do a video on unet or yolact custom instance segmentation, it wud be great if do make a tutorial video on it :D
@AKASHMANDAL2386
@AKASHMANDAL2386 4 года назад
How to detect scratch/cut in black surface?
@kamyakanara3912
@kamyakanara3912 11 месяцев назад
How did u connnecr ur laptop and convyer belt
@shivanibhardwaj8137
@shivanibhardwaj8137 4 года назад
Sir , thanks for sharing I have one doubt that suppose it's not coin and some cuboid and it's orientation plays an important role will this model be reliable in finding degree of deflection frm original orientation ?
@pysource-com
@pysource-com 4 года назад
Considering in this project we compare the nuts by their size, probably in your case it won't be the best approach. You should find a way to distinguish them. For example, if you have cuboid objects and they need to be all with the same orientation, parallel to the belt, you could check the coordinates of each single object and compare it with the borders of the belt, if they're parallel or not.
@shivanibhardwaj8137
@shivanibhardwaj8137 4 года назад
Thanks a lot for your reply !!:)
@pablomacho1176
@pablomacho1176 4 года назад
Nice video! But if you want to remove the noise, what method do you recommend? cv2.morphologyEx, cv2.dilate(), cv2.blur()...? Thanks!
@pysource-com
@pysource-com 4 года назад
Hi Pablo, I suggest to use cv2.GaussianBlur() as first step. Gaussianblur is better than just blur because it remove noise without removing details of the object, while the cv2.blur is less precise. Then cv2.erode(). and you're good to go.
@pablomacho1176
@pablomacho1176 4 года назад
@@pysource-com Thank you so much!
@nareshkumargopi5117
@nareshkumargopi5117 4 года назад
Nice video sir, i have one doubt image processing has to be done over continous period, Does raspberry pi is reliable for such long time work and also for how many hours it can be used in projects like this?
@pysource-com
@pysource-com 4 года назад
Yes it's reliable, it's just important to add the heatsinks so it doesn't get too hot and you can leave it always on.
@nareshkumargopi5117
@nareshkumargopi5117 4 года назад
@@pysource-com okay sir tq so much. If u post videos like measuring dimentions of a part and detecting cracks in future it will be very useful.
@putrajamal5120
@putrajamal5120 Год назад
sir how to conect relay pin to rasberrypi?
@quyetbui4277
@quyetbui4277 2 года назад
Thanks for this tutorials! Can you tell me how to find the "Conveyor_lib", pls ?
@pysource-com
@pysource-com 2 года назад
That lib is provided by the servo hat you're using. It depends on the brand! I recommend to get the adafruit servo hat because is the most user friendly to implement
@AsianTrackGamerYT
@AsianTrackGamerYT 3 года назад
Which compiler you are using
@MrWebsie
@MrWebsie 2 года назад
I get an error "not enough values to unpack (expected 3, got 2) _, contours, _ = cv2.findContours(threshold, cv2.RETR_EXTERNAL, cv2.CHAIN_APPROX_SIMPLE) is the referenced line. I'm pretty sure that i've went through it exactly as you have, does anyone have a solution?
@121horaa
@121horaa Год назад
just use contours, _ = cv2.findContours(threshold, cv2.RETR_EXTERNAL, cv2.CHAIN_APPROX_SIMPLE) you wont get the error
@elvenkim
@elvenkim Год назад
@@121horaa thanks
@이민준-g3p
@이민준-g3p 3 года назад
How do I set the relay?
@gravityx6773
@gravityx6773 2 года назад
Conveyer belt how much?
@vikrantpatil8478
@vikrantpatil8478 3 года назад
_, contours, _ = cv2.findContours(threshold, cv2.RETR_EXTERNAL, cv2.CHAIN_APPROX_SIMPLE) ValueError: not enough values to unpack (expected 3, got 2) [ WARN:0] global C:\Users unneradmin\AppData\Local\Temp\pip-req-build-1i5nllza\opencv\modules\videoio\src\cap_msmf.cpp (438) `anonymous-namespace'::SourceReaderCB::~SourceReaderCB terminating async callback I got this type of error 🤷‍♂️
@thaniaansaliputriprasetio4421
@thaniaansaliputriprasetio4421 2 года назад
i was got the same error, but its solved with this code contours,hierachy = cv2. findContours(threshold, cv2.RETR_EXTERNAL, cv2.CHAIN_APPROX_SIMPLE)
@isabelavillacis7914
@isabelavillacis7914 2 года назад
Nice video! Do you think we can replicate this using a raspberry zero?
@pysource-com
@pysource-com 2 года назад
I haven't personally tried raspberry pi 0, so I can't guarantee it will work. If you're able to run Opencv thogh, most certainly it's going to work, as the detection is very light. I did this project on a raspberry pi 3 or 4 (i don't remember which one exactly)
@thaniaansaliputriprasetio4421
@thaniaansaliputriprasetio4421 2 года назад
Do we need tensorflow in this project?
@pysource-com
@pysource-com 2 года назад
Nope, this one is basic opencv with python. For more complex detection you would need deep learning (whether with tensorflow, pytorch or other frameworks)
@thaniaansaliputriprasetio4421
@thaniaansaliputriprasetio4421 2 года назад
@@pysource-com okay thanks, but once again, what type measurement on this program? like mm, cm or else?
@muruganbala9217
@muruganbala9217 3 года назад
Very interesting demo....please please do such type of POC demo's....
@prateekgupta3666
@prateekgupta3666 4 года назад
can it detect object on fast moving conyeyor say 5m/sec
@pysource-com
@pysource-com 4 года назад
Yes, with a more powerful device than the raspberry pi you can achieve that results. But it depends also on how you want to detect them and if artificial intelligence needs to be involved
@jshdjdjshs1409
@jshdjdjshs1409 2 года назад
سلام استاد لطفا پروژه ای درمورد سورتینگ رنگ ها از یکدیگر با opencv وماشین لرنینگ بسازید. اگرگرافیکی باشد خیلی عالی میشه. مثل سورتینگ حبوبات ویا سورت برنج
@duvvurujaswanth7410
@duvvurujaswanth7410 4 года назад
Unmasking deep fakes using simple features can I get the Code for this using opencv and python
@mandatoryservice3253
@mandatoryservice3253 3 года назад
I find it. i'm so lucky.
@mandatoryservice3253
@mandatoryservice3253 3 года назад
so thank you bro.
@jorgecalderon3981
@jorgecalderon3981 3 года назад
Great! One question, what's the camera do you use? or which camera do you recommend for image processing where is used more velocity?
@pysource-com
@pysource-com 3 года назад
I used a simple webcam, the logitech c922pro. For high velocity is recommended to use industrial cameras with high FPS, and definitely faster devices than the raspberry pi
@juansebastianarrecheazapat5169
@juansebastianarrecheazapat5169 4 года назад
Good, great work and very good content. I am a student and I have a problem when I execute the code. , contours, _ = cv2.findContours (thershold, cv2.RETR_EXTERNAL, cv2.CHAIN_APPROX_SIMPLE) ValueError: need more than 2 values to unpack? Because this appears to me. Thank you
@ehel
@ehel 4 года назад
I got the same error message. Did you solve it?
@ehel
@ehel 4 года назад
replace the line contours line withe this line and it should work. dont use under line comma at start contours, hierarchy = cv2.findContours(threshold, cv2.RETR_EXTERNAL, cv2.CHAIN_APPROX_SIMPLE)
Далее
Object Tracking with Opencv and Python
30:03
Просмотров 612 тыс.
Свожу все свои тату (abricoss_a_tyt)
00:35
We finally APPROVED @ZachChoi
00:31
Просмотров 3,2 млн
I tried to make a Valorant AI using computer vision
19:23
DIY Laser Image Projector (100ft+ Range!)
20:08
Просмотров 280 тыс.
How 3 Phase Power works: why 3 phases?
14:41
Просмотров 1,1 млн
When you Accidentally Compromise every CPU on Earth
15:59