mirror of
https://github.com/peterbraden/node-opencv.git
synced 2025-12-08 19:45:55 +00:00
Allow args for HoughLinesP
This commit is contained in:
parent
bae5ba1f6f
commit
57ddabd06b
@ -1081,6 +1081,11 @@ Matrix::HoughLinesP(const v8::Arguments& args) {
|
|||||||
HandleScope scope;
|
HandleScope scope;
|
||||||
|
|
||||||
Matrix *self = ObjectWrap::Unwrap<Matrix>(args.This());
|
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;
|
std::vector<cv::Vec4i> lines;
|
||||||
|
|
||||||
cv::Mat gray;
|
cv::Mat gray;
|
||||||
@ -1088,7 +1093,7 @@ Matrix::HoughLinesP(const v8::Arguments& args) {
|
|||||||
|
|
||||||
equalizeHist(self->mat, gray);
|
equalizeHist(self->mat, gray);
|
||||||
// cv::Canny(gray, gray, 50, 200, 3);
|
// 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());
|
v8::Local<v8::Array> arr = v8::Array::New(lines.size());
|
||||||
|
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user