Football Fans: Download the 2012 Schedule App from Google Play!


Go Back   Android Forums > Android Development > Application Development

Application Development Dev Lounge for the Coder Folks



Reply
 
LinkBack Thread Tools
Old December 5th, 2010, 05:45 PM   #1 (permalink)
New Member
 
Join Date: Nov 2010
Location: Manchester, UK
Posts: 9
 
Device(s): HTC Desire HD,HTC Wildfire
Thanks: 1
Thanked 0 Times in 0 Posts
Sad How to manually display frames from Camera.PreviewCallback after processing, without Camera.Preview

I have built a face detection app where I get the frames from onPreviewFrame, do the face detection and then draw a circle on a canvas above my surfaceView. The problem is frames are automatically displayed using the surfaceview thread when Camera.StartPreview() is started. This is obviously necessary for the PreviewCallback to kick in. As the processing, face detection and drawing, is done in a separate thread(I am assuming here), there is a 2 second delay between the frame being displayed and the result of that frame being processed and drawn on the canvas.

What I want to do is stop the camera preview displaying the frames and display them myself after processing. I believe this has three benefits:

The delay with disappear.

I can draw straight to the bitmap instead of on a canvas which is useless as you can not undo what you have done.

It will help keep memory comsumption low by not having two threads using the same image.

I've read that it is possible to display frames from the previewCallback, does anybody know how and how to stop the frames being displayed automatically?

Many thanks in advance.

JamesBurnstone is offline  
Reply With Quote
Sponsors
Old December 6th, 2010, 07:07 AM   #2 (permalink)
New Member
 
Join Date: Nov 2010
Location: Manchester, UK
Posts: 9
 
Device(s): HTC Desire HD,HTC Wildfire
Thanks: 1
Thanked 0 Times in 0 Posts
Default

Comment out

//mCamera.setPreviewDisplayHolder(mHolder);

//setType(SurfaceHolder.SURFACE_TYPE_PUSH_BUFFER);

Got this from Ken Li on StackOverflow.
JamesBurnstone is offline  
Reply With Quote
Old March 3rd, 2012, 08:07 AM   #3 (permalink)
New Member
 
Join Date: Mar 2012
Posts: 1
 
Device(s):
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Hi how do you process the frames to detect faces? Could you upload the source code of your application please
dhivya2110 is offline  
Reply With Quote
Reply

Bookmarks

Tags
android, camera


Go Back   Android Forums > Android Development > Application Development User CP
Thread Tools

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

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Issues with Camera Preview ophanin Application Development 10 September 8th, 2010 01:24 PM
Camera Preview on Galaxy S couch Application Development 2 August 27th, 2010 02:35 PM
Camera - Preview Auto-Rotate Spiffywerks Samsung Vibrant 0 July 20th, 2010 05:17 PM
Camera.PreviewCallback#onPreviewFrame tagadvance Application Development 0 February 11th, 2010 08:42 PM
Camera Preview api demo android88 Application Development 3 January 6th, 2010 08:33 AM



All times are GMT -5. The time now is 11:35 AM.
Powered by vBulletin® Version 3.8.7
Copyright ©2000 - 2012, vBulletin Solutions, Inc.
Custom vBulletin Skins by: Relivo