Hugintrunk  0.1
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
Public Types | Public Member Functions | Protected Member Functions | Private Member Functions | Private Attributes | List of all members
LensCalImageCtrl Class Reference

image previewer for lens calibration GUI More...

#include <LensCalImageCtrl.h>

Inheritance diagram for LensCalImageCtrl:
Inheritance graph

Public Types

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

Public Member Functions

 LensCalImageCtrl ()
 constructor More...
 
void SetImage (ImageLineList *newList, unsigned int newIndex)
 set preview setting to given ImageLineList More...
 
void SetEmptyImage ()
 set preview to empty image More...
 
void SetShowLines (bool showLines)
 
void SetMode (const LensCalPreviewMode newMode)
 set which image (original, edge, remapped/corrected) should be drawn More...
 
const LensCalPreviewMode GetMode ()
 return actual preview mode More...
 
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) More...
 
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) More...
 

Protected Member Functions

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

Private Member Functions

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

Private Attributes

ImageLineListm_imageLines
 struct with filename, edge image and detected lines More...
 
unsigned int m_imageIndex
 
wxImage m_img
 the image to adjust (full scale) More...
 
vigra::BRGBImage m_edgeImage
 the edge image as RGBImage (in m_imageLines the edge image is grayscale (vigra::BImage)) More...
 
vigra::BRGBImage m_remappedImage
 the remapped image More...
 
wxImage m_edge
 the edge detect image (resized scale) More...
 
wxImage m_remapped_img
 the remapped image as wxImage More...
 
wxBitmap m_scaled_img
 the scaled image to save resizing More...
 
wxBitmap m_display_img
 the image to display, e.g. More...
 
float m_scale
 scale factor for scaling from m_img to m_scaled_img More...
 
bool m_showLines
 true, if the lines should be drawn above the image More...
 
LensCalPreviewMode m_previewMode
 which image should be drawn More...
 
cmsHPROFILE m_monitorProfile
 monitor profile More...
 
bool m_hasMonitorProfile
 true, if we found a real monitor profile More...
 
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 38 of file LensCalImageCtrl.h.

Member Enumeration Documentation

Enumerator
mode_original 
mode_edge 
mode_corrected 

Definition at line 41 of file LensCalImageCtrl.h.

Constructor & Destructor Documentation

LensCalImageCtrl::LensCalImageCtrl ( )

Member Function Documentation

void LensCalImageCtrl::DrawView ( )
protected
void LensCalImageCtrl::GenerateRemappedImage ( const unsigned int  newWidth,
const unsigned int  newHeight 
)
private

generates the remapped image suitable for wxImage

Definition at line 376 of file LensCalImageCtrl.cpp.

References HuginBase::SrcPanoImage::calcHFOV(), HuginBase::BaseSrcPanoImage::CIRCULAR_FISHEYE, HuginBase::Color::CorrectImage(), HuginBase::PanoramaOptions::CYLINDRICAL, HuginBase::BaseSrcPanoImage::EQUIRECTANGULAR, HuginBase::PanoramaOptions::EQUIRECTANGULAR, HuginBase::PanoramaOptions::EQUISOLID, HuginBase::BaseSrcPanoImage::FISHEYE_EQUISOLID, HuginBase::BaseSrcPanoImage::FISHEYE_ORTHOGRAPHIC, HuginBase::BaseSrcPanoImage::FISHEYE_STEREOGRAPHIC, HuginBase::BaseSrcPanoImage::FISHEYE_THOBY, HuginBase::BaseSrcPanoImage::FULL_FRAME_FISHEYE, HuginBase::PanoramaOptions::FULL_FRAME_FISHEYE, ImageLineList::GetFilename(), HuginBase::PanoramaOptions::getHeight(), ImageLineList::GetPanoImage(), HuginBase::PanoramaOptions::getROI(), HuginBase::PanoramaOptions::getWidth(), HUGIN_CONV_FILENAME, vigra_ext::INTERP_CUBIC, m_a, m_b, m_c, m_cropfactor, m_d, m_e, m_focallength, m_hasMonitorProfile, vigra_ext::ROIImage< RemapImage, AlphaImage >::m_image, m_imageLines, m_monitorProfile, m_opts, m_panoimage, m_projection, m_remapped_img, m_remappedImage, HuginBase::PanoramaOptions::ORTHOGRAPHIC, HuginBase::BaseSrcPanoImage::PANORAMIC, HuginBase::BaseSrcPanoImage::RECTILINEAR, HuginBase::PanoramaOptions::RECTILINEAR, HuginBase::Nona::RemappedPanoImage< RemapImage, AlphaImage >::remapImage(), HuginBase::PanoramaOptions::setHeight(), HuginBase::PanoramaOptions::setHFOV(), HuginBase::Nona::RemappedPanoImage< RemapImage, AlphaImage >::setPanoImage(), HuginBase::PanoramaOptions::setProjection(), HuginBase::PanoramaOptions::setROI(), HuginBase::SrcPanoImage::setVar(), HuginBase::PanoramaOptions::setWidth(), vigra_ext::srcImageRange(), HuginBase::PanoramaOptions::STEREOGRAPHIC, and HuginBase::PanoramaOptions::THOBY_PROJECTION.

