Skip to content

Commit

Permalink
Merge pull request #112 from clkao/HoughLinesP-args
Browse files Browse the repository at this point in the history
Allow args for HoughLinesP
  • Loading branch information
peterbraden committed Mar 10, 2014
2 parents bae5ba1 + 57ddabd commit b8ed782
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion src/Matrix.cc
Expand Up @@ -1081,14 +1081,19 @@ Matrix::HoughLinesP(const v8::Arguments& args) {
HandleScope scope;

Matrix *self = ObjectWrap::Unwrap<Matrix>(args.This());
double rho = args.Length() < 1 ? 1 : args[0]->NumberValue();
double theta = args.Length() < 2 ? CV_PI/180 : args[1]->NumberValue();
int threshold = args.Length() < 3 ? 80 : args[2]->Uint32Value();
double minLineLength = args.Length() < 4 ? 30 : args[3]->NumberValue();
double maxLineGap = args.Length() < 5 ? 10 : args[4]->NumberValue();
std::vector<cv::Vec4i> lines;

cv::Mat gray;


equalizeHist(self->mat, gray);
// cv::Canny(gray, gray, 50, 200, 3);
cv::HoughLinesP(gray, lines, 1, CV_PI/180, 80, 30, 10);
cv::HoughLinesP(gray, lines, rho, theta, threshold, minLineLength, maxLineGap);

v8::Local<v8::Array> arr = v8::Array::New(lines.size());

Expand Down

0 comments on commit b8ed782

Please sign in to comment.