×

Discussion Board

Results 1 to 3 of 3
  1. #1
    Registered User
    Join Date
    Aug 2007
    Posts
    4

    Using viewfinder frames with pyncvlib

    Hi


    I'm trying to use frames from the viewfinder with nokiacv for python.

    However, as omarfr noticed here , the frames from the viewfinder are in the format EColor16MU, while NokiaCV expects EColor16M images. I suppose that's why I'm getting nasty crashes (my code is attached below).

    Omarfr wrote a small conversion function in C to transform the images. How can I do this conversion in Python? Any suggestions? I have no knowledge of C to create extensions...

    Thanks
    Bruno

    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()

  2. #2
    Registered User
    Join Date
    Jul 2009
    Posts
    11

    Re: Using viewfinder frames with pyncvlib

    Hi Bruno,

    I am sorry to add this in this thread but I am having some problems installing PyNcvLib on my cell phone and until now couldn't find support...
    Did you also had some troubles? I am using pys60 1.9.5 on a Nokia 6210 Navigator

    Many thanks in advance

  3. #3
    Registered User
    Join Date
    Aug 2007
    Posts
    4

    Re: Using viewfinder frames with pyncvlib

    I never tried to use it with 1.9, I'm not sure it works, since the modules install in a different way. Did you try using it with 1.4.5?

Similar Threads

  1. VoIP and wi-fi power-save mode
    By ng1234 in forum VoIP
    Replies: 6
    Last Post: 2009-07-06, 13:05
  2. How to show “spell” cba while user inserting text in T9 mode
    By madsum in forum Symbian User Interface
    Replies: 6
    Last Post: 2007-01-16, 10:00
  3. Replies: 0
    Last Post: 2006-03-04, 10:03
  4. getAppProperty() doesn't work with user attributes?
    By je35 in forum Mobile Java General
    Replies: 6
    Last Post: 2005-11-09, 07:59
  5. Replies: 1
    Last Post: 2002-05-24, 06:30

Posting Permissions

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