60 #include <qcheckbox.h> 61 #include <qradiobutton.h> 62 #include <qbuttongroup.h> 63 #include <qpushbutton.h> 64 #include <qlineedit.h> 67 #include <qfiledialog.h> 92 QRadioButton *pCheckBoxColorSkin =
new QRadioButton(
"Skin",
this);
93 pCheckBoxColorSkin->setFixedWidth(200);
94 pCheckBoxColorSkin->move(width + 250, 20);
96 QRadioButton *pCheckBoxColorYellow =
new QRadioButton(
"Yellow",
this);
97 pCheckBoxColorYellow->setFixedWidth(200);
98 pCheckBoxColorYellow->move(width + 250, 45);
100 QRadioButton *pCheckBoxColorOrange =
new QRadioButton(
"Orange",
this);
101 pCheckBoxColorOrange->setFixedWidth(200);
102 pCheckBoxColorOrange->move(width + 250, 70);
104 QRadioButton *pCheckBoxColorRed =
new QRadioButton(
"Red",
this);
105 pCheckBoxColorRed->setFixedWidth(200);
106 pCheckBoxColorRed->move(width + 250, 95);
108 QRadioButton *pCheckBoxColorBlue =
new QRadioButton(
"Blue",
this);
109 pCheckBoxColorBlue->setFixedWidth(200);
110 pCheckBoxColorBlue->move(width + 350, 20);
112 QRadioButton *pCheckBoxColorGreen =
new QRadioButton(
"Green",
this);
113 pCheckBoxColorGreen->setFixedWidth(200);
114 pCheckBoxColorGreen->move(width + 350, 45);
116 QRadioButton *pCheckBoxColorCustom =
new QRadioButton(
"Custom",
this);
117 pCheckBoxColorCustom->setFixedWidth(200);
118 pCheckBoxColorCustom->move(width + 350, 70);
134 #if QT_VERSION >= 0x040000 210 QPushButton *pPrintColorParametersButton =
new QPushButton(
this);
211 pPrintColorParametersButton->setText(
"Print Color Parameters");
212 pPrintColorParametersButton->setFixedHeight(20);
213 pPrintColorParametersButton->setFixedWidth(180);
214 pPrintColorParametersButton->move(width + 20, 190);
216 QPushButton *pLoadColorParametersButton =
new QPushButton(
this);
217 pLoadColorParametersButton->setText(
"Load Color Parameters");
218 pLoadColorParametersButton->setFixedHeight(20);
219 pLoadColorParametersButton->setFixedWidth(180);
220 pLoadColorParametersButton->move(width + 20, 215);
222 QPushButton *pSaveColorParametersButton =
new QPushButton(
this);
223 pSaveColorParametersButton->setText(
"Save Color Parameters");
224 pSaveColorParametersButton->setFixedHeight(20);
225 pSaveColorParametersButton->setFixedWidth(180);
226 pSaveColorParametersButton->move(width + 20, 240);
228 QPushButton *pColorParameterFileBrowseButton =
new QPushButton(
this);
229 pColorParameterFileBrowseButton->setText(
"Browse Color Parameter File");
230 pColorParameterFileBrowseButton->setFixedHeight(20);
231 pColorParameterFileBrowseButton->setFixedWidth(155);
232 pColorParameterFileBrowseButton->move(width + 280, 390);
234 QLabel *pLabelH =
new QLabel(
this);
235 pLabelH->setText(
"H");
236 pLabelH->setFixedWidth(40);
237 pLabelH->setFixedHeight(20);
238 pLabelH->move(width + 210, 130);
240 QLabel *pLabelHTol =
new QLabel(
this);
241 pLabelHTol->setText(
"H Tol");
242 pLabelHTol->setFixedWidth(40);
243 pLabelHTol->setFixedHeight(20);
244 pLabelHTol->move(width + 210, 155);
246 QLabel *pLabelMinS =
new QLabel(
this);
247 pLabelMinS->setText(
"S Min");
248 pLabelMinS->setFixedWidth(40);
249 pLabelMinS->setFixedHeight(20);
250 pLabelMinS->move(width + 210, 180);
252 QLabel *pLabelMaxS =
new QLabel(
this);
253 pLabelMaxS->setText(
"S Max");
254 pLabelMaxS->setFixedWidth(40);
255 pLabelMaxS->setFixedHeight(20);
256 pLabelMaxS->move(width + 210, 205);
258 QLabel *pLabelMinV =
new QLabel(
this);
259 pLabelMinV->setText(
"V Min");
260 pLabelMinV->setFixedWidth(40);
261 pLabelMinV->setFixedHeight(20);
262 pLabelMinV->move(width + 210, 230);
264 QLabel *pLabelMaxV =
new QLabel(
this);
265 pLabelMaxV->setText(
"V Max");
266 pLabelMaxV->setFixedWidth(40);
267 pLabelMaxV->setFixedHeight(20);
268 pLabelMaxV->move(width + 210, 255);
275 #if QT_VERSION >= 0x040000 307 #if QT_VERSION >= 0x040000 324 #if QT_VERSION >= 0x040000 333 printf(
"color parameters: (%i, %i, %i, %i, %i, %i)\n",
m_pSliderColorH->value(),
m_pSliderColorHT->value(),
m_pSliderColorMinS->value(),
m_pSliderColorMaxS->value(),
m_pSliderColorMinV->value(),
m_pSliderColorMaxV->value());
338 #if QT_VERSION >= 0x040000 339 QString
s = QFileDialog::getOpenFileName(
this,tr(
"Choose a file"),
"",tr(
"Text (*.txt)") );
341 QString s = QFileDialog::getOpenFileName(
"",
"Text (*.txt)",
this,
"Open File Dialog",
"Choose a file");
379 if (
id >= 0 &&
id <= 5)
const int * GetColorParameters(ObjectColor color) const
QSlider * m_pSliderColorMinV
bool Dilate(const CByteImage *pInputImage, CByteImage *pOutputImage, int nMaskSize=3, const MyRegion *pROI=0)
Applies a morphological dilate operation to a binary CByteImage and writes the result to a binary CBy...
void SliderValueChanged(int nValue)
Data structure for the representation of 8-bit grayscale images and 24-bit RGB (or HSV) color images ...
CColorParameterSet * m_pColorParameterSet
bool CalculateHSVImage(const CByteImage *pInputImage, CByteImage *pOutputImage, const MyRegion *pROI=0)
Computes the HSV image for a RGB CByteImage and writes the result to a CByteImage.
bool SaveToFile(const char *pFileName)
QSlider * m_pSliderColorMinS
QLineEdit * m_pLineEditColorParameterFile
void SetColorParameters(ObjectColor color, int par1, int par2, int par3, int par4, int par5, int par6)
QButtonGroup * m_pColorButtonGroup
CQTColorParameterWindow(int width, int height)
void DrawImage(const CByteImage *pImage, int x=0, int y=0)
QCheckBox * m_pCheckBoxShowSegmentedImage
const CColorParameterSet * GetColorParameterSet() const
bool LoadFromFile(const char *pFileName)
void SaveColorParametersButtonClicked()
QSlider * m_pSliderColorHT
GLenum GLsizei GLsizei height
QCheckBox * m_pCheckBoxShowRightImage
QSlider * m_pSliderColorMaxS
bool Erode(const CByteImage *pInputImage, CByteImage *pOutputImage, int nMaskSize=3, const MyRegion *pROI=0)
Applies a morphological erode operation to a binary CByteImage and writes the result to a binary CByt...
bool m_bUpdateParameterSet
void LoadColorParametersButtonClicked()
void ColorParameterFileBrowseButtonClicked()
void ColorRadioButtonClicked(int id)
QSlider * m_pSliderColorMaxV
QSlider * m_pSliderColorH
void PrintColorParametersButtonClicked()
bool FilterHSV(const CByteImage *pInputImage, CByteImage *pOutputImage, unsigned char hue, unsigned char tol_hue, unsigned char min_sat, unsigned char max_sat, unsigned char min_v, unsigned char max_v, const MyRegion *pROI=0)
Performs color filtering with binarization for an HSV CByteImage and writes the result to a grayscale...
~CQTColorParameterWindow()
void Update(const CByteImage *const *ppInputImages, int nImages)