29 #include <vigra/convolution.hxx>
77 std::vector<vigra::FRGBImage*>& images =
o_images;
81 std::vector<vigra::FImage *> lapImgs;
82 std::vector<vigra::Size2D> origsize;
86 std::vector<InterpolImg> interpolImages;
94 origsize.push_back(simg.getSize());
95 simg.
resize(images[i]->size(), &vars[i]);
99 vigra::FImage * lap =
new vigra::FImage(images[i]->size());
100 lapImgs.push_back(lap);
107 if (!vars[i].empty())
112 #pragma omp parallel for
115 vigra::laplacianOfGaussian(
srcImageRange(*(images[i]), vigra::GreenAccessor<vigra::RGBValue<float> >()),
destImage(*(lapImgs[i])), 1);
142 std::vector<std::multimap<double, vigra_ext::PointPairRGB> > radiusHist(10);
144 unsigned nGoodPoints = 0;
145 unsigned nBadPoints = 0;
160 progress->
setMessage(
"extracting good points");
164 for (
size_t i=0; i < points.size(); i++) {
165 double scaleF1 = origsize[points[i].imgNr1].x / (float) images[points[i].imgNr1]->size().x;
166 double scaleF2 = origsize[points[i].imgNr2].x / (float) images[points[i].imgNr2]->size().x;
167 points[i].p1.x = points[i].p1.x * scaleF1;
168 points[i].p1.y = points[i].p1.y * scaleF1;
169 points[i].p2.x = points[i].p2.x * scaleF2;
170 points[i].p2.y = points[i].p2.y * scaleF2;
173 for (
size_t i=0; i < images.size(); i++) {
LimitIntensity()
default constructor, is identical to LimitIntensity(LIMIT_FLOAT)
vigra_ext::ImageInterpolator< vigra::FRGBImage::const_traverser, vigra::FRGBImage::ConstAccessor, vigra_ext::interp_cubic > InterpolImg
static void sampleRadiusUniform(const std::vector< std::multimap< double, PointPairClass > > &radiusHist, unsigned nPoints, std::vector< PointPairClass > &selectedPoints, AppBase::ProgressDisplay *)
extract some random points out of the bins.
void setHeight(unsigned int h)
set panorama height
float m_minI
internal stored limits
LimitType
some pre-defined limits
virtual void setSrcImage(unsigned int nr, const SrcPanoImage &img)=0
set input image parameters TODO: Propagate changes to linked images.
virtual void cancelAlgorithm()
Call this when the algorithm is cancelled.
"wrapper" for efficient interpolation access to an image
virtual void run()
runs the algorithm.
std::vector< vigra::FRGBImage * > o_images
virtual void samplePoints(const std::vector< InterpolImg > &imgs, const std::vector< vigra::FImage * > &voteImgs, const PanoramaData &pano, const LimitIntensityVector limitI, std::vector< std::multimap< double, vigra_ext::PointPairRGB > > &radiusHist, unsigned &nGoodPoints, unsigned &nBadPoints, AppBase::ProgressDisplay *)=0
virtual bool wasCancelled() const
std::vector< VariableMap > VariableMapVector
LimitIntensityVector m_limits
virtual bool runAlgorithm()
implementation of the algorithm.
virtual AppBase::ProgressDisplay * getProgressDisplay() const
void sampleAndExtractPoints(AppBase::ProgressDisplay *progress)
virtual void setOptions(const PanoramaOptions &opt)=0
set new output settings This is not used directly for optimizing/stiching, but it can be feed into ru...
PointPairs o_resultPoints
virtual double getResultHeight()
void resize(const vigra::Size2D &size, VariableMap *potentialLinkedVars)
"resize" image, adjusts all distortion coefficients for usage with a source image of size size potent...
virtual const PanoramaOptions & getOptions() const =0
returns the options for this panorama
void setMessage(const std::string &message, const std::string &filename="")
sets the message to given string
vigra::pair< typename ROIImage< Image, Alpha >::image_traverser, typename ROIImage< Image, Alpha >::ImageAccessor > destImage(ROIImage< Image, Alpha > &img)
void setROI(const vigra::Rect2D &val)
vigra::triple< typename ROIImage< Image, Mask >::image_const_traverser, typename ROIImage< Image, Mask >::image_const_traverser, typename ROIImage< Image, Mask >::ImageConstAccessor > srcImageRange(const ROIImage< Image, Mask > &img)
helper function for ROIImages
void setHFOV(double h, bool keepView=true)
set the horizontal field of view.
virtual double getResultHorizontalFOV()
PanoramaData & o_panorama
virtual SrcPanoImage getSrcImage(unsigned imgNr) const =0
get a complete description of a source image
virtual std::size_t getNrOfImages() const =0
number of images.
All variables of a source image.
vigra::Size2D getSize() const
get size of output image
virtual void updateVariables(const VariableMapVector &vars)=0
Set the variables.
virtual PanoramaData * getNewCopy() const =0