You Are Here:

Community: Developer Discussion Boards

#1 Old Thumbs up using PyNcvLib - 2009-03-13, 15:50

Join Date: Nov 2008
Posts: 11
gmkumar2005
Offline
Registered User
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
Reply With Quote

#2 Old Re: using PyNcvLib - 2009-05-03, 23:52

Join Date: Aug 2007
Posts: 4
brunovianna
Offline
Registered User
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()
Reply With Quote
Reply « Previous Thread | Next Thread »
Display Modes
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Rate This Thread
Rate This Thread:

Posting Rules

You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Forum Jump
Similar Threads
Thread Thread Starter Forum Replies Last Post
[announce] Nokia Computer Vision pylib ! cyke64 Python 14 2009-07-07 17:37

Rate This

 
Bookmark this page: DeliciousDiggFacebookGoogleYahooStumbleUponRedditDiigoTechnocratiTwitter  Share this page Share this page Print this Page Print this page Invite a friend Invite a friend
京ICP备05048969号    Email Newsletters Press Terms & Conditions Privacy Policy Sitemap Contact Us © 2009 Nokia