LensCalImageCtrl Class Reference

image previewer for lens calibration GUI More...

#include <LensCalImageCtrl.h>

List of all members.

Public Types

enum  LensCalPreviewMode { mode_original = 0, mode_edge = 1, mode_corrected = 2 }

Public Member Functions

 LensCalImageCtrl ()
 constructor
void SetImage (ImageLineList *newList, unsigned int newIndex)
 set preview setting to given ImageLineList
void SetEmptyImage ()
 set preview to empty image
void SetShowLines (bool showLines)
void SetMode (const LensCalPreviewMode newMode)
 set which image (original, edge, remapped/corrected) should be drawn
const LensCalPreviewMode GetMode ()
 return actual preview mode
void SetLens (const HuginBase::SrcPanoImage::Projection newProjection, const double newFocallength, const double newCropfactor)
 updates the internal values of the lens (needed only for remapped image)
void SetLensDistortions (const double newA, const double newB, const double newC, const double newD, const double newE)
 updates the internal values of the lens distortions parameters (needed only for remapped image)

Protected Member Functions

void DrawView ()
 draw the view into the offscreen buffer
void OnMouseEvent (wxMouseEvent &e)

Private Member Functions

void Resize (wxSizeEvent &e)
 resize event, recalculates the offscreen buffer
void OnPaint (wxPaintEvent &dc)
 paint event
void SetEdgeImage ()
 converts the edge image into wxImage
void GenerateRemappedImage (const unsigned int newWidth, const unsigned int newHeight)
 generates the remapped image suitable for wxImage

Private Attributes

ImageLineListm_imageLines
 struct with filename, edge image and detected lines
unsigned int m_imageIndex
wxImage m_img
 the image to adjust (full scale)
vigra::BRGBImage m_edgeImage
 the edge image as RGBImage (in m_imageLines the edge image is grayscale (vigra::BImage))
vigra::BRGBImage m_remappedImage
 the remapped image
wxImage m_edge
 the edge detect image (resized scale)
wxImage m_remapped_img
 the remapped image as wxImage
wxBitmap m_scaled_img
 the scaled image to save resizing
wxBitmap m_display_img
 the image to display, e.g.
float m_scale
 scale factor for scaling from m_img to m_scaled_img
bool m_showLines
 true, if the lines should be drawn above the image
LensCalPreviewMode m_previewMode
 which image should be drawn
HuginBase::SrcPanoImage::Projection m_projection
double m_focallength
double m_cropfactor
double m_a
double m_b
double m_c
double m_d
double m_e
HuginBase::SrcPanoImage m_panoimage
HuginBase::PanoramaOptions m_opts


Detailed Description

image previewer for lens calibration GUI

Definition at line 37 of file LensCalImageCtrl.h.


Member Enumeration Documentation

enum LensCalImageCtrl::LensCalPreviewMode
 

Enumeration values:
mode_original 
mode_edge 
mode_corrected 

Definition at line 40 of file LensCalImageCtrl.h.

Referenced by GetMode().


Constructor & Destructor Documentation

LensCalImageCtrl::LensCalImageCtrl  ) 
 

constructor

Definition at line 43 of file LensCalImageCtrl.cpp.


Member Function Documentation

void LensCalImageCtrl::DrawView  )  [protected]
 

draw the view into the offscreen buffer

Definition at line 143 of file LensCalImageCtrl.cpp.

References HuginBase::PTools::Transform::createInvTransform(), ImageLineList::GetLines(), m_display_img, m_imageLines, m_opts, m_panoimage, m_previewMode, m_remapped_img, m_scale, m_scaled_img, hugin_utils::roundi(), and HuginBase::PTools::Transform::transformImgCoord().

Referenced by OnMouseEvent(), Resize(), and SetShowLines().

void LensCalImageCtrl::GenerateRemappedImage const unsigned int  newWidth,
const unsigned int  newHeight
[private]
 

generates the remapped image suitable for wxImage

Definition at line 358 of file LensCalImageCtrl.cpp.

References HuginBase::SrcPanoImage::calcHFOV(), ImageLineList::GetFilename(), HuginBase::PanoramaOptions::getHeight(), ImageLineList::GetPanoImage(), HuginBase::PanoramaOptions::getROI(), HuginBase::PanoramaOptions::getWidth(), HUGIN_CONV_FILENAME, m_a, m_b, m_c, m_cropfactor, m_d, m_e, m_focallength, m_imageLines, m_opts, m_panoimage, m_projection, m_remapped_img, m_remappedImage, HuginBase::BaseSrcPanoImage::setExifCropFactor(), HuginBase::BaseSrcPanoImage::setExifFocalLength(), HuginBase::BaseSrcPanoImage::setExposureValue(), HuginBase::PanoramaOptions::setHeight(), HuginBase::PanoramaOptions::setHFOV(), HuginBase::BaseSrcPanoImage::setHFOV(), HuginBase::PanoramaOptions::setProjection(), HuginBase::BaseSrcPanoImage::setProjection(), HuginBase::PanoramaOptions::setROI(), HuginBase::SrcPanoImage::setVar(), and HuginBase::PanoramaOptions::setWidth().

