尝试索引全球' cv' (零值)

时间:2016-06-14 07:19:30

标签: opencv contour object-detection torch canny-operator

操作系统:ubuntu

我试图使用cv包中的函数检测给定图像中对象的边缘。

首先,我跑了qlua'在我的ubuntu终端。

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' (一个零值)堆栈追溯:[string" cv.rectangle {lena_p,{5,5},{10,10},color = {30 ..."]:1:在主块中[C]:在0x7f6be51eaba0

     

[string" ca_l = cv.Canny {image = limg,threshold = 1,thresh ..."]:1:尝试索引全局' cv' (零值)   堆栈追溯:       [string" ca_l = cv.Canny {image = limg,threshold = 1,thresh ..."]:1:in main chunk       [C]:在0x7feb66429ba0

我的问题是,我怎样才能使用' cv'包检测物体轮廓?

REF: https://github.com/VisionLabs/torch-opencv/tree/master/cv

1 个答案:

答案 0 :(得分:0)

你缺少火炬cv。您可以通过在终端中执行以下命令来安装它:

luarocks install cv