Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

I don't know what the problem is #6

Open
binfsuc opened this issue Oct 21, 2020 · 0 comments
Open

I don't know what the problem is #6

binfsuc opened this issue Oct 21, 2020 · 0 comments

Comments

@binfsuc
Copy link

binfsuc commented Oct 21, 2020

input image:
3
my code:
int w = img.cols;
int h = img.rows;
boundingbox_t bbox = { 0,0,w,h };
float scaleX = 0.8;
float scaleY = 0.8;
std::vector<line_float_t> lines;

cv::Point2f pt1, pt2;
cv::Mat result = cv::Mat::zeros(h, w, CV_8UC3);

unsigned char * pImg = img.ptr<uchar>(0);

int ret = LsdLineDetector(pImg, w, h, scaleX, scaleY, bbox, lines);
if (ret < 1)
{		
	for (int i = 0; i < lines.size(); i++)
	{
		line_float_t line = lines[i];
		pt1.x = line.startx;
		pt1.y = line.starty;
		pt2.x = line.endx;
		pt2.y = line.endy;
		int width = 2;
		cv::Scalar color(rand() & 255, rand() & 255, rand() & 255);
		cv::line(result, pt1, pt2, color, width, CV_AA);
		
	}
}
imshow("img", result);
waitKey();

result:
QQ截图20201021162744

question:
I am sure to load a gray image, but the result is not good, what is the problem? parameter?
it is seemed that filter image by gauss can make a good result.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant