×

Discussion Board

Results 1 to 8 of 8
  1. #1
    Registered User
    Join Date
    Oct 2013
    Posts
    2

    Camera filter with image overlay

    Hi all,

    Is it possible to utilize Nokia Imaging SDK to overlay an image in real-time camera stream?
    For example to put some kind of transparent logo in the corner of the image while user is using the camera in real-time?
    So far I only managed to blend the logo over the image after it has been captured, but not in real-time (as some kind of blending filter).
    My only idea at the moment is to use GetPreviewBufferArgb() for every frame, modify it using WriteableBitmap.Blit() extension from WriteableBitmapEx library, and then set that frame as the source of some image control in XAML. I'm afraid it wont be very optimized solution, so I'm wondering if Nokia Imaging SDK has an API for that kind of camera stream manipulation.

    Thanks,
    Bojan.

  2. #2
    Nokia Developer Champion
    Join Date
    Nov 2011
    Location
    la bouexiere, france
    Posts
    418

    Re: Camera filter with image overlay

    For it, i thinks you can do it directly with XAML. You have just to put an Image control over your preview.

  3. #3
    Registered User
    Join Date
    Oct 2013
    Posts
    2

    Re: Camera filter with image overlay

    Hi yan, thanks for feedback. That's actually a very good idea, it had come up to my mind when I started thinking about this, but before I found out Nokia Imaging SDK.
    The only "problem" about this is to watch for all of the combinations of phone display resolution and camera resolution, so that image control above the preview will be positioned in exact place where it will be after the camera capture happens and "real" .png is added on top of that captured image.
    But I guess that's something that is easily handled with few calculations.

    Thanks!

  4. #4
    Nokia Developer Champion
    Join Date
    Nov 2011
    Location
    la bouexiere, france
    Posts
    418

    Re: Camera filter with image overlay

    For a real time preview, i thinks it's the best option to add a logo over the picture. Calculs are not really complicate.

    For a captured picture, use Imaging SDK with a blend filter can be interesting. I've never use WriteableBitmapEx.

    If you need a small resolution captured picture, you could use WriteableBitmap.Render

  5. #5
    Nokia Developer Champion
    Join Date
    Mar 2013
    Posts
    424

    Re: Camera filter with image overlay

    WritableBitmapEx is a great set of Extension methods that does allow you to render primitives directly into a WritableBitmap instead of building a visual tree and rendering that using the Render method (it provides similar methods to what the Graphics-object in Java or GDI+ do). As for displaying above the Camera stream. You basically only have to deal with two Preview Formats (16:9 and 4:3). Aside from that the relative positioning in the Preview Canvas should be identical.

  6. #6
    Nokia Developer Champion
    Join Date
    Nov 2011
    Location
    la bouexiere, france
    Posts
    418

    Re: Camera filter with image overlay

    To use WritableBitmapEx or ImagingSDK, you need to access preview picture, modify its pixel and display it. Every step take times and use a writeableBitmap is not the best solution to display a video. Just to display a logo over a stream, to keep a realtime display with a small Overhead, i thinks it's better to use XAML.

  7. #7
    Nokia Developer Champion
    Join Date
    Mar 2013
    Posts
    424

    Re: Camera filter with image overlay

    I totally agree - just wanted to mention what the library does as it had been mentioned. Doing the Overlay in XAML means that the compositing is done by the GPU which is definitely quite a lot faster (and requires less effort).

  8. #8
    Nokia Developer Champion
    Join Date
    Nov 2011
    Location
    la bouexiere, france
    Posts
    418

    Re: Camera filter with image overlay

    Ok. I've understand you speak about preview too

Similar Threads

  1. Fastest way to show camera viewfinder with overlay
    By pixsta in forum Symbian Media (Closed)
    Replies: 0
    Last Post: 2011-01-28, 07:17
  2. overlay an image over another
    By mudit.agar in forum Mobile Java General
    Replies: 6
    Last Post: 2010-01-06, 08:31
  3. Image overlay Camera Canvas
    By jonahkhan1 in forum Mobile Java Media (Graphics & Sounds)
    Replies: 8
    Last Post: 2009-10-13, 12:29
  4. overlay an image over camera canvas on nokia n 95 using overlaycontrol
    By colea2001 in forum General Development Questions
    Replies: 2
    Last Post: 2009-05-04, 14:08

Posting Permissions

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