Referenced by Resize().

const LensCalImageCtrl::LensCalPreviewMode LensCalImageCtrl::GetMode  ) 
 

return actual preview mode

Definition at line 59 of file LensCalImageCtrl.cpp.

References LensCalPreviewMode.

Referenced by LensCalFrame::OnSelectPreviewContent().

void LensCalImageCtrl::OnMouseEvent wxMouseEvent &  e  )  [protected]
 

Definition at line 64 of file LensCalImageCtrl.cpp.

References HuginBase::PTools::Transform::createTransform(), DrawView(), ImageLineList::GetLines(), m_imageIndex, m_imageLines, m_opts, m_panoimage, m_previewMode, m_scale, hugin_utils::roundi(), ImageLineList::SetLines(), and HuginBase::PTools::Transform::transformImgCoord().

void LensCalImageCtrl::OnPaint wxPaintEvent &  dc  )  [private]
 

paint event

Definition at line 263 of file LensCalImageCtrl.cpp.

References m_display_img.

void LensCalImageCtrl::Resize wxSizeEvent &  e  )  [private]
 

resize event, recalculates the offscreen buffer

Definition at line 215 of file LensCalImageCtrl.cpp.

References DrawView(), GenerateRemappedImage(), m_display_img, m_edge, m_imageLines, m_img, m_previewMode, m_scale, m_scaled_img, mode_corrected, mode_edge, mode_original, and hugin_utils::roundi().

Referenced by SetEdgeImage(), SetEmptyImage(), SetImage(), SetLensDistortions(), and SetMode().

void LensCalImageCtrl::SetEdgeImage  )  [private]
 

converts the edge image into wxImage

Definition at line 339 of file LensCalImageCtrl.cpp.

References vigra_ext::destImage(), ImageLineList::GetEdgeImage(), gray2RGB(), m_edge, m_edgeImage, m_imageLines, Resize(), vigra_ext::srcImageRange(), and vigra_ext::transformImage().

Referenced by SetImage().

void LensCalImageCtrl::SetEmptyImage  ) 
 

set preview to empty image

Definition at line 285 of file LensCalImageCtrl.cpp.

References m_edge, m_imageLines, m_img, m_remapped_img, and Resize().

Referenced by LensCalFrame::OnImageSelected(), and LensCalFrame::~LensCalFrame().

void LensCalImageCtrl::SetImage ImageLineList newList,
unsigned int  newIndex
 

set preview setting to given ImageLineList

Definition at line 272 of file LensCalImageCtrl.cpp.

References ImageLineList::GetFilename(), HUGIN_CONV_FILENAME, imageCacheEntry2wxImage(), m_imageIndex, m_imageLines, m_img, Resize(), and SetEdgeImage().

Referenced by LensCalFrame::OnImageSelected().

void LensCalImageCtrl::SetLens const HuginBase::SrcPanoImage::Projection  newProjection,
const double  newFocallength,
const double  newCropfactor
 

updates the internal values of the lens (needed only for remapped image)

Definition at line 313 of file LensCalImageCtrl.cpp.

References m_cropfactor, m_focallength, and m_projection.

Referenced by LensCalFrame::OnFindLines(), and LensCalFrame::OnRefresh().

void LensCalImageCtrl::SetLensDistortions const double  newA,
const double  newB,
const double  newC,
const double  newD,
const double  newE
 

updates the internal values of the lens distortions parameters (needed only for remapped image)

Definition at line 320 of file LensCalImageCtrl.cpp.

References m_a, m_b, m_c, m_d, m_e, m_previewMode, and Resize().

Referenced by LensCalFrame::OnRefresh(), and LensCalFrame::Optimize().

void LensCalImageCtrl::SetMode const LensCalPreviewMode  newMode  ) 
 

set which image (original, edge, remapped/corrected) should be drawn

Definition at line 305 of file LensCalImageCtrl.cpp.

References m_previewMode, and Resize().

Referenced by LensCalFrame::OnSelectPreviewContent().

void LensCalImageCtrl::SetShowLines bool  showLines  ) 
 

Parameters:
showLines true, if detected lines should be drawn above the image

Definition at line 296 of file LensCalImageCtrl.cpp.

References DrawView(), and m_showLines.

Referenced by LensCalFrame::OnShowLines().


Member Data Documentation

double LensCalImageCtrl::m_a [private]
 

Definition at line 108 of file LensCalImageCtrl.h.

Referenced by GenerateRemappedImage(), and SetLensDistortions().

double LensCalImageCtrl::m_b [private]
 

Definition at line 109 of file LensCalImageCtrl.h.

Referenced by GenerateRemappedImage(), and SetLensDistortions().

double LensCalImageCtrl::m_c [private]
 

Definition at line 110 of file LensCalImageCtrl.h.

Referenced by GenerateRemappedImage(), and SetLensDistortions().

double LensCalImageCtrl::m_cropfactor [private]
 

Definition at line 107 of file LensCalImageCtrl.h.

Referenced by GenerateRemappedImage(), and SetLens().

double LensCalImageCtrl::m_d [private]
 

Definition at line 111 of file LensCalImageCtrl.h.

Referenced by GenerateRemappedImage(), and SetLensDistortions().

wxBitmap LensCalImageCtrl::m_display_img [private]
 

the image to display, e.g.

with lines, in wxPanel resolution

Definition at line 96 of file LensCalImageCtrl.h.

Referenced by DrawView(), OnPaint(), and Resize().

double LensCalImageCtrl::m_e [private]
 

Definition at line 112 of file LensCalImageCtrl.h.

Referenced by GenerateRemappedImage(), and SetLensDistortions().

wxImage LensCalImageCtrl::m_edge [private]
 

the edge detect image (resized scale)

Definition at line 90 of file LensCalImageCtrl.h.

Referenced by Resize(), SetEdgeImage(), and SetEmptyImage().

vigra::BRGBImage LensCalImageCtrl::m_edgeImage [private]
 

the edge image as RGBImage (in m_imageLines the edge image is grayscale (vigra::BImage))

Definition at line 86 of file LensCalImageCtrl.h.

Referenced by SetEdgeImage().

double LensCalImageCtrl::m_focallength [private]
 

Definition at line 106 of file LensCalImageCtrl.h.

Referenced by GenerateRemappedImage(), and SetLens().

unsigned int LensCalImageCtrl::m_imageIndex [private]
 

Definition at line 82 of file LensCalImageCtrl.h.

Referenced by OnMouseEvent(), and SetImage().

ImageLineList* LensCalImageCtrl::m_imageLines [private]
 

struct with filename, edge image and detected lines

Definition at line 81 of file LensCalImageCtrl.h.

Referenced by DrawView(), GenerateRemappedImage(), OnMouseEvent(), Resize(), SetEdgeImage(), SetEmptyImage(), and SetImage().

wxImage LensCalImageCtrl::m_img [private]
 

the image to adjust (full scale)

Definition at line 84 of file LensCalImageCtrl.h.

Referenced by Resize(), SetEmptyImage(), and SetImage().

HuginBase::PanoramaOptions LensCalImageCtrl::m_opts [private]
 

Definition at line 115 of file LensCalImageCtrl.h.

Referenced by DrawView(), GenerateRemappedImage(), and OnMouseEvent().

HuginBase::SrcPanoImage LensCalImageCtrl::m_panoimage [private]
 

Definition at line 114 of file LensCalImageCtrl.h.

Referenced by DrawView(), GenerateRemappedImage(), and OnMouseEvent().

LensCalPreviewMode LensCalImageCtrl::m_previewMode [private]
 

which image should be drawn

Definition at line 102 of file LensCalImageCtrl.h.

Referenced by DrawView(), OnMouseEvent(), Resize(), SetLensDistortions(), and SetMode().

HuginBase::SrcPanoImage::Projection LensCalImageCtrl::m_projection [private]
 

Definition at line 105 of file LensCalImageCtrl.h.

Referenced by GenerateRemappedImage(), and SetLens().

wxImage LensCalImageCtrl::m_remapped_img [private]
 

the remapped image as wxImage

Definition at line 92 of file LensCalImageCtrl.h.

Referenced by DrawView(), GenerateRemappedImage(), and SetEmptyImage().

vigra::BRGBImage LensCalImageCtrl::m_remappedImage [private]
 

the remapped image

Definition at line 88 of file LensCalImageCtrl.h.

Referenced by GenerateRemappedImage().

float LensCalImageCtrl::m_scale [private]
 

scale factor for scaling from m_img to m_scaled_img

Definition at line 98 of file LensCalImageCtrl.h.

Referenced by DrawView(), OnMouseEvent(), and Resize().

wxBitmap LensCalImageCtrl::m_scaled_img [private]
 

the scaled image to save resizing

Definition at line 94 of file LensCalImageCtrl.h.

Referenced by DrawView(), and Resize().

bool LensCalImageCtrl::m_showLines [private]
 

true, if the lines should be drawn above the image

Definition at line 100 of file LensCalImageCtrl.h.

Referenced by SetShowLines().


The documentation for this class was generated from the following files:
Generated on Tue Sep 2 01:25:50 2014 for Hugintrunk by  doxygen 1.3.9.1