Results 1 to 5 of 5

Thread: Accessing Symbian Camera trough QCamera

  1. #1
    Join Date
    Jun 2011
    Posts
    10
    Thanks
    1
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows Symbian S60 Maemo/MeeGo

    Default Accessing Symbian Camera trough QCamera

    Hi.
    I've been searching a lot a solution but I can't find in the API or any other place...
    I'm using as my target Symbian^3 and I'm reading the camera in this way just like the Qt Mobility documentation suggests:

    Qt Code:
    1. camera = new QCamera;
    2. viewFinder = new QCameraViewfinder;
    3. camera->setViewfinder(viewFinder);
    4. camera->setCaptureMode(QCamera::CaptureStillImage);
    5. camera->start();
    6. this->setCentralWidget(viewFinder);
    To copy to clipboard, switch view to plain text mode 

    It works fine and shows the camera into the screen...
    However I'm developing an application which modifies the image through openCV. openCV has an object for images, IplImage. I can make the conversion between a QImage and an IplImage, so, what I need is to grab a frame each time a timer ticks into a QImage.
    I've found that I can define a QCameraImageCapture and call its capture() method which will trigger the imageCaptured() signal which has the pointer to a QImage as a parameter. However this capture() method saves the image into the disk as a file... so, I don't need that. I just need to have the grabbed frame as a QImage...
    I've also tried with no success using the render() method from QWidget because viewFinder is a QCameraViewfinder which is also a QWidget because when I use the pixel() method from QImage it always return (0,0,0) as the color of any pixel.

    If anyone knows how to do that conversion from QCamera to QImage plz lemme know, I'll appreciate it...

  2. #2
    Join Date
    May 2011
    Posts
    239
    Thanks
    4
    Thanked 35 Times in 35 Posts
    Qt products
    Qt4
    Platforms
    Unix/X11 Symbian S60

    Default Re: Accessing Symbian Camera trough QCamera

    In QtMobility 1.2 there is QCameraImageCapture::setCaptureDestination() which -- with good luck -- might be supported in your device. It allows setting the capture destination to a buffer instead of a file.

    Did you notice that imageCaptured() gives you a preview image of the photo just about to be saved? It should match anything that you could grab from your viewfinder.

  3. #3
    Join Date
    Jun 2011
    Posts
    10
    Thanks
    1
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows Symbian S60 Maemo/MeeGo

    Default Re: Accessing Symbian Camera trough QCamera

    Hi mvuori and thanks for the reply...
    well, I'll try with setCaptureDestination().... however imageCaptured() is a signal triggered when you've already saved the file... So, for a real-time application it doesn't work because each time a timer ticks you would have to save the file, process the image you've got from imageCaptured() and delete de file, lol....
    well, again thanks and I'll try with setCaptureDestination()

  4. #4
    Join Date
    Jun 2011
    Posts
    10
    Thanks
    1
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows Symbian S60 Maemo/MeeGo

    Default Re: Accessing Symbian Camera trough QCamera

    Well, I have a big problem because I'm using Qt Mobility 1.1... So I cannot use the setCaptureDestination()... So, anyone knows at least how to get the buffer from QCamera???

  5. #5
    Join Date
    Sep 2011
    Posts
    3
    Qt products
    Qt4 Qt/Embedded
    Platforms
    Symbian S60 Maemo/MeeGo

    Default Re: Accessing Symbian Camera trough QCamera

    What you need, if I understand correctly, is to get access to the viewfinder frames, not to get a captured image. What you need to do therefore is implement a class which inherits from QAbstractVideoSurface, and then do

    Qt Code:
    1. m_camera->setViewfinder(m_surface);
    To copy to clipboard, switch view to plain text mode 

    Where m_surface is an instance of your QAbstractVideoSurface-derived class. Then, once you start the viewfinder, you will receive frames via the QAbstractVideoSurface::present virtual function.

    One problem is that, IIRC, the QAbstractVideoSurface overload of QCamera::setViewfinder was added in QtMobility 1.2, so this method will only work if you can upgrade to that version.

Similar Threads

  1. How can I decrease the frame rate of the QCamera?
    By mismael85 in forum Qt for Embedded and Mobile
    Replies: 2
    Last Post: 9th July 2011, 01:13
  2. Replies: 1
    Last Post: 9th September 2010, 17:49
  3. How to send Image trough TCP/ip in Qt?
    By qtlinuxnewbie in forum Newbie
    Replies: 5
    Last Post: 27th April 2010, 04:21
  4. Accessing Symbian API
    By geleven in forum Qt Programming
    Replies: 1
    Last Post: 24th April 2010, 08:38
  5. IP camera
    By vinod sharma in forum Qt Programming
    Replies: 1
    Last Post: 12th March 2010, 14:41

Tags for this Thread

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Digia, Qt and their respective logos are trademarks of Digia Plc in Finland and/or other countries worldwide.