Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Project ground control point to image error #1770

Closed
bugracoskun opened this issue Jun 28, 2024 · 1 comment
Closed

Project ground control point to image error #1770

bugracoskun opened this issue Jun 28, 2024 · 1 comment

Comments

@bugracoskun
Copy link

Hello, actually it is similar to https://community.opendronemap.org/t/project-ground-control-point-to-image/12088
I am trying to project gcp to image. Here is my code:

import sys
sys.path.insert(0,'..')
import math
from opensfm import dataset,geo

base_path = "data_path"
# load
data = dataset.DataSet(base_path)
rec = data.load_reconstruction()[0]
# run the projections

imgName = "image_name"

shot = rec.shots[imgName]

# project
im  = data.load_image(imgName)
h, w, _ = im.shape
cam = shot.camera
# reference lla
refLLA = [lat,lon,0]
poi = [gcp_lat,gcp_lon, gcp_alt] 
reference = geo.TopocentricConverter(refLLA[0], refLLA[1], refLLA[2])
pt3D= reference.to_topocentric(float(poi[0]), float(poi[1]),float(poi[2]))

pt2D = shot.project(pt3D)
pt2D_px = cam.normalized_to_pixel_coordinates(pt2D)

x = pt2D_px[0]
y = pt2D_px[1]
print("x:",x, "y:",y)

I am using the reconstruction.json file in opensfm folder. But there is also another reconstruction files. reconstruction.topocentric.json and undistorted/reconstruction.json but, I am using in the main folder in opensfm.

Some images projects are really good but some of them are really bad. I need a stable solution. What should i do ?

Here is the process options:

{
            name: "matcher-neighbors",
            value: "2",
          },
          {
            name: "radiometric-calibration",
            value: "camera",
          },
          {
            name: "pc-geometric",
            value: "false",
          },
          {
            name: "dem-resolution",
            value: "5",
          },
          {
            name: "orthophoto-resolution",
            value: "5",
          },
          {
            name: "min-num-features",
            value: "30000",
          },
          {
            name: "skip-orthophoto",
            value: "false",
          },
          {
            name: "skip-3dmodel",
            value: "true",
          },
          {
            name: "dsm",
            value: "false",
          },
          {
            name: "dtm",
            value: "false",
          },
          {
            name: "skip-report",
            value: "false",
          }
@pierotofy
Copy link
Member

Could we move this conversation over to the forum at https://community.opendronemap.org? 🙏 The forum is the right place to ask questions (we try to keep the GitHub issue tracker for feature requests and bugs only). Thank you! 👍

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants