OpenCV线段检测器

时间:2017-05-30 17:38:55

标签: python python-2.7 opencv opencv3.2

根据LSD class reference,默认构造函数位于# encoding: utf-8 # module cv2.line_descriptor # from /Users/****/anaconda/lib/python2.7/site-packages/cv2.so # by generator 1.144 # no doc # no imports # Variables with simple values DrawLinesMatchesFlags_DEFAULT = 0 DrawLinesMatchesFlags_DRAW_OVER_OUTIMG = 1 DrawLinesMatchesFlags_NOT_DRAW_SINGLE_LINES = 2 DRAW_LINES_MATCHES_FLAGS_DEFAULT = 0 DRAW_LINES_MATCHES_FLAGS_DRAW_OVER_OUTIMG = 1 DRAW_LINES_MATCHES_FLAGS_NOT_DRAW_SINGLE_LINES = 2 # no functions # no classes 下。但是看一下模块就可以看出它的内容。

val df = Seq(
  (1, "T1", "v1"),
  (1, "T11", "v11"),
  (2, "T2", "v2")
).toDF(
  "id", "type", "val"
).as[(Int, String, String)]

val df2 = df.groupBy("id").pivot("type").agg(concat_ws(",", collect_list("val")))

df2.show
+---+---+---+---+
| id| T1|T11| T2|
+---+---+---+---+
|  1| v1|v11|   |
|  2|   |   | v2|
+---+---+---+---+

xfeatures2d的研究也没有结果。

虽然根据this示例,该模块确实存在。我在哪里可以在Python中找到这个模块?

我正在使用OpenCV 3.2.0

1 个答案:

答案 0 :(得分:4)

根据OpenCv 3.0 doc,它是

$ cat tst.awk
BEGIN { FS=","; re="(.{8})(.{6})(.*)" }
{
    match($2,re,beg)
    match($3,re,end)
    for (i=beg[2]; i<=end[2]; i++) {
        printf "%s%06d%s\n", end[1], i, end[3]
    }
}

$ gawk -f tst.awk file
353458082243570
353458082243580
353458082462440
353458082462450
353458082069130
353458082069140
353458082246230
353458082246240
353458082559320
353458082559330
353458080153530
353458080153540
353458082462670
353458082462680
353458081943950
353458081943960
353458081719070
353458081719080
353458081392470
353458081392480
353458081392490

http://docs.opencv.org/3.0-beta/modules/imgproc/doc/feature_detection.html#createlinesegmentdetector