Hugin trunk 0.1
Loading...
Searching...
No Matches
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
 
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
 
cmsHPROFILE m_monitorProfile
 monitor profile
 
bool m_hasMonitorProfile
 true, if we found a real monitor profile
 
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

◆ LensCalPreviewMode

Enumerator
mode_original 
mode_edge 
mode_corrected 

Definition at line 41 of file LensCalImageCtrl.h.

Constructor & Destructor Documentation

◆ LensCalImageCtrl()

LensCalImageCtrl::LensCalImageCtrl ( )

Member Function Documentation

◆ DrawView()

void LensCalImageCtrl::DrawView ( )
protected

◆ GenerateRemappedImage()

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

generates the remapped image suitable for wxImage

Definition at line 365 of file LensCalImageCtrl.cpp.

References HuginBase::SrcPanoImage::calcHFOV(), HuginBase::BaseSrcPanoImage::CIRCULAR_FISHEYE, HuginBase::Color::CorrectImage(), HuginBase::PanoramaOptions::CYLINDRICAL, HuginBase::PanoramaOptions::EQUIRECTANGULAR, HuginBase::BaseSrcPanoImage::EQUIRECTANGULAR, HuginBase::PanoramaOptions::EQUISOLID, HuginBase::BaseSrcPanoImage::FISHEYE_EQUISOLID, HuginBase::BaseSrcPanoImage::FISHEYE_ORTHOGRAPHIC, HuginBase::BaseSrcPanoImage::FISHEYE_STEREOGRAPHIC, HuginBase::BaseSrcPanoImage::FISHEYE_THOBY, HuginBase::PanoramaOptions::FULL_FRAME_FISHEYE, HuginBase::BaseSrcPanoImage::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, m_imageLines, m_monitorProfile, m_opts, m_panoimage, m_projection, m_remapped_img, m_remappedImage, HuginBase::PanoramaOptions::ORTHOGRAPHIC, HuginBase::BaseSrcPanoImage::PANORAMIC, HuginBase::PanoramaOptions::RECTILINEAR, HuginBase::BaseSrcPanoImage::RECTILINEAR, HuginBase::PanoramaOptions::setHeight(), HuginBase::PanoramaOptions::setHFOV(), HuginBase::PanoramaOptions::setProjection(), HuginBase::PanoramaOptions::setROI(), HuginBase::SrcPanoImage::setVar(), HuginBase::PanoramaOptions::setWidth(), HuginBase::PanoramaOptions::STEREOGRAPHIC, HuginBase::PanoramaOptions::THOBY_PROJECTION, and threshold().

Referenced by Resize().

◆ GetMode()

const LensCalImageCtrl::LensCalPreviewMode LensCalImageCtrl::GetMode ( )

return actual preview mode

Definition at line 64 of file LensCalImageCtrl.cpp.

References m_previewMode.

Referenced by LensCalFrame::OnSelectPreviewContent().

◆ OnMouseEvent()

void LensCalImageCtrl::OnMouseEvent ( wxMouseEvent e)
protected

◆ OnPaint()

void LensCalImageCtrl::OnPaint ( wxPaintEvent dc)
private

paint event

Definition at line 258 of file LensCalImageCtrl.cpp.

References m_display_img, and threshold().

Referenced by LensCalImageCtrl().

◆ Resize()

void LensCalImageCtrl::Resize ( wxSizeEvent e)
private

◆ SetEdgeImage()

void LensCalImageCtrl::SetEdgeImage ( )
private

converts the edge image into wxImage

Definition at line 346 of file LensCalImageCtrl.cpp.

References ImageLineList::GetEdgeImage(), gray2RGB(), m_edge, m_edgeImage, m_imageLines, Resize(), and threshold().

Referenced by SetImage().

◆ SetEmptyImage()

void LensCalImageCtrl::SetEmptyImage ( )

set preview to empty image

Definition at line 292 of file LensCalImageCtrl.cpp.

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

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

◆ SetImage()

void LensCalImageCtrl::SetImage ( ImageLineList newList,
unsigned int  newIndex 
)

◆ SetLens()

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 320 of file LensCalImageCtrl.cpp.

References m_cropfactor, m_focallength, m_projection, and threshold().

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

◆ SetLensDistortions()

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 327 of file LensCalImageCtrl.cpp.

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

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

◆ SetMode()

