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 8376927
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 9, 20262026-06-09T15:32:40+00:00 2026-06-09T15:32:40+00:00

I am using CIDetector to find faces in a picture. The coordinates of faces

  • 0

I am using CIDetector to find faces in a picture.

The coordinates of faces it returns are the absolute coordinates in the image file (The image dimensions are much larger than the screen size obviously).

I tried to use the converRect:toView command. The image itself is not a UIView so the command doesn’t work, also I have a few views embedded inside each other where finally the image is being shown.

I want to convert the bounds of the found faces in the image to the exact location of the face being shown on the screen in the embedded image.

How can this be accomplished?

Thanks!
The image being shown on the phone – the image is scaled to fit the screen with aspect fit

  • 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-09T15:32:42+00:00Added an answer on June 9, 2026 at 3:32 pm

    The coordinates from CIDetecter (CoreImage) are flipped relative to UIKit coordinates. There are a bunch of tutorials out there on iOS Face Detection but most of them are either incomplete or mess up the coordinates. Here’s one that is correct: http://nacho4d-nacho4d.blogspot.com/2012/03/coreimage-and-uikit-coordinates.html

    One thing to note: the tutorial uses a small image so the resulting coordinates do not have to be scaled to the on-screen (UIImageView) representation of the image. Assuming you use a photo taken with the iPad camera, you will have to scale the coordinates by the amount the source image is scaled (unless you reduce its size before running the face detection routine -maybe not a bad idea). You may also need to rotate the image for the correct orientation.

    There is a routine in one of the answers here for rotating/scaling: UIImagePickerController camera preview is portrait in landscape app

    And this answer has a good routine for finding the scale of an image when presented by a UIImageView using ‘aspect fit’: How to get the size of a scaled UIImage in UIImageView?

    You will need to use the scale in order to map the CIDetector coordinates from the full size image to the scaled down image shown in a UIImageView.

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

Sidebar

Related Questions

Using a CSS image sprite, I'm creating an 'interactive' image where hovering over certain
Using ASIHTTPRequest, I downloaded a zip file containing a folder with several audio files.
Using Tsql, how can I find out when MS SQL server was installed?
using grep, vim's grep, or another unix shell command, I'd like to find the
Using Sinatra and DataMapper. This is my first time trying to use more than
Here is the code I am using to detect face from an Image: -
Using CSS, how can I create a partial border as per image below I
using Eclipse 3.4 Ganymede and I cannot find the way to add javadoc support
Using JAXB in Java it is easy to generate from a xml schema file
Using the Exiv2 library to write some exif tags to an image i'm running

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.