Skip to content

Commit

Permalink
beta.3 release
Browse files Browse the repository at this point in the history
  • Loading branch information
Kaspar Schmid committed Jun 26, 2015
1 parent ad4634e commit a630e43
Show file tree
Hide file tree
Showing 5 changed files with 59 additions and 38 deletions.
55 changes: 22 additions & 33 deletions IPL/src/processes/IPLHoughLines.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -27,23 +27,22 @@ void IPLHoughLines::init()

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

// inputs and outputs
addInput("Image", IPLData::IMAGE_COLOR);
addOutput("Hough Result", IPLImage::IMAGE_GRAYSCALE);
addOutput("Circle Overlay", IPLImage::IMAGE_COLOR);
addOutput("Circle Positions", IPLImage::POINT);
addOutput("Line Overlay", IPLImage::IMAGE_COLOR);

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

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

// get properties
int thresholdCanny = getProcessPropertyInt("thresholdCanny");
int thresholdCenter = getProcessPropertyInt("thresholdCenter");
int minRadius = getProcessPropertyInt("minRadius");
int maxRadius = getProcessPropertyInt("maxRadius");
int minDist = getProcessPropertyInt("minDist");
double rho = getProcessPropertyDouble("rho");
double theta = getProcessPropertyDouble("theta");
int threshold = getProcessPropertyInt("threshold");
int minLength = getProcessPropertyInt("minLenght");
int maxLineGap = getProcessPropertyInt("maxLineGap");

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

std::vector<cv::Vec3f> circles;
cv::HoughCircles(input, circles, CV_HOUGH_GRADIENT, 2, input.rows/4, thresholdCanny, thresholdCenter, minRadius, maxRadius);

// WARNING: cv::HoughCircles does not work in debug mode!!!
// destroys the std::vector<cv::Vec3f> circles;
std::vector<cv::Vec4i> lines;
cv::HoughLinesP(input, lines, rho, theta, threshold, minLength, maxLineGap);

std::stringstream s;
s << "Circles found: ";
s << circles.size();
s << "Lines found: ";
s << lines.size();
addInformation(s.str());

for(int i = 0; i < circles.size(); i++ )
for(int i = 0; i < lines.size(); i++ )
{
cv::Point center(round(circles[i][0]), round(circles[i][1]));
int radius = cvRound(circles[i][2]);
// circle center
cv::circle(overlay, center, 3, cv::Scalar(0,255,0), -1, 8, 0);
// circle outline
cv::circle(overlay, center, radius, cv::Scalar(0,0,255), 3, 1, 0);
cv::Vec4i l = lines[i];
cv::line(overlay, cv::Point(l[0], l[1]), cv::Point(l[2], l[3]), cv::Scalar(0,0,255), 3, CV_AA);

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

_overlay = new IPLImage(overlay);
Expand All @@ -106,15 +98,12 @@ bool IPLHoughLines::processInputData(IPLImage* image , int, bool useOpenCV)
* \brief IPLHoughLines::getResultData
* index == 0: "Hough Result", IPLImage::IMAGE_GRAYSCALE
* index == 1: "Circle Overlay", IPLImage::IMAGE_COLOR
* index == 2: "Circle Positions", IPLImage::IMAGE_POINT
* \return
*/
IPLData* IPLHoughLines::getResultData(int index)
{
if(index == 0)
return _result;
else if(index == 1)
return _overlay;
else
return _result;
return _overlay;
}
4 changes: 2 additions & 2 deletions ImagePlay/include/MainWindow.h
Original file line number Diff line number Diff line change
Expand Up @@ -50,8 +50,8 @@

#include "IPL_plugininterface.h"

#define IMAGEPLAY_VERSION "6.0.0-beta.2"
#define IMAGEPLAY_BUILDNUMBER "20150402"
#define IMAGEPLAY_VERSION "6.0.0-beta.3"
#define IMAGEPLAY_BUILDNUMBER "20150626"

namespace Ui {
class MainWindow;
Expand Down
2 changes: 2 additions & 0 deletions ImagePlay/src/ImageViewerWindow.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -82,6 +82,8 @@ ImageViewerWindow::ImageViewerWindow(MainWindow *mainWindow) :
// remove titlebar
ui->dockWidget->setTitleBarWidget(new QWidget(this));

ui->comboBoxHistogram->setVisible(false);

QWidget* spacer = new QWidget(this);
spacer->setSizePolicy(QSizePolicy::Expanding, QSizePolicy::Expanding);
ui->toolBar->insertWidget(ui->actionHideSidebar, spacer);
Expand Down
8 changes: 5 additions & 3 deletions ImagePlay/src/MainWindow.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -416,13 +416,15 @@ void MainWindow::loadProcesses()

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

_factory->registerProcess("IPLFloodFill", new IPLFloodFill);
_factory->registerProcess("IPLAccumulate", new IPLAccumulate);
_factory->registerProcess("IPLHoughLines", new IPLHoughLines);
_factory->registerProcess("IPLMatchTemplate", new IPLMatchTemplate);

// not ready:

This comment has been minimized.

Copy link
@drzraf

drzraf Jul 2, 2018

Contributor

@schmk2 , why :) ?

/*_factory->registerProcess("IPLMatchTemplate", new IPLMatchTemplate);
_factory->registerProcess("IPLGoodFeaturesToTrack", new IPLGoodFeaturesToTrack);
_factory->registerProcess("IPLFloodFill", new IPLFloodFill);
_factory->registerProcess("IPProcessScript", new IPProcessScript);
_factory->registerProcess("IPProcessScript", new IPProcessScript);*/
}

void MainWindow::loadPlugins()
Expand Down
28 changes: 28 additions & 0 deletions changelog.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,33 @@
# Change Log

## 6.0.0-beta.3 - 2015-06-26
### Added
- New button to go back from process propeties [ < ]
- New property widget: IPL_WIDGET_GROUP which enables/disables groups of properties (see IPLResize)
- A few new OpenCV implementations
- New events are now called: beforeProcessing and afterProcessing
- New progress indicator for indefinitely long processes, use notifyProgressEventHandler(-1)
- File dialog allows to deactivate file filters.
- Added OpenCV support to the binary morphology process.

### Changed
- Play mode is now automatically started when launching the application

### Fixed
- Fixed IPL_WIDGET_SLIDER, IPL_WIDGET_SLIDER_ODD, IPL_WIDGET_SLIDER_EVEN which failed to update the image
- Added a check for empty kernels to the binary morphology process.
- General stability improvements

### Known Issues
- Mac OS X: Building ImagePlay may produce errors after macdeployqt ../_bin/Release/macx/ImagePlay.app/ -dmg
- those errors only affect the creation of the dmg file, you can still run ImagePlay.app
- Mac OS X: The Image Viewer might only display a small portion of an image.
- Workaround: Load a large image
- Histogram and Zoom might not update correctly.
- While using a IPLCamera, the UI can be pretty unresponsive. Pause to adjust the UI.
- The application may still be unstable, expect crashes (please report them on https://github.com/cpvrlab/ImagePlay/issues)


## 6.0.0-beta.2 - 2015-04-02
### Added
- A first version of the plugin SDK is supplied in /plugin_development/
Expand Down

0 comments on commit a630e43

Please sign in to comment.