For many years, Dr Andrew Bastawrous could not see clearly enough to spot the leaves on trees or the stars in the sky.

Teachers kept telling him he was lazy and he kept missing the football during games.

Then, aged 12, his mother took him to have his eyes tested and that changed everything.

Now he is a prize-winning eye doctor with a plan to use a smartphone app to bring better vision to millions of children around the world.

Dr Bastawrous told the BBC: "I'll never forget that moment at the optometrist. I had trial lenses on and looked across the car park and saw the gravel on the road had so much detail I had had no idea about.

"A couple of weeks later I got my first pair of glasses and that's when I saw stars for first time, started doing well at school and it completely transformed my life."

Around the world 12 million children, like Dr Bastawrous, have sight problems that could be corrected by a pair of glasses.

But in many areas, access to eye specialists is difficult - leaving children with visual impairments that can harm school work and, ultimately, their opportunities in later life.

Pocket eye tests
In rural Kenya, for example, there is one eye doctor for one million people. Meanwhile in the US, there is on average one ophthalmologist for every 15,800 people.

In 2011 Dr Bastawrous - by now an eye doctor in England - decided to study the eye health of the population of Kitale, Kenya, as part of his PhD.

He took about £100,000 of eye equipment in an attempt to set up 100 temporary eye clinics but found this didn't work, as reliable roads and electricity were scarce.

It was realising that these same areas had great mobile phone coverage - with about 80% of the population owning a cell phone - that sparked the idea for Peek.

Peek is a smartphone-based system that can bring eye care to people wherever they are.

One part of the Peek system works in a similar way to an optician's eye chart, checking how well a person can see.

'Teachers as opticians'
Dr Bastawrous wanted to see if Peek could be used by non-specialists in areas where eye specialists are scarce. His team came up with the idea of training teachers - turning the teacher into an optician.

Now a trial published in the Lancet Global Health shows Peek can be used successfully to bring pocket eye tests to schools, helping more children to get the glasses they need.

How it works:

Children are shown a series of "E" shapes in different orientations and sizes.

The child points in the direction the symbol is facing

The teacher (who cannot see the screen) then swipes the phone in the same direction

The app determines how good the child's eyesight is

'Tried and tested'
Dr Bastawrous - together with a team of researchers from the London School of Hygiene and Tropical Medicine - spent a week training 25 teachers in 50 schools in rural Kenya to use their Peek system or standard eye tests normally done by specialist nurses.

Half of the primary school children were then tested using the Peek system and half with standard eye tests using a series of paper testing cards.

After their tests, children who were examined by the Peek system were shown a split-screen simulation of how blurred their sight was compared with someone who could see clearly.

Crucially, they were then given a printout of this to pass on to their parents, showing them just how poor their child's sight was.

The Peek system also sent out details of the nearest eye clinic along with text-message reminders to encourage parents to take their children to hospital.

Meanwhile, the children who took the paper-based vision test had their scores recorded manually and, if the teachers detected any eye problems, were given a paper letter to pass on to their parents.

Researchers found twice as many children attended hospital for free eye checks with Peek than went for standard eye tests.

'Promise of sight'
Dr Hillary Rono, an eye doctor based in Kenya and lead researcher on the study, said: "This could be a world changer. To put it in perspective, I am one of the 100 ophthalmologists in Kenya.

"I am in charge of a region that has two million people. I cannot reach everybody in that area.

"Therefore, this technology will allow people without medical skills to identify the children with problems and link them with doctors like me so they can treat them."

The study also found the app picked up on more children with eye problems than the standard tests - although, some were allergic conditions that temporarily blurred vision rather than sight problems that needed glasses.

Researchers realised these children benefited from treatment too so Peek has now been refined to spot the difference between eyesight issues and other eye problems, and send children to the right place for help.

Commenting on the study, Peter Holland, of the International Agency for the Prevention of Blindness, said: "Innovations like Peek bring the costs of screening and referrals down and put services within reach of millions who are currently being left behind.

"They have the potential to offer the promise of sight to many who need it."

Peek is being rolled out across more schools in Kenya, serving 300,000 children, with subsidised glasses for those who need them.

The government of Botswana is planning on using it nationwide and it is also being used in India.