38 double x1, y1, x2, y2;
39 if(!
transform1.transformImgCoord(x1, y1, x, y))
47 if(!
transform2.transformImgCoord(x2, y2, x, y))
71 vigra::Rect2D
rect1=estimateOutputROI(pano, opts, img1);
72 vigra::Rect2D
rect2=estimateOutputROI(pano, opts, img2);
83 std::vector<hugin_utils::FDiff2D>
points;
84 for(
int dx=-5; dx<=5; dx++)
86 for(
int dy=-5; dy<=5; dy++)
114 for (HuginBase::CPVector::const_iterator
it =
cp.begin();
it !=
cp.end(); ++
it)
137 if(img1.YawisLinked())
139 for (HuginBase::UIntSet::const_iterator img2 =
imgsWithCp.begin(); img2 !=
imgsWithCp.end(); ++img2)
141 if(img1.YawisLinkedWith(pano.
getImage(*img2)))
158 std::cout <<
"No unconnected images found." << std::endl
159 <<
"No control point added." << std::endl;
162 std::cout << std::endl <<
"Found " <<
imgsToTest.size() <<
" unconnected images." << std::endl;
169 for (HuginBase::UIntSet::const_iterator img =
imgsToTest.begin(); img !=
imgsToTest.end(); ++img)
184 if(img2.YawisLinked())
213 std::cout <<
"Added " << pano.
getCtrlPoints().size() -
cp.size() <<
" control points." << std::endl;
231 if(img1.YawisLinked())
233 if(img1.YawisLinkedWith(pano.
getImage(
j)))
242 for (HuginBase::CPVector::const_iterator
it =
cp.begin();
it !=
cp.end(); ++
it)
244 if(((
it->image1Nr==
i &&
it->image2Nr==
j) ||
245 (
it->image1Nr==
j &&
it->image2Nr==
i) ) &&
257 if(img2.YawisLinked())
281 std::cout << std::endl <<
"Added " << pano.
getCtrlPoints().size() -
cp.size() <<
" control points." << std::endl;
286 std::cout << name <<
": set geometric control points" << std::endl
289 <<
"Usage: " << name <<
" [options] input.pto" << std::endl
291 <<
" Options:" << std::endl
292 <<
" -o, --output=file.pto Output Hugin PTO file. Default: <filename>_geo.pto" << std::endl
293 <<
" -e, --each-overlap By default, geocpset will only work on the overlap" << std::endl
294 <<
" of unconnected images. With this switch it will" << std::endl
295 <<
" work on all overlaps without control points." << std::endl
296 <<
" --minimum-overlap=NUM Take only these images into account where the" << std::endl
297 <<
" overlap is bigger than NUM percent (default 10)." << std::endl
298 <<
" -h, --help Shows this help" << std::endl
339 <<
"Minimum overlap have to be between 1 and 99." << std::endl;
380 std::cerr <<
"error: project file contains only one image" << std::endl
381 <<
"aborting processing" << std::endl;
385 std::cout <<
"Adding geometric control points..." << std::endl;
400 std::cout << std::endl <<
"Written output to " <<
output << std::endl;
definitions of classes to calculate overlap between different images
class for calculating overlap of images
represents a control point
void setROI(const vigra::Rect2D &val)
unsigned int getWidth() const
unsigned int getHeight() const
get panorama height
const SrcPanoImage & getImage(std::size_t nr) const
get a panorama image, counting starts with 0
const PanoramaOptions & getOptions() const
returns the options for this panorama
bool ReadPTOFile(const std::string &filename, const std::string &prefix="")
read pto file from the given filename into Panorama object it does some checks on the file and issues...
unsigned int addCtrlPoint(const ControlPoint &point)
add a new control point.
const CPVector & getCtrlPoints() const
get all control point of this Panorama
bool WritePTOFile(const std::string &filename, const std::string &prefix="")
write data to given pto file
std::size_t getNrOfImages() const
number of images.
All variables of a source image.
bool isInside(vigra::Point2D p, bool ignoreMasks=false) const
check if a coordinate is inside the source image
bool sortByDistance(hugin_utils::FDiff2D p1, hugin_utils::FDiff2D p2)
int main(int argc, char *argv[])
bool CheckAndAddPoint(HuginBase::Panorama &pano, size_t img1, size_t img2, HuginBase::PTools::Transform &transform1, HuginBase::PTools::Transform &transform2, double x, double y)
void SetGeometricControlPointsOverlap(HuginBase::Panorama &pano, const int minOverlap)
void SetGeometricControlPointsUnconnected(HuginBase::Panorama &pano, const int minOverlap)
void AddGeometricControlPoint(HuginBase::Panorama &pano, size_t img1, size_t img2)
std::vector< ControlPoint > CPVector
std::set< unsigned int > UIntSet
std::string GetHuginVersion()
return a string with version numbers
std::string GetOutputFilename(const std::string &out, const std::string &in, const std::string &suffix)
construct output filename, if ouput is known return this value otherwise use the input filename and a...
std::string stripPath(const std::string &filename)
remove the path of a filename (mainly useful for gui display of filenames)
std::string getPathPrefix(const std::string &filename)
Get the path to a filename.
bool set_contains(const _Container &c, const typename _Container::key_type &key)
T squareLength() const
Return the square of the length of the vector.
std::vector< deghosting::BImagePtr > threshold(const std::vector< deghosting::FImagePtr > &inputImages, const double threshold, const uint16_t flags)
Threshold function used for creating alpha masks for images.