Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8533213
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 11, 20262026-06-11T09:54:35+00:00 2026-06-11T09:54:35+00:00

I would like to detect an object that is focused in the camera, and

  • 0

I would like to detect an object that is focused in the camera, and cut out the unfocused background to and replace it with an image. Is this possible?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-11T09:54:36+00:00Added an answer on June 11, 2026 at 9:54 am

    It is marginally possible, but requires some heavy computation. There is no ready made library for iOS that I know of. So if you ask, “Is it possible to do this easily?”, I’d answer, I’m afraid not.

    Tools that appear to do this will usually employ some shortcut such as

    • leverage face detection (i.e. they work as long as the “object” is a human face)
    • leverage area analysis (i.e. they check whatever is in the middle of the picture, be it focused or not)

    Face recognition is available with, I believe, Quartz. Anyway, check out Face Recognition on the iPhone .

    In the general and messy case, you can usually recognize a focused area (supposed existing) by analyzing either contrast or spatial frequency in the image, divided into small areas (usually 16×16 or 8×8 pixels). Those areas with low contrast, and/or where high frequencies are missing, are background, while the presence of high frequencies (sharpness) indicates a focused area.

    This will not tell you the image boundaries and will also give several false positives (and possibly negatives); but at the end of this phase you will have a sampling of the original image with status of “focused”, “unfocused” and “uncertain” for each texel of, say, 16 pixels side.

    To this map you will have to apply heuristics, for example:

    • borders are usually part of background (hence should test positive)
    • a focused area of small dimensions is probably a false negative
    • an unfocused area of small dimensions is probably a false positive

    At the end of this refinement phase you should have a few contiguous large “blobs” of focused areas. You then examine the borders of these, looking for sharp transitions in color or luminosity (usually in the direction radial from blob center). This is another heuristic: we are assuming that you won’t focus a red apple on a red background, or if you do, the apple will have highlights that will show yellow, white or very light red and allow tracing a “contour”.

    Once each blob has its own contour, you can use it for a cutout.

    You would have to do all this using tools such as Core Image

    http://developer.apple.com/library/mac/#documentation/GraphicsImaging/Conceptual/CoreImaging/ci_intro/ci_intro.html

    or, better suited to the task, vImage

    http://developer.apple.com/library/ios/#documentation/Performance/Conceptual/vImage/Introduction/Introduction.html#//apple_ref/doc/uid/TP30001001

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I am doing an image upload handler and I would like it to detect
I would like to detect taps with a tapRecognizer in one class that triggers
Suppose you have a java object, would it be possible to detect where exists
From a Flash object, I would like to be able to detect the presence
I would like to detect when a page load request give to a UIWebView
I would like to detect the following sequences: a aA aAa aAaA ... where
I have a database with almost 100,000 comments and I would like to detect
I have a JPanel, which I would like to detect the following events (1)
Using winforms in vs2008. I have a DataGridView and I would like to detect
I have a store with items retrieved from server. I would like to detect

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.