Skip to content

Commit a630e43

Browse files
author
Kaspar Schmid
committed
beta.3 release
1 parent ad4634e commit a630e43

File tree

5 files changed

+59
-38
lines changed

5 files changed

+59
-38
lines changed

IPL/src/processes/IPLHoughLines.cpp

Lines changed: 22 additions & 33 deletions
Original file line numberDiff line numberDiff line change
@@ -27,23 +27,22 @@ void IPLHoughLines::init()
2727

2828
// basic settings
2929
setClassName("IPLHoughLines");
30-
setTitle("Circle Hough Transform");
30+
setTitle("Hough Lines");
3131
setCategory(IPLProcess::CATEGORY_OBJECTS);
3232
setOpenCVSupport(IPLOpenCVSupport::OPENCV_ONLY);
33-
setDescription("The circle Hough Transform (CHT) is a feature extraction technique for detecting circles.");
33+
setDescription("Finds lines in a binary image using the standard Hough transform.");
3434

3535
// inputs and outputs
3636
addInput("Image", IPLData::IMAGE_COLOR);
3737
addOutput("Hough Result", IPLImage::IMAGE_GRAYSCALE);
38-
addOutput("Circle Overlay", IPLImage::IMAGE_COLOR);
39-
addOutput("Circle Positions", IPLImage::POINT);
38+
addOutput("Line Overlay", IPLImage::IMAGE_COLOR);
4039

4140
// properties
42-
addProcessPropertyInt("thresholdCanny", "Threshold 1", "Upper threshold for the internal Canny edge detector", 200, IPL_WIDGET_SLIDER, 1, 200);
43-
addProcessPropertyInt("thresholdCenter", "Threshold 2", "Threshold for center detection", 100, IPL_WIDGET_SLIDER, 1, 200);
44-
addProcessPropertyInt("minRadius", "Min. Radius", "", 1, IPL_WIDGET_SLIDER, 1, 1000);
45-
addProcessPropertyInt("maxRadius", "Max. Radius", "", 5, IPL_WIDGET_SLIDER, 1, 1000);
46-
addProcessPropertyInt("minDist", "Min. Distance", "", 100, IPL_WIDGET_SLIDER, 1, 1000);
41+
addProcessPropertyDouble("rho", "Rho", "Distance resolution of the accumulator in pixels", 1, IPL_WIDGET_SLIDER, 0, 10);
42+
addProcessPropertyDouble("theta", "Min. Radius", "Angle resolution of the accumulator in radians.", 0.01, IPL_WIDGET_SLIDER, 0, 5.14);
43+
addProcessPropertyInt("threshold", "Threshold", "Accumulator threshold parameter.", 0, IPL_WIDGET_SLIDER, 1, 1000);
44+
addProcessPropertyInt("minLenght", "Min. Length", "", 1, IPL_WIDGET_SLIDER, 1, 1000);
45+
addProcessPropertyInt("maxLineGap", "Max. Line Gap", "", 1, IPL_WIDGET_SLIDER, 1, 1000);
4746
}
4847

4948
void IPLHoughLines::destroy()
@@ -59,11 +58,11 @@ bool IPLHoughLines::processInputData(IPLImage* image , int, bool useOpenCV)
5958
_overlay = NULL;
6059

6160
// get properties
62-
int thresholdCanny = getProcessPropertyInt("thresholdCanny");
63-
int thresholdCenter = getProcessPropertyInt("thresholdCenter");
64-
int minRadius = getProcessPropertyInt("minRadius");
65-
int maxRadius = getProcessPropertyInt("maxRadius");
66-
int minDist = getProcessPropertyInt("minDist");
61+
double rho = getProcessPropertyDouble("rho");
62+
double theta = getProcessPropertyDouble("theta");
63+
int threshold = getProcessPropertyInt("threshold");
64+
int minLength = getProcessPropertyInt("minLenght");
65+
int maxLineGap = getProcessPropertyInt("maxLineGap");
6766

6867
notifyProgressEventHandler(-1);
6968
cv::Mat input;
@@ -72,28 +71,21 @@ bool IPLHoughLines::processInputData(IPLImage* image , int, bool useOpenCV)
7271
result = cv::Scalar(0);
7372
cvtColor(image->toCvMat(), input, CV_BGR2GRAY);
7473

75-
std::vector<cv::Vec3f> circles;
76-
cv::HoughCircles(input, circles, CV_HOUGH_GRADIENT, 2, input.rows/4, thresholdCanny, thresholdCenter, minRadius, maxRadius);
77-
78-
// WARNING: cv::HoughCircles does not work in debug mode!!!
79-
// destroys the std::vector<cv::Vec3f> circles;
74+
std::vector<cv::Vec4i> lines;
75+
cv::HoughLinesP(input, lines, rho, theta, threshold, minLength, maxLineGap);
8076

8177
std::stringstream s;
82-
s << "Circles found: ";
83-
s << circles.size();
78+
s << "Lines found: ";
79+
s << lines.size();
8480
addInformation(s.str());
8581

