Skip to content

Commit

Permalink
fix pixelX_ to double, add idgcp_, log_ format
Browse files Browse the repository at this point in the history
  • Loading branch information
jmenezes committed Feb 19, 2018
1 parent 1001f48 commit a66f5e0
Show file tree
Hide file tree
Showing 10 changed files with 30 additions and 4 deletions.
25 changes: 25 additions & 0 deletions contrib/shell/odm_exif2utm.sh
@@ -0,0 +1,25 @@
#!/bin/bash
#GPL2 jmenezes ODM extract exif lon/lat project to utm with proj4; 2017-05-28
# line 23 tab bugfix 2017-07-11
# apt-get install exiftool geotiff-bin
if [ $# -lt 2 ]; then
echo "run inside /images/ directory" 1>&2
echo $(basename $0)" zone [S|N] > camera_wgs84utm.txt" 1>&2
exit 1
fi
Z=$1
case $2 in
s|S) printf "EPSG:327%02d\n" $Z; H=south
;;
n|N) printf "EPSG:326%02d\n" $Z; H=north
;;
*)
;;
esac
for i in *[jpg,JPG,tif,TIF]; do
exiftool $i | grep GPS | grep Position | \
awk -F \: -v img=$i '{ print $2","img }' | tr -d [:blank:] | \
sed s/deg/d/g | tr \, \\t | awk '{ print $2,$1,$3 }' | \
proj -f "%.3f" +proj=utm +zone=$Z +$H +ellps=WGS84
done | sed s/\ /\\t/g
exit 0
Empty file modified modules/odm_georef/src/FindTransform.cpp 100644 → 100755
Empty file.
Empty file modified modules/odm_georef/src/FindTransform.hpp 100644 → 100755
Empty file.
8 changes: 4 additions & 4 deletions modules/odm_georef/src/Georef.cpp 100644 → 100755
@@ -1,4 +1,4 @@
// to format log_ output
// to format log_ output; version 2018-02-18
#include <iostream>
#include <iomanip>
using namespace std;
Expand All @@ -19,7 +19,7 @@ std::ostream& operator<<(std::ostream &os, const GeorefSystem &geo)
}

GeorefGCP::GeorefGCP()
:x_(0.0), y_(0.0), z_(0.0), use_(false), localX_(0.0), localY_(0.0), localZ_(0.0),cameraIndex_(0), pixelX_(0.0), pixelY_(0.0), image_("")
:x_(0.0), y_(0.0), z_(0.0), use_(false), localX_(0.0), localY_(0.0), localZ_(0.0),cameraIndex_(0), pixelX_(0.0), pixelY_(0.0), image_(""), idgcp_("")
{
}

Expand All @@ -29,7 +29,7 @@ GeorefGCP::~GeorefGCP()

void GeorefGCP::extractGCP(std::istringstream &gcpStream)
{
gcpStream >> x_ >> y_ >> z_ >> pixelX_ >> pixelY_ >> image_;
gcpStream >> x_ >> y_ >> z_ >> pixelX_ >> pixelY_ >> image_ >> idgcp_;
}

Vec3 GeorefGCP::getPos()
Expand Down Expand Up @@ -687,7 +687,7 @@ void Georef::readGCPs()
++nrGCPs;

// log_<<"x_: "<<gcp.x_<<" y_: "<<gcp.y_<<" z_: "<<gcp.z_<<" pixelX_: "<<gcp.pixelX_<<" pixelY_: "<<gcp.pixelY_<<" image: "<<gcp.image_<<"\n";
log_<< setiosflags(ios::fixed) << setprecision(3) <<"x_: "<< gcp.x_ <<" y_: "<< gcp.y_<<" z_: "<< gcp.z_ <<" pixelX_: "<<gcp.pixelX_<<" pixelY_: "<<gcp.pixelY_<<" image: "<<gcp.image_<<"\n"; // more readeable
log_<< setiosflags(ios::fixed) << setprecision(3) <<"x_: "<< gcp.x_ <<" y_: "<< gcp.y_<<" z_: "<< gcp.z_ <<" pixelX_: "<<gcp.pixelX_<<" pixelY_: "<<gcp.pixelY_<<" image: "<<gcp.image_ <<" idgcp_: " << gcp.idgcp_ << "\n"; // more readeable
}

// Check if the GCPs have corresponding images in the bundle files and if they don't, remove them from the GCP-list
Expand Down
1 change: 1 addition & 0 deletions modules/odm_georef/src/Georef.hpp 100644 → 100755
Expand Up @@ -50,6 +50,7 @@ struct GeorefGCP
double pixelY_; /**< The pixels y-position for the GCP in the corresponding image **/

std::string image_; /**< The corresponding image for the GCP **/
std::string idgcp_; /**< The corresponding identification for the GCP **/

GeorefGCP();
~GeorefGCP();
Expand Down
Empty file modified modules/odm_georef/src/Logger.cpp 100644 → 100755
Empty file.
Empty file modified modules/odm_georef/src/Logger.hpp 100644 → 100755
Empty file.
Empty file modified modules/odm_georef/src/main.cpp 100644 → 100755
Empty file.
Empty file modified modules/odm_georef/src/modifiedPclFunctions.cpp 100644 → 100755
Empty file.
Empty file modified modules/odm_georef/src/modifiedPclFunctions.hpp 100644 → 100755
Empty file.

0 comments on commit a66f5e0

Please sign in to comment.