Main Page | Report this Page
 
   
Science Forum Index  »  Image Processing Forum  »  Looking for algorithm to correct for close-up portrait...
Page 1 of 1    
Author Message
Oolis Kraprin...
Posted: Sun May 18, 2008 10:57 pm
Guest
Hi, we develop software that takes portrait photos from a digital
camera. Now the camera is a bit too close so the face looks a bit too
rounded. The optical solution is to move the camera away from the face
and zoom in a bit, but we want to do it in software.

We have tried the 3rd order polynomial method to correct radial lens
distortion, which is mostly used to fix barrel distortion at the edges
of the image, but can be adjusted to modify the center of the image
which is what we are mostly interested in.

My question is, is there any standard algorithms that can correct this
effect better? Even better would be ones that we can give known
parameters too (like distance, lens size etc) and get a fairly
definitive correction formula, rather than just playing around with
parameters until we find something that looks right.

Thanks a lot

Oolis.
bugbear...
Posted: Mon May 19, 2008 5:14 am
Guest
Oolis Kraprin wrote:
Quote:
Hi, we develop software that takes portrait photos from a digital
camera. Now the camera is a bit too close so the face looks a bit too
rounded. The optical solution is to move the camera away from the face
and zoom in a bit, but we want to do it in software.

We have tried the 3rd order polynomial method to correct radial lens
distortion, which is mostly used to fix barrel distortion at the edges
of the image, but can be adjusted to modify the center of the image
which is what we are mostly interested in.

My question is, is there any standard algorithms that can correct this
effect better? Even better would be ones that we can give known
parameters too (like distance, lens size etc) and get a fairly
definitive correction formula, rather than just playing around with
parameters until we find something that looks right.

The panotools library does some rather interesting simultaneous
equations to solve such situations.

http://panotools.sourceforge.net/

It is possible to use "self referencing" in an image to calibrate
a lens.

http://www.erik-krause.de/verzeichnung/distort_en.htm?no_frame

I don't know to what extent the model would work
other (non polynomial) models of lens correction.

I hope this helps.

BugBear
Martin Leese...
Posted: Mon May 19, 2008 11:13 am
Guest
Oolis Kraprin wrote:
Quote:
Hi, we develop software that takes portrait photos from a digital
camera. Now the camera is a bit too close so the face looks a bit too
rounded. The optical solution is to move the camera away from the face
and zoom in a bit, but we want to do it in software.

Am I right in thinking that your problem
arises because the face is stuck on the
front of a round head? That is to say, in
an extreme case the camera will not be able
to see any ears because it can't see around
far enough.

If so then your solution is to convert the
2-D face into 3-D by modeling a round head.
Strictly speaking, you don't have enough
information to do this, but heads have a
standard shape so you can make assumptions.

--
Regards,
Martin Leese
E-mail: please at (no spam) see.Web.for.e-mail.INVALID
Web: http://members.tripod.com/martin_leese/
Oolis Kraprin...
Posted: Thu May 22, 2008 8:57 pm
Guest
On May 19, 6:13 pm, Martin Leese <ple... at (no spam) see.Web.for.e-mail.INVALID>
wrote:
Quote:
Oolis Kraprin wrote:
Hi, we develop software that takes portrait photos from a digital
camera. Now the camera is a bit too close so the face looks a bit too
rounded. The optical solution is to move the camera away from the face
and zoom in a bit, but we want to do it in software.

Am I right in thinking that your problem
arises because the face is stuck on the
front of a round head?

Yes, and thats what makes this problem different to most radial
distortion problems that you can calibrate with a flat piece of paper
with a grid on it.

Quote:
That is to say, in
an extreme case the camera will not be able
to see any ears because it can't see around
far enough.

Well the camera, when set to low focal lengths, actually can see more
of the ears than what the eye would see. The result is a fishbowl type
effect. We want to convert this camera image into something the eye
would see, or convert the image into what it would look like if the
camera were moved away from the face and the focal length were higher.

Quote:
If so then your solution is to convert the
2-D face into 3-D by modeling a round head.
Strictly speaking, you don't have enough
information to do this, but heads have a
standard shape so you can make assumptions.

Well we do take images from all sides of the face, but creating a 3d
model is not the solution for us as we are primary concernd with the
2d representation of a 3d object. Its a lot like projections in world
maps really, there is no perfect way to represent a globe on a flat
piece of paper so you need some model to represent the 2d effect. I
guess you are right in a way, the best way to represent the planet is
using a 3d globe. However the best way to represent a planet, or
someones head, in 2d form can only ever be some projection of the 3d
solution.

It appears using macro mode on the camera helps a bit. But our 3rd
order polynomial works too, albeit in a trial and error way.
Rupert Swarbrick...
Posted: Fri May 23, 2008 11:56 am
Guest
Oolis Kraprin <Oolis.Kraprin at (no spam) googlemail.com> writes:
Quote:

If so then your solution is to convert the
2-D face into 3-D by modeling a round head.
Strictly speaking, you don't have enough
information to do this, but heads have a
standard shape so you can make assumptions.

Well we do take images from all sides of the face, but creating a 3d
model is not the solution for us as we are primary concernd with the
2d representation of a 3d object. Its a lot like projections in world
maps really, there is no perfect way to represent a globe on a flat
piece of paper so you need some model to represent the 2d effect. I
guess you are right in a way, the best way to represent the planet is
using a 3d globe. However the best way to represent a planet, or
someones head, in 2d form can only ever be some projection of the 3d
solution.

It appears using macro mode on the camera helps a bit. But our 3rd
order polynomial works too, albeit in a trial and error way.

Just a quick comment: I don't think Martin Leese meant that you should
be generating 3d representations as finished output. I think he was
suggesting that you do the following:

- Get the picture from the camera

- Using info about relative location of camera + head and also some
assumptions about the shape of a human head, calculate what "bit" of
the head each pixel in your image represents. This is going to give
you some texture map on the surface that approximates the head.

- Now find a transform that is "rendering" the textured head, from
further away with a saner focal length.

Note that you'll want to do this by composing functions and then
applying in one fell swoop - not actually making some polygonal
head. That would probably look awful.

Hope this is makes sense,

Rupert
Martin Leese...
Posted: Fri May 23, 2008 12:10 pm
Guest
Rupert Swarbrick wrote:

Quote:
Oolis Kraprin <Oolis.Kraprin at (no spam) googlemail.com> writes:
....
It appears using macro mode on the camera helps a bit. But our 3rd
order polynomial works too, albeit in a trial and error way.

Just a quick comment: I don't think Martin Leese meant that you should
be generating 3d representations as finished output. I think he was
suggesting that you do the following:

- Get the picture from the camera

- Using info about relative location of camera + head and also some
assumptions about the shape of a human head, calculate what "bit" of
the head each pixel in your image represents. This is going to give
you some texture map on the surface that approximates the head.

- Now find a transform that is "rendering" the textured head, from
further away with a saner focal length.

Yep, that was what I meant. The problem
with using polynomials in the way that the
original poster is doing is that they are
not solving the *actual* problem. They are
solving some other problem.

--
Regards,
Martin Leese
E-mail: please at (no spam) see.Web.for.e-mail.INVALID
Web: http://members.tripod.com/martin_leese/
 
Page 1 of 1       All times are GMT - 5 Hours
The time now is Thu Oct 16, 2008 3:51 pm