| Reply | « Previous Thread | Next Thread » |
|
Hi all
I want to perform edge detection on the video produced by viewfinder. how to use PyNcvLib for this purpose? The problem with PyNcvLib is it expects images from a file. I am not able to find a way to convert the pys60 Image object into CNokiaCVImage. The pycamera has a callback method which passes image as a parameter. I want to use PyNcvLib to perform edge detection inside this call back. Is there are any other library avaliable which can perform edge detection in realtime Please help Kiran |
| gmkumar2005 |
| View Public Profile |
| Find all posts by gmkumar2005 |
|
hi Kiran
I'm trying to do more or less the same. I managed to do the conversion with the code below. However, after a few frames, the application freezes. There seems to me some memory leak. Let know if you can get around this issue.... Code:
import e32, camera, appuifw, key_codes, graphics, PyMelib, random, PyNcvLib
from graphics import Image
def quit():
global app_lock
camera.stop_finder()
camera.release()
app_lock.signal()
def finder_cb(im):
global sourceImg, sourceImgInst, imgOps, canvas, targetImg, targetImgInst
finderBmp = im._bitmapapi()
sourceImg.Bitmap_CreateL(finderBmp)
imgOps.CornerDetect(sourceImgInst, targetImgInst, 20, 25)
altBmp = targetImg.Bitmap()
altOut = Image.from_cfbsbitmap(altBmp)
canvas.blit(altOut)
sourceImg = PyNcvLib.PyCNokiaCVImage()
sourceImgInst = sourceImg.NewLC()
targetImg = PyNcvLib.PyCNokiaCVImage()
targetImgInst = targetImg.NewLC()
imgOps = PyNcvLib.PyCImageOperations()
canvas = appuifw.Canvas()
appuifw.app.body = canvas
appuifw.app.title = u"edge"
appuifw.app.exit_key_handler = quit
canvas = appuifw.Canvas()
appuifw.app.body = canvas
camera.start_finder(finder_cb, size=(240,180))
app_lock = e32.Ao_lock()
app_lock.wait()
|
| brunovianna |
| View Public Profile |
| Find all posts by brunovianna |
| Reply | « Previous Thread | Next Thread » |
| Thread Tools | Search this Thread |
|---|---|
| Rate This Thread | |
| Thread | Thread Starter | Forum | Replies | Last Post |
|---|---|---|---|---|
| [announce] Nokia Computer Vision pylib ! | cyke64 | Python | 14 | 2009-07-07 17:37 |