1

[Edit by Spektre] Reformulation of the problem from comments

I got input image of eye (Iris and pupil) like this (without overlay):

need to make

On top of that I got polygon representing iris with fixed size outer circle centered to that image:

base image

I need to change/construct the polygon so the inner circle tracks pupil on the image (darkest disc). So I need to locate the pupil (center and radius) to form the polygon (red overlay on input image)

This task has been already done in android.

I tried to do the same way, but it wasn't works for me. Any of the help will be appreciable.Thanks

Spektre
  • 49,595
  • 11
  • 110
  • 380
Kamal Bhardwaj
  • 948
  • 1
  • 10
  • 25
  • what exactly is input and output? you want just to locate the dark disc or distort source image (which you did not provide) into target one? Or render the target image from source geometry? It is really unclear so +Close for now – Spektre Dec 12 '16 at 12:12
  • the first image I have given, I want to make that image look like the red image in second image. Means I need to distort original to make look like the second image. Ignore the base under second image. Please consider overlay image only. Input is first image, output required is overlay image. – Kamal Bhardwaj Dec 12 '16 at 12:51
  • You have given us a link to a Java implementation of the algorithm. Which parts are you unable to translate to Swift? – rob mayoff Dec 12 '16 at 13:37
  • Unable to translate like java, change vertices of images and recreate image from those vertices. – Kamal Bhardwaj Dec 12 '16 at 13:39
  • Still not clear enough. Do you have the input image in vector or raster form? What is the base for distortion? 1. you got some vector/displacement input 2. Or based on the image under overlay (for which you should post it also without the overlay as it is also input data)? – Spektre Dec 12 '16 at 14:04
  • ok, let me try to explain again. there are circles of different radius to set as pupil of eye and another for Iris. Outer circle will remain fix, inner's dimension and center point may change but will remain inside the outer one.Now from input image the inner circle should vary according to pupil's circle dimensions and Iris circle will remain same. If pupil is on right corner the input image's inner circle shifts to right side and area of right of circle will compress but left of that will stretch, vice versa. Output image is example of this. – Kamal Bhardwaj Dec 13 '16 at 04:16
  • @KamalSharma to respond to someone add `@nick` to comment and user `nick` will be notified. Otherwise (s)he have no idea you wrote something. So you want to find the pupil (dark disc) on input image. you need to add input image without overlay (so anyone ho want can have something to test). To locate the pupil you should derivate the image and find the highest peaks (pupil circumference) and then fit circle into found points. So what is the problem exactly? What is not working? – Spektre Dec 13 '16 at 07:57
  • @KamalSharma This should be really easy to implement (you need pixel access to image) if it would help I could try it in C++ (do not use SWIFT) and form answer similar to: [find archery target in image of different perspectives](http://stackoverflow.com/a/36541560/2521214) – Spektre Dec 13 '16 at 08:11

0 Answers0