Generate ArUco Markers for Detection and Pose Estimation with OpenCV in Python

Video Statistics and Information

Video
Captions Word Cloud
Reddit Comments
Captions
so in this video here we're going to generate our Roku markers with opencv so arugula markers can actually be used for a large different gun things so we have these markers here in the top right corner so we can actually generate different kind of like aruka markers well methods in osv to do that and then we can act like do detection and even post estimation on these arugo like based on their orientation like rotation translation um if they're tilted and so on and then we can use that to actually generate some augmented reality applications and projects in opencv and it's actually really easy to set up we only need like a couple of functions but I'm going to create a couple of videos here showing you guys how we can actually use the aruka markers within ohmsv to create these applications and projects but first of all remember the Subscribe button and the notification under the video only 10 of you guys watching these videos here are actually subscribe to the channel it's just the same click and it helps me and the YouTube channel out in a massive way you can also sign up and enroll in my Opus V GPU course if you want to like speed up your computer vision applications and projects uh if you're only using the CPU we're only able to like run a couple of frames per seconds but if you're utilizing the TPU with ohms V4 computer vision applications we can actually like make them run in real time so that's a really nice course and it can be useful for a lot of different kind of like real live applications so thank you guys so we're gonna jump straight into the code first of all I'm just going to go over the lines of code we also have like an aruko a dictionary here where we can create all these different types of root codes and then we can actually just call them at the generate from osv I'm going to show you how to do that in this second then it will generate our root grows and then we can use that to pass into other functions where we connect like both detect our rokules where are they where you like to like assign an ID to them so we can like for example like track where are the specific rookos in the image so we know like exactly where that Roku is that can be used for a lot of different around things and it's very useful information to know like where is this exact a Roku in the image it's really important for computer vision applications and projects and then in the in the upcoming videos we're going to see how we can actually detect these rookos and we're also going to do Post estimation where we're going to draw like um a 3D coordinate system on top of our Roku so we can actually detect and then we can do it on live so we're going to open up a camera then we're going to do live post estimation of these Roku and that is really crazy it can be used for a lot of augmented reality applications and projects within computer vision so that is going to be a really cool video that we're going to do first of all here we're importing numpy and opencv so CV2 and then we're going to create this aruko dictionary where we basically just have all the different kind of like aruka markers that is available in opencv I just created this dictionary here again all the code for my videos is available on my GitHub so just go down to description and you will find the link to my GitHub you can go in there just cover basic code and use it in your own projects and applications so here we have our direct dictionary of our rokos these are really that um that interesting we have like four by four or five by five and up till 7x7 area codes and then we have the different kind of like sizes of our rokos as well so we're just going to generate a couple of different root codes in this um in this video here and then we're going to use them in the next video so down here we need to specify first the real code type that we want to generate so let's just go up here and start with a small one first of all so we're going to take this big 4x4 and then we have a size of 1000 and then we can also assign an ID to that aruko if we for example want to generate uh additional or like more um of this exact same Roku or like different rookos we can also assign an ID to them so we can then save them into a folder if you want to have like a full loop generating these arukos then we'll need to like assign an ID to each of them so we have these unique rookos in our folder basically here we need to set up our aruko dictionary first of all we'll just go inside cv2.everuko so this is a new module within ohmsv that we haven't discovered before so we have cv2.rugo.dictionary get and then we basically just pass in the dictionary type so we have our real go type inside of our dictionary which will be our Roku addict so when we pass this one in here we will act like just go up here we'll take this dictionary and then it will return this value here and this is basically just a number for like getting the correct a ruko dictionary in opencv and then we just return that and set that equal to our real code dictionary which we need to like pass into our drawer marker and then we can also just write our markers directly as in PNG so here first of all we're getting our aruko dictionary and then we can draw the Maga here with ohms V2 so we're basically just drawing our um drawing our marker on top of an empty numpy arrays containing cereal so here we have the attack size we need to set that so right now we're using a tag size of 1000 we're just bring out what type and what id are we using and then we create our attack here which will contain like zeros here nump High zero so we initialize and Matrix with the attack size by attack size so this is basically just a 1000 by 1000 uh ruko marker that we're going to create and then we just have one dimension because we have just a PNG image where we have these white and black pixels and then we just set it the D type here equal to unassigned 8-bit integer and now we can basically just draw our marker here so on top of our Tech we will basically just draw this thick oral aruko marker that we specified up here at the top we also pass in the ID the tag size and also the tag so this is the the empty numpad I re-initialized with zeros and then we basically just draw our markers on top of that then our image or our arugo marker will be stored in this tag variable here we just specify attack name we use MRI tracks like generate our arugo marker we pass in the attack name and then we also pass in the tag which is our arugo marker and then we're just going to show it here with with ohms visible so it takes exact same thing as we're saving to the folder with arugula markers which will be the exact same thing that we're going to show here um in the window with ohms V we're going to have a weight key so we just wait until we have a key until we'll terminate the program and then we destroy all the windows so now we can basically just run this program here and see the results so now we can see we have this a real code tag here it will be the four by four and then the size here will be 1 000 then we can just try to like play around with it and try some other different kind of values we can also take this five by five to 50. we're just going to copy paste it you can just run the program here again and now it will actually just do this type of review marker here which is five by five and then we have 250 by 250. before we do that we actually need to specify we need to change this variable here as well so the size will be 200 250 by 250 instead of 1000 because we have this a Roku type here up at the top now so here we just run it again with the id1 and then we can basically see that we just create this new arugo attack here with another dimension if you just go up into the folder here we can now see all the things that we have in our Rooker marker so here we can see all the things that we have um that we have saved and it will also save it with both the tag size and also the ID that we're assigned to our aruka marker so this can be with a lot of different gun things right now we're just going to generate them in the next couple of videos we're actually going to do detection with a live camera of these different camera like rookos here on my calibration board and then we're also going to do Post estimation so this is going to be really cool and it can be used for a lot of different kind of things as I mentioned in the start of the video so thanks for watching this video here and again remember to subscribe button and notification under the video and also like this video here if you like the content and you want more in future it just helps me and YouTube channel out in a massive way I'm just doing this computer vision tutorial here where we go over like all the basic stuff about like computer vision like the theory behind some of the methods we're doing camera calibrations television and so on so if you're interested in the whole tutorial I'll link to it up here or else on the cnx paragraphs bye for now
Info
Channel: Nicolai Nielsen
Views: 14,387
Rating: undefined out of 5
Keywords: aruco opencv, aruco, aruco opencv detection, aruco detection, aruco detection opencv, aruco opencv python, how to detect aruco markers in python, opencv detection, aruco computer vision, opencv python, opencv, aruco calibration opencv, aruco marker detection python, aruco marker calibration, aruco camera calibration, aruco pose estimation, generate aruco, generate aruco marker python, pose estimation opencv, pose estimation aruco, pose estimation aruco opencv, pose estimation
Id: sg1bVJBjbng
Channel Id: undefined
Length: 8min 10sec (490 seconds)
Published: Thu Oct 20 2022
Related Videos
Note
Please note that this website is currently a work in progress! Lots of interesting data and statistics to come.