27#include "hugin_config.h"
31#include <vigra/basicimageview.hxx>
50 : pano(0), m_autoPreview(
false),m_panoImgSize(1,1),
52 m_pano2erect(0), m_blendMode(BLEND_COPY),
157 DEBUG_DEBUG(
"updating preview after image change");
201 typename vigra::NumericTraits<VT>::RealPromote
217 vigra::RGBValue<float>
operator()(vigra::RGBValue<float>
const&
v)
const
236 DEBUG_DEBUG(
"m_state_rendering == true, aborting rendering");
252 DEBUG_INFO(
"Parent window hidden - not updating");
306 destImageRange(
panoImg), destImage(alpha),
312 vigra::exportImage(vigra::srcImageRange(
panoImg),
exi); \
316 vigra::exportImage(vigra::srcImageRange(alpha),
exi); \
321 vigra::FindAverageAndVariance<float>
mean;
322 vigra::inspectImageIf(vigra::srcImageRange(
panoImg, vigra::RGBToGrayAccessor<vigra::RGBValue<float>>()), vigra::srcImage(alpha),
mean);
323 double min = std::max(
mean.average()-3*
sqrt(
mean.variance()), 1e-6f);
324 double max =
mean.average() + 3 *
sqrt(
mean.variance());
331 vigra::ImageImportInfo::ICCProfile iccProfile;
338 destImageRange(
panoImg), destImage(alpha),
349 destImageRange(
panoImg), destImage(alpha),
360 vigra::exportImage(vigra::srcImageRange(
panoImg),
exi); \
364 vigra::exportImage(vigra::srcImageRange(alpha),
exi); \
375 vigra::functor::Arg1()*vigra::functor::Param(scale));
377 DEBUG_DEBUG(
"LDR output, with response: " <<
src.getResponseType());
380 vigra::functor::Arg1()*vigra::functor::Param(255));
388 typedef std::vector<double> LUT;
390 switch(
src.getResponseType())
400 vigra_fail(
"Unknown or unsupported response function type");
404 for (
size_t i=0;
i < lut.size();
i++)
406 typedef vigra::RGBValue<float>
FRGB;
423 vigra::exportImage(vigra::srcImageRange(
panoImg8),
exi); \
428 }
catch (std::exception & e) {
430 DEBUG_ERROR(
"error during stitching: " << e.what());
483 sz.GetWidth(),
sz.GetHeight());
488 dc.DestroyClippingRegion();
534 dc.DestroyClippingRegion();
541 dc.DestroyClippingRegion();
548 dc.DestroyClippingRegion();
555 dc.DestroyClippingRegion();
563 dc.DestroyClippingRegion();
586 dc.DestroyClippingRegion();
621 DEBUG_DEBUG(
"mousePressLMBEvent: " << e.m_x <<
"x" << e.m_y);
636 DEBUG_DEBUG(
"rotation angles pitch*yaw: " << y <<
" " << p <<
" " << r);
649 DEBUG_DEBUG(
"mousePressRMBEvent: " << e.m_x <<
"x" << e.m_y);
661 DEBUG_DEBUG(
"theta: " <<
theta <<
" phi: " <<
phi <<
" x y z:" << x <<
" " << y <<
" " << z);
680 parentWindow->SetStatusText(
_(
"Left click to define new center point, right click to move point to horizon."),0);
681 parentWindow->SetStatusText(wxString::Format(
"%.1f %.1f", yaw, pitch), 1);
704 for (std::vector<hugin_utils::FDiff2D>::const_iterator
pnt =
points.begin();
708 vigra::Diff2D point =
pnt->toDiff2D();
709 if (point.x < 0) point.x = 0;
710 if (point.y < 0) point.y = 0;
723 : wxXmlResourceHandler()
734 GetPosition(), GetSize(),
vigra::RGBValue< unsigned char > BRGBValue
Contains various routines used for stitching panoramas.
@ RESPONSE_GAMMA
a simple gamma response curve
@ RESPONSE_LINEAR
linear response
@ RESPONSE_EMOR
empirical model of response
create a panorama using the reduce operation on all overlapping pixels.
A stitcher without seaming, just copies the images over each other.
vigra_ext::Interpolator interpolator
void setHeight(unsigned int h)
set panorama height
const std::vector< double > & getProjectionParameters() const
Get the optional projection parameters.
const vigra::Rect2D & getROI() const
void setWidth(unsigned int w, bool keepView=true)
set panorama width keep the HFOV, if keepView=true
void setROI(const vigra::Rect2D &val)
unsigned int getWidth() const
PanoramaOptions::ProjectionFormat getProjection() const
double outputExposureValue
double outputRangeCompression
unsigned int getHeight() const
get panorama height
vigra::Size2D getSize() const
get size of output image
const PanoramaOptions & getOptions() const
returns the options for this panorama
void addObserver(PanoramaObserver *o)
add a panorama observer.
SrcPanoImage getSrcImage(unsigned imgNr) const
get a description of a source image
bool removeObserver(PanoramaObserver *observer)
remove a panorama observer.
UIntSet getActiveImages() const
get active images
void invalidate()
invalidates all images
All variables of a source image.
void setSize(vigra::Size2D val)
Set the image size in pixels.
general : Matrix3 is a class for handling 3x3 Matrix manipulation.
void SetRotationPT(double yaw, double pitch, double roll)
set rotation in panotools style, code adapted from Panotools-Script by Bruno Postle
void GetRotationPT(double &Yaw, double &Pitch, double &Roll)
GetRotation in panotools style.
void addCommand(PanoCommand *command, bool execute=true)
Adds a command to the history.
static GlobalCmdHist & getInstance()
virtual wxObject * DoCreateResource()
virtual bool CanHandle(wxXmlNode *node)
A preview panel that renders the pictures using the panotools library.
HuginBase::Panorama * pano
the model
SmallRemappedImageCache m_remapCache
void mouse2erect(int xm, int ym, double &xd, double &yd)
void panoramaImagesChanged(HuginBase::Panorama &pano, const HuginBase::UIntSet &imgNr)
notifies about changes to images
void Init(PreviewFrame *parent, HuginBase::Panorama *pano)
virtual ~PreviewPanel()
dtor.
PreviewFrame * parentWindow
void OnMouse(wxMouseEvent &e)
vigra::Diff2D m_panoImgSize
void DrawOutline(const std::vector< hugin_utils::FDiff2D > &points, wxDC &dc, int offX, int offY)
HuginBase::PTools::Transform * m_pano2erect
void panoramaChanged(HuginBase::Panorama &pano)
Notification about a Panorama change.
void DrawPreview(wxDC &dc)
void mousePressRMBEvent(wxMouseEvent &e)
void OnPaint(wxPaintEvent &event)
void OnResize(wxSizeEvent &e)
recalculate panorama to fit the panel
void SetAutoUpdate(bool enabled)
bool Create(wxWindow *parent, wxWindowID id=wxID_ANY, const wxPoint &pos=wxDefaultPosition, const wxSize &size=wxDefaultSize, long style=wxTAB_TRAVERSAL, const wxString &name="panel")
void SetBlendMode(BlendMode b)
HuginBase::PanoramaOptions opts
void mousePressLMBEvent(wxMouseEvent &e)
bool HasMonitorProfile() const
return true if we found a suitable monitor profile and could loading it
const wxString & GetXRCPath()
return the current xrc path
static huginApp * Get()
hack.. kind of a pseudo singleton...
#define HUGIN_IMGCACHE_MAPPING_FLOAT
void CorrectImage(wxImage &image, const vigra::ImageImportInfo::ICCProfile &iccProfile, const cmsHPROFILE &monitorProfile)
apply color correction to given image using input iccProfile and monitor profile
std::set< unsigned int > UIntSet
int HuginMessageBox(const wxString &message, const wxString &caption, int style, wxWindow *parent)
void transformImage(SrcImageIterator src_upperleft, SrcImageIterator src_lowerright, SrcAccessor src_acc, DestImageIterator dest_upperleft, DestAccessor dest_acc, const Functor &func)
void createEMoRLUT(const std::vector< float > ¶ms, VECTOR &lut)
void createGammaLUT(double gamma, VECTOR &lut)
void applyMapping(vigra::triple< SrcIterator, SrcIterator, SrcAccessor > img, vigra::pair< DestIterator, DestAccessor > dest, T min, T max, int mapping)
include file for the hugin project
include file for the hugin project
just apply exposure and response to linear data
vigra::NumericTraits< VT >::RealPromote operator()(VT v) const
ExposureResponseFunctor2(double exposure, const OP &operation)
Difference reduce functor.
blend images, by simply stacking them, without soft blending or boundary calculation
vigra::RGBValue< float > operator()(vigra::RGBValue< float > const &v) const
double m_rangeCompression
RangeCompression(double rangeCompression)
functor to apply a LUT to gray and color images.
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.