Basics of ARUCO marker | OpenCV | Dronekit | Raspberry pi | Python | Computer Vision | Drones
HTML-код
- Опубликовано: 16 сен 2024
- This video is all about getting started with ARUCO markers. Step by step guide to develop amazing computer vision based Robotics applications.
-------------------------------------------------------------------------------------------------------------------------
Github: Camera calibration (code)
github.com/pun...
Github: test.py code
github.com/pun...
Opencv:
docs.opencv.or...
-----------------------------------------------------------------------------------------------------------------------------
Buy this amazing drone courses
1. Drone Programming Primer:
dojofordrones....
2. How to Build a Raspberry Pi Drone:
dojofordrones....
3. Drone Delivery and Precision Landing:
dojofordrones....
---------------------------------------------------------------------------------------------------------------------------------------------
For daily updates, you can catch me up on
Instagram: www.instagram....
Telegram group - t.me/joinchat/...
Instagram Droid - ...
Twitter- In...
For more videos subscribe to the channel....
I'm using Python 3.11.2 and OpenCV 4.7.0
The code as presented here wouldn't work until updated to this...
import numpy as np
import cv2
from cv2 import aruco
cap = cv2.VideoCapture(0)
dictionary = aruco.getPredefinedDictionary(cv2.aruco.DICT_4X4_250)
while(True):
#Capture frame-by-frame
ret, frame = cap.read()
# Our operations on the frame come here
gray = cv2.cvtColor(frame, cv2.COLOR_BGR2GRAY)
parameters = aruco.DetectorParameters()
detector = aruco.ArucoDetector(dictionary, parameters)
corners, ids, rejectedImgPoints = detector.detectMarkers(gray)
frame_markers = aruco.drawDetectedMarkers (frame.copy(), corners, ids)
cv2.imshow('Aruco Markers', frame_markers)
if cv2.waitKey(1) & 0xFF == ord('q'):
break
cap.release()
cv2.destroyAllWindows()
Great Sir
Thank you 🤘🏻
Superb bhaiya 👍
Thank you 🤘🏻
Very good
Thank you ❤
💯
Thank you 🤘🏻
Your videos are probably good unfortunately I can’t hear you with the background music, it is more of a blinding of your voice and work
Hello,
Thank you, i am improving the voice in upcoming videos
Hello can i use a 3G HSDPA USB Sim Module for a raspberry pi to make an unlimited range drone? And do you have any videos to further assist me with?
Yes you can use, but i suggest you to use 4g/5g modules . Yes I'll be making a video on this after precision landing for drone delivery video which is the upcoming video next week
@@PankajMali okay nice, which 4G module would you recommend?
You can go with thr rpi pi internet hat or else a wifi router i have jiofi
Please..please..turn the music dubbing down. Your voice is naturally difficult to follow and one has toxsrrain to hear you over your music. You don't need the music. What you are talking about is excellent and that is enough. The music doesn't add value at all, in fact it's detrimental. Followingcthat.Following that.. please slow down just a little bit. Thanks for your videos !! I'll continue to watch.
Yeah thank you craig ....I'll update it for next videos
Hello sir, I want to use mavlink messages to send the drone to a specific distance ahead or right/left but according to the documentation now mavlink only supports absolute coordinate system. so, how to do this now???
Hii sudhanshu ,
Can you please elaborate your use case
Hello ,
Yes you are correct mavlink dronekit api supports relative global position int for navigation.
If you wannna control the drone behaviour by passing comands in meters or mm in any heading then you have to convert this input distance to cordinate system.
Below snippet of code is for reference to make the drone in a square pattern similarly you can modify or write a conversion function wihich will directly convert the distance to lat and long with respect to current Lat long
Please copy this use any editor for better understanding,
Code snippet for conversion of actual distance to relative global frame coordinate
def square_calculation(side_length):
"""
This function will generate the geographical coordinates (latitudes & longitudes) of the square path with the given side length. The origin or reference location for the generation of the square trajectory is the vehicle's current location.
Inputs:
1. side_length - Side length of the square
"""
# Vehicle's heading and current location
angle = int(vehicle.heading)
loc = (vehicle.location.global_frame.lat, vehicle.location.global_frame.lon, vehicle.location.global_relative_frame.alt)
# Declaring a array variable to store
# the geogrpahical location of square
Points final_location = [] for count in
range(4):
new_loc = destination_location(homeLattitude = loc[0], homeLongitude = loc[1], distance = side_length, bearing = angle)
final_location.append((new_loc[0],
new_loc[1], loc[2])) loc = (new_loc[0],
new_loc[1], loc[2]) # Incrementing
heading angle angle += 90 return
final_location def square_mission(side_length):
"""
This function retrieves the square coordinates from the square_calculation() function and guides the vehicle to the retrieved points.
Inputs:
1. side_length - Side length of the square
"""
# Retrieving the array of the locations of the square path
locations = square_calculation(side_length = side_length)
for location in locations:
# Send vehicle to the destination
send_to(latitude = location[0], longitude = location[1], altitude = location[2])
while True:
# Distance between the current location of the vehicle and the destination
distance = distance_calculation(homeLattitude = vehicle.location.global_frame.lat, homeLongitude = vehicle.location.global_frame.lon, destinationLattitude = location[0], destinationLongitude = location[1])
if distance
Check this link here i have used flynow api for the navigation of the drone without GPS
instagram.com/tv/CCGcSaXHM9g/?igshid=NDk5N2NlZjQ=
@@PankajMali thanks a lot sir for help 😁😀
I keep getting this: "AttributeError: module 'cv2.aruco' has no attribute 'DetectorPrameters_create'" is there any way to resolve this?
Hello,
If cv2.aruco is not found, try installing opencv-contrib-python, such as by running the following (for the default Python installation):
pip install opencv-contrib-python
Or for a specific Python installation (in this case Python 3)
python3 -m pip install opencv-contrib-python
Then try re-running the script trying to access cv2.aruco.
@@PankajMali Thank you for the reply, very late, but still thank you very much for replying. I am not sure I remember what i was doing with that project honestly lol. I think your comment will come in handy later when i might use it again. 👍
Can you help me please ?? Please
Hello,
Yeah, whats the error?