void LensCalImageCtrl::SetMode ( const LensCalPreviewMode  newMode)

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

Definition at line 312 of file LensCalImageCtrl.cpp.

References m_previewMode, Resize(), and threshold().

Referenced by LensCalFrame::OnSelectPreviewContent().

◆ SetShowLines()

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

Definition at line 303 of file LensCalImageCtrl.cpp.

References DrawView(), m_showLines, and threshold().

Referenced by LensCalFrame::OnShowLines().

Member Data Documentation

◆ m_a

double LensCalImageCtrl::m_a
private

Definition at line 113 of file LensCalImageCtrl.h.

Referenced by GenerateRemappedImage(), LensCalImageCtrl(), and SetLensDistortions().

◆ m_b

double LensCalImageCtrl::m_b
private

Definition at line 114 of file LensCalImageCtrl.h.

Referenced by GenerateRemappedImage(), LensCalImageCtrl(), and SetLensDistortions().

◆ m_c

double LensCalImageCtrl::m_c
private

Definition at line 115 of file LensCalImageCtrl.h.

Referenced by GenerateRemappedImage(), LensCalImageCtrl(), and SetLensDistortions().

◆ m_cropfactor

double LensCalImageCtrl::m_cropfactor
private

Definition at line 112 of file LensCalImageCtrl.h.

Referenced by GenerateRemappedImage(), LensCalImageCtrl(), and SetLens().

◆ m_d

double LensCalImageCtrl::m_d
private

Definition at line 116 of file LensCalImageCtrl.h.

Referenced by GenerateRemappedImage(), LensCalImageCtrl(), and SetLensDistortions().

◆ m_display_img

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().

◆ m_e

double LensCalImageCtrl::m_e
private

Definition at line 117 of file LensCalImageCtrl.h.

Referenced by GenerateRemappedImage(), LensCalImageCtrl(), and SetLensDistortions().

◆ m_edge

wxImage LensCalImageCtrl::m_edge
private

the edge detect image (resized scale)

Definition at line 91 of file LensCalImageCtrl.h.

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

◆ m_edgeImage

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().

◆ m_focallength

double LensCalImageCtrl::m_focallength
private

Definition at line 111 of file LensCalImageCtrl.h.

Referenced by GenerateRemappedImage(), LensCalImageCtrl(), and SetLens().

◆ m_hasMonitorProfile

bool LensCalImageCtrl::m_hasMonitorProfile
private

true, if we found a real monitor profile

Definition at line 107 of file LensCalImageCtrl.h.

Referenced by GenerateRemappedImage(), LensCalImageCtrl(), and SetImage().

◆ m_imageIndex

unsigned int LensCalImageCtrl::m_imageIndex
private

Definition at line 83 of file LensCalImageCtrl.h.

Referenced by OnMouseEvent(), and SetImage().

◆ m_imageLines

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(), LensCalImageCtrl(), OnMouseEvent(), Resize(), SetEdgeImage(), SetEmptyImage(), and SetImage().

◆ m_img

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().

◆ m_monitorProfile

cmsHPROFILE LensCalImageCtrl::m_monitorProfile
private

monitor profile

Definition at line 105 of file LensCalImageCtrl.h.

Referenced by GenerateRemappedImage(), LensCalImageCtrl(), and SetImage().

◆ m_opts

HuginBase::PanoramaOptions LensCalImageCtrl::m_opts
private

Definition at line 120 of file LensCalImageCtrl.h.

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

◆ m_panoimage

HuginBase::SrcPanoImage LensCalImageCtrl::m_panoimage
private

Definition at line 119 of file LensCalImageCtrl.h.

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

◆ m_previewMode

LensCalPreviewMode LensCalImageCtrl::m_previewMode
private

which image should be drawn

Definition at line 103 of file LensCalImageCtrl.h.

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

◆ m_projection

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

Definition at line 110 of file LensCalImageCtrl.h.

Referenced by GenerateRemappedImage(), LensCalImageCtrl(), and SetLens().

◆ m_remapped_img

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().

◆ m_remappedImage

vigra::BRGBImage LensCalImageCtrl::m_remappedImage
private

the remapped image

Definition at line 89 of file LensCalImageCtrl.h.

Referenced by GenerateRemappedImage().

◆ m_scale

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().

◆ m_scaled_img

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().

◆ m_showLines

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(), LensCalImageCtrl(), and SetShowLines().


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