Hugintrunk
0.1
|
image previewer for lens calibration GUI More...
#include <LensCalImageCtrl.h>
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 | |
ImageLineList * | m_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 |
image previewer for lens calibration GUI
Definition at line 38 of file LensCalImageCtrl.h.
Enumerator | |
---|---|
mode_original | |
mode_edge | |
mode_corrected |
Definition at line 41 of file LensCalImageCtrl.h.
LensCalImageCtrl::LensCalImageCtrl | ( | ) |
constructor
Definition at line 44 of file LensCalImageCtrl.cpp.
References HuginBase::Color::GetMonitorProfile(), and HuginBase::BaseSrcPanoImage::RECTILINEAR.
|
protected |
draw the view into the offscreen buffer
Definition at line 149 of file LensCalImageCtrl.cpp.
References HuginBase::PTools::Transform::createInvTransform(), ImageLineList::GetLines(), celeste::line, m_display_img, m_imageLines, m_opts, m_panoimage, m_previewMode, m_remapped_img, m_scale, m_scaled_img, m_showLines, mode_corrected, hugin_utils::roundi(), HuginBase::PTools::Transform::transformImgCoord(), HuginLines::valid_line, and HuginLines::valid_line_disabled.
Referenced by OnMouseEvent(), Resize(), and SetShowLines().
|
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().
|
protected |
Definition at line 70 of file LensCalImageCtrl.cpp.
References HuginBase::PTools::Transform::createTransform(), DrawView(), ImageLineList::GetLines(), m_imageIndex, m_imageLines, m_opts, m_panoimage, m_previewMode, m_scale, mode_corrected, hugin_utils::roundi(), ImageLineList::SetLines(), HuginBase::PTools::Transform::transformImgCoord(), HuginLines::valid_line, and HuginLines::valid_line_disabled.
|
private |
|
private |
resize event, recalculates the offscreen buffer
Definition at line 221 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().
|
private |
converts the edge image into wxImage
Definition at line 357 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 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 | ||
) |
set preview setting to given ImageLineList
Definition at line 284 of file LensCalImageCtrl.cpp.
References HuginBase::Color::CorrectImage(), ImageLineList::GetFilename(), HUGIN_CONV_FILENAME, imageCacheEntry2wxImage(), m_hasMonitorProfile, m_imageIndex, m_imageLines, m_img, m_monitorProfile, 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 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 | ) |
showLines | true, 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().
|
private |
Definition at line 113 of file LensCalImageCtrl.h.
Referenced by GenerateRemappedImage(), and SetLensDistortions().
|
private |
Definition at line 114 of file LensCalImageCtrl.h.
Referenced by GenerateRemappedImage(), and SetLensDistortions().
|
private |
Definition at line 115 of file LensCalImageCtrl.h.
Referenced by GenerateRemappedImage(), and SetLensDistortions().
|
private |
Definition at line 112 of file LensCalImageCtrl.h.
Referenced by GenerateRemappedImage(), and SetLens().
|
private |
Definition at line 116 of file LensCalImageCtrl.h.
Referenced by GenerateRemappedImage(), and SetLensDistortions().
|
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().
|
private |
Definition at line 117 of file LensCalImageCtrl.h.
Referenced by GenerateRemappedImage(), and SetLensDistortions().
|
private |
the edge detect image (resized scale)
Definition at line 91 of file LensCalImageCtrl.h.
Referenced by Resize(), SetEdgeImage(), and SetEmptyImage().
|
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().
|
private |
Definition at line 111 of file LensCalImageCtrl.h.
Referenced by GenerateRemappedImage(), and SetLens().
|
private |
true, if we found a real monitor profile
Definition at line 107 of file LensCalImageCtrl.h.
Referenced by GenerateRemappedImage(), and SetImage().
|
private |
Definition at line 83 of file LensCalImageCtrl.h.
Referenced by OnMouseEvent(), and SetImage().
|
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().
|
private |
the image to adjust (full scale)
Definition at line 85 of file LensCalImageCtrl.h.
Referenced by Resize(), SetEmptyImage(), and SetImage().
|
private |
monitor profile
Definition at line 105 of file LensCalImageCtrl.h.
Referenced by GenerateRemappedImage(), and SetImage().
|
private |
Definition at line 120 of file LensCalImageCtrl.h.
Referenced by DrawView(), GenerateRemappedImage(), and OnMouseEvent().
|
private |
Definition at line 119 of file LensCalImageCtrl.h.
Referenced by DrawView(), GenerateRemappedImage(), and OnMouseEvent().
|
private |
which image should be drawn
Definition at line 103 of file LensCalImageCtrl.h.
Referenced by DrawView(), GetMode(), OnMouseEvent(), Resize(), SetLensDistortions(), and SetMode().
|
private |
Definition at line 110 of file LensCalImageCtrl.h.
Referenced by GenerateRemappedImage(), and SetLens().
|
private |
the remapped image as wxImage
Definition at line 93 of file LensCalImageCtrl.h.
Referenced by DrawView(), GenerateRemappedImage(), and SetEmptyImage().
|
private |
the remapped image
Definition at line 89 of file LensCalImageCtrl.h.
Referenced by GenerateRemappedImage().
|
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().
|
private |
the scaled image to save resizing
Definition at line 95 of file LensCalImageCtrl.h.
Referenced by DrawView(), and Resize().
|
private |
true, if the lines should be drawn above the image
Definition at line 101 of file LensCalImageCtrl.h.
Referenced by DrawView(), and SetShowLines().