Closed

Fix iOS Camera bug, Auto-Focus not working

My app's custom camera does not focus properly. Close distance images are sharp, but far distance objects show in low resolution. I contacted apple developer support for this and provided them with my source code. they pointed out what to look at. I attached two relevant files, and see below for response:

"Thanks for sending the two source files.

I took a look at these, and you appear to be using the same techniques for focus that are being used in the AVCam & AVCamManual projects I referenced previously. More specifically, I'm referring to the following 'focusWithMode' method which you have also implemented in your code:

- (void)focusWithMode:(AVCaptureFocusMode)focusMode exposeWithMode:(AVCaptureExposureMode)exposureMode atDevicePoint:(CGPoint)point monitorSubjectAreaChange:(BOOL)monitorSubjectAreaChange

However, I'm not able to verify the value for the 'point' parameter you are passing into this function. This is something you'll want to check on -- for example, the AVCam sample simply uses a value of CGPointMake( 0.5, 0.5 ) here.

Also, when the AVCam sample code receives AVCaptureDeviceSubjectAreaDidChangeNotification notifications, it calls the same focusWithMode: method but specifies different values for the 'focusMode' (=Continuous) and 'monitorSubjectAreaChange' (=NO) parameters as shown here:

- (void)subjectAreaDidChange:(NSNotification *)notification

{

CGPoint devicePoint = CGPointMake( 0.5, 0.5 );

[self focusWithMode:AVCaptureFocusModeContinuousAutoFocus exposeWithMode:AVCaptureExposureModeContinuousAutoExposure atDevicePoint:devicePoint monitorSubjectAreaChange:NO];

}

You may also want to specify focusMode = Continuous and monitorSubjectAreaChange=NO in this case, otherwise with autofocus the device will autofocus once and then go to mode=locked (locked at current position), and with area change monitoring enabled you will receive subsequent AVCaptureDeviceSubjectAreaDidChangeNotification whenever it detects a change to the subject area (thus your function focusWithMode: will get called again). This may not be the desired behavior. Do you still have the problem if you use the above settings?

If you are indeed passing a valid 'point' value to the focusWithMode: function, and you are still able to reproduce the problem, then it may be a bug. In this case, you can certainly file a bug report using the Apple Bug Reporter ([url removed, login to view]) for our engineers to investigate.

And as discussed, let us know if you are able to reproduce the problem using the AVCam & AVCamManual projects. These projects demonstrate best practices for working with the AVFoundation Capture APIs. If you can't reproduce the problem using these projects, then you should compare your code against these to make sure you are using the same recommended techniques for the Capture APIs.

Scott Kuechle

Apple Developer Technical Support"

Skills: iOS Development, iPhone, Mobile App Development, Objective C, Swift

See more: fix my app 6, Android/iOS native fix-critical small bug, fix my app, iOS application bug fix, bug fix ios, need to fix some errors in my taxi app, fix some minor bugs with my app, bug fix about a voip client app based on linphone platform, auto focus camera app android, ios custom camera, ios app ipad custom interface, camera auto focus driver linux, fix ipad app bug, fix safari css bug, fix magento stock bug version , auto print working java, 3megapixel digital camera auto focus tapscreen display focus subject picturehighquality video camera 3gs state art allowing, fix drop menu bug, fix firefox 1px margin auto, fix ie8 css bug, iphone app create custom, program facebook app work custom tab, app stream iphone camera, auto mechanic working pictures

About the Employer:
( 13 reviews ) Wilmington, United States

Project ID: #14951396

21 freelancers are bidding on average $65 for this job

$55 USD in 1 day
(134 Reviews)
8.3
Smart1902

Hi, I'm interested in your project. Please send me a message so that we can discuss more. Relevant Skills and Experience I have a 7+ years of experience in Android and iPhone apps development.I understood your require More

$50 USD in 1 day
(48 Reviews)
6.7
$100 USD in 1 day
(26 Reviews)
5.5
xinfei713

Dear sir. I have checked your job requirement carefully. I will show you the app link that I have developed . [url removed, login to view] http More

$35 USD in 40 days
(27 Reviews)
5.4
$55 USD in 40 days
(37 Reviews)
5.7
Dharmeshghoghari

Greetings from Netra Technosys! My self DharmeshKumar. With a hands-on 5+ years experience in delivering various Mobile apps. We've developed 26+ Apps. In which almost all are live in AppStore. Relevant Skills and Exp More

$10 USD in 40 days
(9 Reviews)
4.8
tejdiv123

Hello, We are specialized in Mobile(IOS & ANDROID) Apps & Game(2D-3D) Development/Web Technologies/VR/AR/Web API/CMS/ADMIN PANELS Development & having 7 years of experience as an IT [url removed, login to view] quote and time i More

$55 USD in 1 day
(26 Reviews)
4.6
hrkr143

-- 100% Job Success Score -- -- Professional Mobile App Developer -- iOS application using Xcode, Objective-C, Swift is my main programming part. Relevant Skills and Experience I have full experiences in making back More

$40 USD in 1 day
(11 Reviews)
4.1
WhollySoftware

Hi, I am a iOS developer with 3+ years experience and i have used the auto layout for design, use the latest Swift language version for development and also fully knowledge of Objective C. I have most experienc More

$55 USD in 1 day
(5 Reviews)
3.5
zacksam86

thanks for sharing the apple response and the related file. from the response they just suggested few things to do. from the related file the code base is huge. Relevant Skills and Experience Will need access to app c More

$166 USD in 10 days
(3 Reviews)
3.6
uplogictech

Hi Thanks for sharing your requirement. We are a team of 50+ highly qualified and talented digital experts in creative web design, technical web developers and experienced project managers. We are having more than More

$35 USD in 1 day
(5 Reviews)
2.1
ProfSoftStudio

++ This is my job. I'm ready to begin now. Pm for me. Thanks Looking forward to hear from you, Feel free to talk about this interesting stuff, give us any questions you have to know more about us ;-) Relevant Skills More

$35 USD in 40 days
(1 Review)
1.8
iosandroidrkn

Hello, I am swati, I have 6 year of experience in IOS Development(Objective C ,Swift 3 ,Xcode ). I completed many projects of IPhone Recently project which i completed in IOS Sawraj Digital.I used firebase push notific More

$60 USD in 2 days
(2 Reviews)
0.9
Appzorro

Hi, Recently I have worked over camera app and resolved the issues of app.I hope you will go through that app. [url removed, login to view] Relevant Skills and More

$277 USD in 40 days
(1 Review)
0.7
$72 USD in 40 days
(0 Reviews)
0.0
rakeshkumar693

i am pretty experienced with android, ios, iphoen development message me so that we can discuss Relevant Skills and Experience Previous Task: [url removed, login to view] https://play. More

$50 USD in 40 days
(0 Reviews)
0.0
edigixtechnology

Hello, Greetings from Edigix!!! Edigix provides IT Sales & Services for exploring out-sourcing opportunities. Let me give you a small brief about our company, we are India based mobile and web application deve More

$50 USD in 40 days
(0 Reviews)
0.0
mobileoid2

I have done a similar type of work before as I have developed user-friendly, robust and scalable mobile applications for iOS, Android Relevant Skills and Experience I am an ios/android expert software programmer havin More

$35 USD in 40 days
(0 Reviews)
0.0
$35 USD in 40 days
(0 Reviews)
0.0
$66 USD in 3 days
(0 Reviews)
0.0