コード例 #1
0
    def keypoints(self, kps):
        session = Session()
        io_keypoints.to_hdf(self.keypoint_file, keypoints=kps)
        res = session.query(Keypoints).filter(getattr(Keypoints,'image_id') == self['node_id']).first()

        if res is None:
            _ = self.keypoint_file
            res = self._from_db(Keypoints)
        res.nkeypoints = len(kps)
        session.commit()
コード例 #2
0
 def descriptors(self, desc):
     if isinstance(desc, np.array):
         io_keypoints.to_hdf(self.keypoint_file, descriptors=desc)
コード例 #3
0
 def descriptors(self, desc):
     io_keypoints.to_hdf(self.keypoint_file, descriptors=desc)
コード例 #4
0
    keypoints = pd.concat([keypoints, gnd], axis=1)

    footprint_latlon = footprint.generate_latlon_footprint(camera)
    footprint_latlon = footprint_latlon.ExportToWkt()
    if footprint_latlon:
        footprint_latlon = WKTElement(footprint_latlon, srid=config.srid)

    footprint_bodyfixed = footprint.generate_bodyfixed_footprint(camera)
    footprint_bodyfixed = footprint_bodyfixed.ExportToWkt()
    if footprint_bodyfixed:
        footprint_bodyfixed = WKTElement(footprint_bodyfixed)

    # Write the correspondences to disk
    outdir = kwargs.pop('outdir')
    outpath = create_output_path(ds, outdir)
    to_hdf(keypoints, descriptors, outpath)

    # Default response
    data = {'success':False,'path':input_file}

    # Connect to the DB and write
    maxretries = 3

    # Create the DB objs
    camera = pickle.dumps(camera, 2)
    c = Cameras(camera=camera)
    k = Keypoints(path=outpath, nkeypoints=len(keypoints))
    img = Images(name=ds.file_name, path=input_file,
                 footprint_latlon=footprint_latlon,
                 cameras=c,keypoints=k)