Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Using Front Camera for Image Detection #22

Closed
bamboolix opened this issue Aug 24, 2018 · 2 comments
Closed

Using Front Camera for Image Detection #22

bamboolix opened this issue Aug 24, 2018 · 2 comments

Comments

@bamboolix
Copy link

Hello and Bravo for the job achieved so far with OpenCV and Cordova integration. I've installed the plugin. It is rolling. Just one issue I am facing. Do you know what action needs to be taken so that I actually use the Front Camera on my iPad instead of the Back Camera ?

Once I will have achieved this, I would like to use the plugin to track a marker. Just like it could be done with the JSARTOOLKIT library. Do you know what method should be used to track continuously the position of my marker ?

Best regards !

@bamboolix
Copy link
Author

For any other user / developper just swap line 234 of ImageDetectionPlugin.mm

// Replace self.camera.defaultAVCaptureDevicePosition by AVCaptureDevicePositionFront
    // self.camera.defaultAVCaptureDevicePosition = AVCaptureDevicePositionBack;
    self.camera.defaultAVCaptureDevicePosition = AVCaptureDevicePositionFront;

Just edited the Objective C version, will do the same on the Android version. Best edit would be to have a methodic the plugin to choose which camera you actually would like to use. I'll do tests on my side and update before closing this issue.

NB : Using the front camera gave me side effects. The target images must be transformed horizontal mirror. Will check for a way of editing the code in the plugin.

@bamboolix
Copy link
Author

All the issues have been dealt with 👍
Once I swapped from back to front camera, I also added a div in the body of index.html and added jQuery for some cosmetic animate behaviors. All is running. Just one issue, left improving the frequency of detection of the images and the distance at which one needs to be for the camera to detect the image. I'm opening another issue on these to questions.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant