8000 I don't know what the problem is · Issue #6 · frotms/line_detector · GitHub
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content 8000
I don't know what the problem is #6
Open
@binfsuc

Description

@binfsuc

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions

      0