Referenced by Resize().

const LensCalImageCtrl::LensCalPreviewMode LensCalImageCtrl::GetMode ( )

return actual preview mode

Definition at line 65 of file LensCalImageCtrl.cpp.

References m_previewMode.

Referenced by LensCalFrame::OnSelectPreviewContent().

void LensCalImageCtrl::OnMouseEvent ( wxMouseEvent &  e)
protected
void LensCalImageCtrl::OnPaint ( wxPaintEvent &  dc)
private

paint event

Definition at line 269 of file LensCalImageCtrl.cpp.

References m_display_img.

void LensCalImageCtrl::Resize ( wxSizeEvent &  e)
private
void LensCalImageCtrl::SetEdgeImage ( )
private
void LensCalImageCtrl::SetEmptyImage ( )

set preview to empty image

Definition at line 303 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 
)
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 331 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 338 of file LensCalImageCtrl.cpp.

References m_a, m_b, m_c, m_d, m_e, m_previewMode, mode_corrected, 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 323 of file LensCalImageCtrl.cpp.

References m_previewMode, and Resize().

Referenced by LensCalFrame::OnSelectPreviewContent().

void LensCalImageCtrl::SetShowLines ( bool  showLines)
Parameters
showLinestrue, if detected lines should be drawn above the image

Definition at line 314 of file LensCalImageCtrl.cpp.

References DrawView(), and m_showLines.

Referenced by LensCalFrame::OnShowLines().

Member Data Documentation

double LensCalImageCtrl::m_a
private

Definition at line 113 of file LensCalImageCtrl.h.

Referenced by GenerateRemappedImage(), and SetLensDistortions().

double LensCalImageCtrl::m_b
private

Definition at line 114 of file LensCalImageCtrl.h.

Referenced by GenerateRemappedImage(), and SetLensDistortions().

double LensCalImageCtrl::m_c
private

Definition at line 115 of file LensCalImageCtrl.h.

Referenced by GenerateRemappedImage(), and SetLensDistortions().

double LensCalImageCtrl::m_cropfactor
private

Definition at line 112 of file LensCalImageCtrl.h.

Referenced by GenerateRemappedImage(), and SetLens().

double LensCalImageCtrl::m_d
private

Definition at line 116 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 97 of file LensCalImageCtrl.h.

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

double LensCalImageCtrl::m_e
private

Definition at line 117 of file LensCalImageCtrl.h.

Referenced by GenerateRemappedImage(), and SetLensDistortions().

wxImage LensCalImageCtrl::m_edge
private

the edge detect image (resized scale)

Definition at line 91 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 87 of file LensCalImageCtrl.h.

Referenced by SetEdgeImage().

double LensCalImageCtrl::m_focallength
private

Definition at line 111 of file LensCalImageCtrl.h.

Referenced by GenerateRemappedImage(), and SetLens().

bool LensCalImageCtrl::m_hasMonitorProfile
private

true, if we found a real monitor profile

Definition at line 107 of file LensCalImageCtrl.h.

Referenced by GenerateRemappedImage(), and SetImage().

unsigned int LensCalImageCtrl::m_imageIndex
private

Definition at line 83 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 82 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 85 of file LensCalImageCtrl.h.

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

cmsHPROFILE LensCalImageCtrl::m_monitorProfile
private

monitor profile

Definition at line 105 of file LensCalImageCtrl.h.

Referenced by GenerateRemappedImage(), and SetImage().

HuginBase::PanoramaOptions LensCalImageCtrl::m_opts
private

Definition at line 120 of file LensCalImageCtrl.h.

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

HuginBase::SrcPanoImage LensCalImageCtrl::m_panoimage
private

Definition at line 119 of file LensCalImageCtrl.h.

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

LensCalPreviewMode LensCalImageCtrl::m_previewMode
private

which image should be drawn

Definition at line 103 of file LensCalImageCtrl.h.

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

HuginBase::SrcPanoImage::Projection LensCalImageCtrl::m_projection
private

Definition at line 110 of file LensCalImageCtrl.h.

Referenced by GenerateRemappedImage(), and SetLens().

wxImage LensCalImageCtrl::m_remapped_img
private

the remapped image as wxImage

Definition at line 93 of file LensCalImageCtrl.h.

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

vigra::BRGBImage LensCalImageCtrl::m_remappedImage
private

the remapped image

Definition at line 89 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 99 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 95 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 101 of file LensCalImageCtrl.h.

Referenced by DrawView(), and SetShowLines().


The documentation for this class was generated from the following files: