Skip to content

Commit

Permalink
correct code tomake pylsd working
Browse files Browse the repository at this point in the history
  • Loading branch information
vestri committed Jun 29, 2016
1 parent 9a89672 commit b796b0f
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 4 deletions.
2 changes: 1 addition & 1 deletion example/example_cv2.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
src = cv2.imread(fullName, cv2.IMREAD_COLOR)
gray = cv2.cvtColor(src, cv2.COLOR_BGR2GRAY)
lines = lsd(gray)
for i in xrange(lines.shape[0]):
for i in range(lines.shape[0]):
pt1 = (int(lines[i, 0]), int(lines[i, 1]))
pt2 = (int(lines[i, 2]), int(lines[i, 3]))
width = lines[i, 4]
Expand Down
2 changes: 1 addition & 1 deletion pylsd/bindings/lsd_ctypes.py
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ def load_lsd_library():
try:
lsdlib = ctypes.cdll[os.path.join(root_dir, libdir, libname)]
return lsdlib
except Exception, e:
except Exception as e:
pass
tmp = os.path.dirname(root_dir)
if tmp == root_dir:
Expand Down
4 changes: 2 additions & 2 deletions pylsd/lsd.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,10 +19,10 @@ def lsd(src):
src = (ctypes.c_double * lens)(*src)
lsdlib.lsdGet(src, ctypes.c_int(rows), ctypes.c_int(cols), temp)

fp = open(temp, 'r')
fp = open('D', 'r')
cnt = fp.read().strip().split(' ')
fp.close()
os.remove(temp)
os.remove('D')

count = int(cnt[0])
dim = int(cnt[1])
Expand Down

1 comment on commit b796b0f

@melissa-bei
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

运行示例文件的时候,会报
image这个错,这里这个txt文件有什么作用呢?

Please sign in to comment.