Hugin trunk 0.1
Loading...
Searching...
No Matches
LensCalImageCtrl.h
Go to the documentation of this file.
1// -*- c-basic-offset: 4 -*-
11/* This is free software; you can redistribute it and/or
12 * modify it under the terms of the GNU General Public
13 * License as published by the Free Software Foundation; either
14 * version 2 of the License, or (at your option) any later version.
15 *
16 * This software is distributed in the hope that it will be useful,
17 * but WITHOUT ANY WARRANTY; without even the implied warranty of
18 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
19 * Lesser General Public License for more details.
20 *
21 * You should have received a copy of the GNU General Public
22 * License along with this software. If not, see
23 * <http://www.gnu.org/licenses/>.
24 *
25 */
26
27#ifndef LensCalImageCtrl_H
28#define LensCalImageCtrl_H
29
31#include <lcms2.h>
32#include "lines/FindLines.h"
33#include "LensCalTypes.h"
34
38class LensCalImageCtrl : public wxPanel
39{
40public:
50 void SetImage(ImageLineList* newList, unsigned int newIndex);
52 void SetEmptyImage();
56 void SetShowLines(bool showLines);
64 void SetLensDistortions(const double newA, const double newB, const double newC, const double newD, const double newE);
65
66protected:
68 void DrawView();
70
71private:
73 void Resize ( wxSizeEvent & e );
75 void OnPaint(wxPaintEvent & dc);
77 void SetEdgeImage();
79 void GenerateRemappedImage(const unsigned int newWidth,const unsigned int newHeight);
80
83 unsigned int m_imageIndex;
87 vigra::BRGBImage m_edgeImage;
89 vigra::BRGBImage m_remappedImage;
99 float m_scale;
108
109 // some actual lens parameters
113 double m_a;
114 double m_b;
115 double m_c;
116 double m_d;
117 double m_e;
118 // SrcPanoImage and PanoramaOptions to calculate remapped image and transform lines
121
123};
124
126class LensCalImageCtrlXmlHandler : public wxXmlResourceHandler
127{
129
130public:
132 virtual wxObject *DoCreateResource();
133 virtual bool CanHandle(wxXmlNode *node);
134};
135
136#endif // LensCalImageCtrl_H
declaration of functions for finding lines
declaration of helper class for LensCal
Panorama image options.
All variables of a source image.
xrc handler for LensCalImageCtrl
virtual bool CanHandle(wxXmlNode *node)
virtual wxObject * DoCreateResource()
image previewer for lens calibration GUI
LensCalPreviewMode m_previewMode
which image should be drawn
void SetShowLines(bool showLines)
void DrawView()
draw the view into the offscreen buffer
void SetMode(const LensCalPreviewMode newMode)
set which image (original, edge, remapped/corrected) should be drawn
LensCalImageCtrl()
constructor
wxBitmap m_scaled_img
the scaled image to save resizing
wxImage m_img
the image to adjust (full scale)
HuginBase::PanoramaOptions m_opts
HuginBase::SrcPanoImage::Projection m_projection
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)
void OnPaint(wxPaintEvent &dc)
paint event
HuginBase::SrcPanoImage m_panoimage
wxBitmap m_display_img
the image to display, e.g.
float m_scale
scale factor for scaling from m_img to m_scaled_img
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)
cmsHPROFILE m_monitorProfile
monitor profile
wxImage m_remapped_img
the remapped image as wxImage
vigra::BRGBImage m_edgeImage
the edge image as RGBImage (in m_imageLines the edge image is grayscale (vigra::BImage))
unsigned int m_imageIndex
const LensCalPreviewMode GetMode()
return actual preview mode
void SetEdgeImage()
converts the edge image into wxImage
vigra::BRGBImage m_remappedImage
the remapped image
void Resize(wxSizeEvent &e)
resize event, recalculates the offscreen buffer
void SetImage(ImageLineList *newList, unsigned int newIndex)
set preview setting to given ImageLineList
ImageLineList * m_imageLines
struct with filename, edge image and detected lines
void SetEmptyImage()
set preview to empty image
void OnMouseEvent(wxMouseEvent &e)
void GenerateRemappedImage(const unsigned int newWidth, const unsigned int newHeight)
generates the remapped image suitable for wxImage
bool m_hasMonitorProfile
true, if we found a real monitor profile
wxImage m_edge
the edge detect image (resized scale)
bool m_showLines
true, if the lines should be drawn above the image
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.
Definition threshold.h:41