Giter VIP home page Giter VIP logo

roboflow / dji-aerial-georeferencing Goto Github PK

View Code? Open in Web Editor NEW
160.0 9.0 26.0 1.45 MB

Detect objects in drone videos and plot them on a map

Home Page: https://blog.roboflow.com/georeferencing-drone-videos/

License: Apache License 2.0

HTML 6.34% JavaScript 83.70% SCSS 1.15% Handlebars 8.81%
aerial-image-detection aerial-imagery computer-vision dji drone georeferencing machine-learning mapbox object-detection roboflow

dji-aerial-georeferencing's People

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

dji-aerial-georeferencing's Issues

handle cases where the pitch value is different from -90

        center = Point([self.observation["longitude"], self.observation["latitude"]])  # Convert longitude and latitude to GeoJSON Point
        altitude = float(self.observation["ascent(feet)"]) * 0.3048  # Convert ascent to meters
        fov_atan = math.tan(self.fov)
        diagonal_distance = altitude * fov_atan
        distance = diagonal_distance / 2
        bearing = (float(self.observation["compass_heading(degrees)"]) - 90) % 360 # Calculate bearing
        offset = math.atan(self.video_height / self.video_width) * 180 / math.pi  # Calculate offset based on video resolution

        # Calculate GPS coordinates of the video's four corners
        options = {'units': 'm'}
        self.top_left = rhumb_destination(center, distance, (bearing - offset + 180) % 360 - 180, options).geometry.coordinates
        self.top_left = self.top_left[:: -1]

        self.top_right = rhumb_destination(center, distance, (bearing + offset + 180) % 360 - 180,options).geometry.coordinates
        self.top_right = self.top_right[:: -1]

        self.bottom_right = rhumb_destination(center, distance, (bearing - offset) % 360 - 180, options).geometry.coordinates
        self.bottom_right = self.bottom_right[:: -1]

        self.bottom_left = rhumb_destination(center, distance, (bearing + offset) % 360 - 180, options).geometry.coordinates
        self.bottom_left = self.bottom_left[:: -1]

        # print the GPS coordinates of the video's four corners
        self.current_position = [self.observation["latitude"], self.observation["longitude"]]

        normalized = [self.dy - self.video_height / 2, self.dx- self.video_width / 2]
        distanceFromCenterInPixels = math.sqrt((self.video_width / 2 - self.dx) ** 2 + (self.video_height / 2 - self.dy) ** 2)
        diagonalDistanceInPixels = math.sqrt(self.video_width ** 2 + self.video_height ** 2)
        percentOfDiagonal = distanceFromCenterInPixels / diagonalDistanceInPixels
        distance = percentOfDiagonal * diagonal_distance  # in meters
        angle = math.atan(normalized[0] / (normalized[1] or 0.000001)) * 180 / math.pi
        # if the detection is in the right half of the frame, we need to rotate it 180 degrees

        if normalized[1] >= 0:
            angle += 180

        point = rhumb_destination(center, distance, (bearing + angle) % 360, options).geometry.coordinates
        point = point[:: -1]
       

Certainly! Isuccessfully rewritten the code in Python, and it's functioning well when the gimbal pitch is set to -90. If I want to extend the functionality to handle cases where the pitch value is different from -90, what should I do ?

How to accomodate for camer tilit ?

Thanks for ope-sourcing your work.
I have a question regarding camera movement for your current implementation you are assuming that camera is looking down thus drone's position will always be in the center of image but how can we adjust the position error when our drone is looking at an angle.
If possible can you also recommend any book or resource.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.