86-
for(int i = 0; i < circles.size(); i++ )
82+
for(int i = 0; i < lines.size(); i++ )
8783
{
88-
cv::Point center(round(circles[i][0]), round(circles[i][1]));
89-
int radius = cvRound(circles[i][2]);
90-
// circle center
91-
cv::circle(overlay, center, 3, cv::Scalar(0,255,0), -1, 8, 0);
92-
// circle outline
93-
cv::circle(overlay, center, radius, cv::Scalar(0,0,255), 3, 1, 0);
84+
cv::Vec4i l = lines[i];
85+
cv::line(overlay, cv::Point(l[0], l[1]), cv::Point(l[2], l[3]), cv::Scalar(0,0,255), 3, CV_AA);
9486

9587
// raw result
96-
cv::circle(result, center, radius, cv::Scalar(255), -1);
88+
cv::line(result, cv::Point(l[0], l[1]), cv::Point(l[2], l[3]), cv::Scalar(255), 1, CV_AA);
9789
}
9890

9991
_overlay = new IPLImage(overlay);
@@ -106,15 +98,12 @@ bool IPLHoughLines::processInputData(IPLImage* image , int, bool useOpenCV)
10698
* \brief IPLHoughLines::getResultData
10799
* index == 0: "Hough Result", IPLImage::IMAGE_GRAYSCALE
108100
* index == 1: "Circle Overlay", IPLImage::IMAGE_COLOR
109-
* index == 2: "Circle Positions", IPLImage::IMAGE_POINT
110101
* \return
111102
*/
112103
IPLData* IPLHoughLines::getResultData(int index)
113104
{
114105
if(index == 0)
115106
return _result;
116-
else if(index == 1)
117-
return _overlay;
118107
else
119-
return _result;
108+
return _overlay;
120109
}

ImagePlay/include/MainWindow.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -50,8 +50,8 @@
5050

5151
#include "IPL_plugininterface.h"
5252

53-
#define IMAGEPLAY_VERSION "6.0.0-beta.2"
54-
#define IMAGEPLAY_BUILDNUMBER "20150402"
53+
#define IMAGEPLAY_VERSION "6.0.0-beta.3"
54+
#define IMAGEPLAY_BUILDNUMBER "20150626"
5555

5656
namespace Ui {
5757
class MainWindow;

ImagePlay/src/ImageViewerWindow.cpp

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -82,6 +82,8 @@ ImageViewerWindow::ImageViewerWindow(MainWindow *mainWindow) :
8282
// remove titlebar
8383
ui->dockWidget->setTitleBarWidget(new QWidget(this));
8484

85+
ui->comboBoxHistogram->setVisible(false);
86+
8587
QWidget* spacer = new QWidget(this);
8688
spacer->setSizePolicy(QSizePolicy::Expanding, QSizePolicy::Expanding);
8789
ui->toolBar->insertWidget(ui->actionHideSidebar, spacer);

ImagePlay/src/MainWindow.cpp

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -416,13 +416,15 @@ void MainWindow::loadProcesses()
416416

417417
_factory->registerProcess("IPLLabelBlobs", new IPLLabelBlobs);
418418

419-
_factory->registerProcess("IPLFloodFill", new IPLFloodFill);
420419
_factory->registerProcess("IPLAccumulate", new IPLAccumulate);
421420
_factory->registerProcess("IPLHoughLines", new IPLHoughLines);
422-
_factory->registerProcess("IPLMatchTemplate", new IPLMatchTemplate);
421+
422+
// not ready:
423+
/*_factory->registerProcess("IPLMatchTemplate", new IPLMatchTemplate);
423424
_factory->registerProcess("IPLGoodFeaturesToTrack", new IPLGoodFeaturesToTrack);
425+
_factory->registerProcess("IPLFloodFill", new IPLFloodFill);
424426
425-
_factory->registerProcess("IPProcessScript", new IPProcessScript);
427+
_factory->registerProcess("IPProcessScript", new IPProcessScript);*/
426428
}
427429

428430
void MainWindow::loadPlugins()

changelog.md

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,33 @@
11
# Change Log
22

3+
## 6.0.0-beta.3 - 2015-06-26
4+
### Added
5+
- New button to go back from process propeties [ < ]
6+
- New property widget: IPL_WIDGET_GROUP which enables/disables groups of properties (see IPLResize)
7+
- A few new OpenCV implementations
8+
- New events are now called: beforeProcessing and afterProcessing
9+
- New progress indicator for indefinitely long processes, use notifyProgressEventHandler(-1)
10+
- File dialog allows to deactivate file filters.
11+
- Added OpenCV support to the binary morphology process.
12+
13+
### Changed
14+
- Play mode is now automatically started when launching the application
15+
16+
### Fixed
17+
- Fixed IPL_WIDGET_SLIDER, IPL_WIDGET_SLIDER_ODD, IPL_WIDGET_SLIDER_EVEN which failed to update the image
18+
- Added a check for empty kernels to the binary morphology process.
19+
- General stability improvements
20+
21+
### Known Issues
22+
- Mac OS X: Building ImagePlay may produce errors after macdeployqt ../_bin/Release/macx/ImagePlay.app/ -dmg
23+
- those errors only affect the creation of the dmg file, you can still run ImagePlay.app
24+
- Mac OS X: The Image Viewer might only display a small portion of an image.
25+
- Workaround: Load a large image
26+
- Histogram and Zoom might not update correctly.
27+
- While using a IPLCamera, the UI can be pretty unresponsive. Pause to adjust the UI.
28+
- The application may still be unstable, expect crashes (please report them on https://github.com/cpvrlab/ImagePlay/issues)
29+
30+
331
## 6.0.0-beta.2 - 2015-04-02
432
### Added
533
- A first version of the plugin SDK is supplied in /plugin_development/

0 commit comments

Comments
 (0)