【发布时间】:2016-06-14 07:19:30
【问题描述】:
操作系统:ubuntu
我正在尝试使用 cv 包中的函数检测给定图像中对象的边缘。
首先,我在我的 ubuntu 终端中运行“qlua”。
local cv = reuqire 'cv'
require 'cv'
reuqire 'image'
lena_p = image.load('/home/stone/codes/lena1.jpg')
image.dispaly(lena_p)
cv.rectangle{lena_p,{5,5},{10,10},color = {30,30,180},thickness = 2}
ca_l = cv.Canny{image=limg,threshold=1,threshold=10}
但是,它失败并出现以下错误:
[string "cv.rectangle{lena_p,{5,5},{10,10},color = {30..."]:1: 尝试索引全局 'cv' (一个 nil 值) 堆栈回溯: [string "cv.rectangle{lena_p,{5,5},{10,10},color = {30..."]:1: 在主块 [C]: at 0x7f6be51eaba0
[string "ca_l = cv.Canny{image=limg,threshold=1,thresh..."]:1: 尝试索引全局 'cv' (一个 nil 值) 堆栈回溯: [string "ca_l = cv.Canny{image=limg,threshold=1,thresh..."]:1: 在主块中 [C]:在 0x7feb66429ba0
我的问题是,如何使用 'cv' 包中的函数来检测对象轮廓?
参考: https://github.com/VisionLabs/torch-opencv/tree/master/cv
【问题讨论】:
-
这是实际代码吗?你有 reuqire 而不是 require
-
哦!上帝 !我的错 !我现在改正了。这是实际的代码。
标签: opencv contour object-detection torch canny-operator