Skip to main content

LUP Student Papers

LUND UNIVERSITY LIBRARIES

Depth of field post-processing using neural networks

Holmström, Otto LU (2022) In Master's Theses in Mathematical Sciences FMAM05 20212
Mathematics (Faculty of Engineering)
Abstract
It is possible to create images from a computer model closely resembling those taken with a physical camera. To improve the photo-realism and perceived quality of a rendered image, it is often desireable to add realistic effects that do not appear in computer graphics due to the camera model. One of these effects is depth of field, where a physical camera with a lens can only focus at one specific distance in a scene, making the rest of the scene appear blurry. This is opposed to a rendered image, where the entire scene appears sharp.
In this thesis work, it is investigated if a neural network is able to replicate the depth of field effect in computer rendered images, when given an image and the distance from the camera of objects in the... (More)
It is possible to create images from a computer model closely resembling those taken with a physical camera. To improve the photo-realism and perceived quality of a rendered image, it is often desireable to add realistic effects that do not appear in computer graphics due to the camera model. One of these effects is depth of field, where a physical camera with a lens can only focus at one specific distance in a scene, making the rest of the scene appear blurry. This is opposed to a rendered image, where the entire scene appears sharp.
In this thesis work, it is investigated if a neural network is able to replicate the depth of field effect in computer rendered images, when given an image and the distance from the camera of objects in the image. Three neural networks based on the same structure are created and studied, and it is found that the simplest model fails to retain background information in the images while the most complex model manages to replicate the depth of field effect, with an average PSNR of 43.12 and average SSIM of 0.987. (Less)
Popular Abstract (Swedish)
Neuronnät är en typ av modell inom maskininlärning, som efterliknar strukturen av sammankopplade neuroner i en hjärna. Som en typ av maskininlärning kan neuronnät anpassa sig från tidigare försök för att förbättra sina resultat.

I en dator används en förenklad modell av en kamera för att kunna visa realistiska bilder i datorspel till exempel. Förenklingen innebär att vissa effekter som skärpedjup normalt sett inte dyker upp i datorer. Dessa måste därför läggas till i efterhand genom olika matematiska algoritmer på skapade bilder.

I detta examensarbete har koncepten av skärpedjup och neuronnät kopplats samman, för att se om skärpedjup kan återskapas av neuronnät i stället för de matematiska modeller som normalt sett används. För att... (More)
Neuronnät är en typ av modell inom maskininlärning, som efterliknar strukturen av sammankopplade neuroner i en hjärna. Som en typ av maskininlärning kan neuronnät anpassa sig från tidigare försök för att förbättra sina resultat.

I en dator används en förenklad modell av en kamera för att kunna visa realistiska bilder i datorspel till exempel. Förenklingen innebär att vissa effekter som skärpedjup normalt sett inte dyker upp i datorer. Dessa måste därför läggas till i efterhand genom olika matematiska algoritmer på skapade bilder.

I detta examensarbete har koncepten av skärpedjup och neuronnät kopplats samman, för att se om skärpedjup kan återskapas av neuronnät i stället för de matematiska modeller som normalt sett används. För att studera detta har tre liknande varianter av neuronnät skapats, tränats och sen jämförts mot varandra. Resultaten efter att de tre neuronnäten tränats visar att den minst komplexa modellen inte kan återskapa färg i bakgrunden av bilderna, och att den mest komplexa modellen kan återskapa skärpedjupet mycket väl, vilket kan ses här i bilderna. Detta visar att neuronnät kan användas som ersättning till normala matematiska modeller, givet att det finns tillräckligt med data för träning.

För att skapa användbara neuronnät behövs det data som nätverken kan lära sig från. En del av arbetet har därmed fokuserats på att ta fram ett antal bilder med och utan skärpedjup, för att lära neuronnäten att återskapa denna effekt. Oskärpan på ett objekt i en bild beror på avståndet från kameran, och därför får modellerna ta del av en bild och djupinformation i bilden som indata. Modellens utdata jämförs därefter med bilden med skärpedjup, och modellen kan lära sig från detta.

Data till dessa neuronnät kan skapas enkelt genom moderna spelmotorer som används till att skapa dataspel. Där är det enkelt att sätta av och på den matematiska algoritmen som normalt sätt simulerar skärpedjup. Detta gör det enkelt att spara bilder både med och utan effekten. (Less)
Please use this url to cite or link to this publication:
author
Holmström, Otto LU
supervisor
organization
course
FMAM05 20212
year
type
H2 - Master's Degree (Two Years)
subject
publication/series
Master's Theses in Mathematical Sciences
report number
LUTFMA-3485-2022
ISSN
1404-6342
other publication id
2022:E58
language
English
id
9077406
date added to LUP
2022-06-23 14:17:53
date last changed
2022-06-23 14:17:53
@misc{9077406,
  abstract     = {{It is possible to create images from a computer model closely resembling those taken with a physical camera. To improve the photo-realism and perceived quality of a rendered image, it is often desireable to add realistic effects that do not appear in computer graphics due to the camera model. One of these effects is depth of field, where a physical camera with a lens can only focus at one specific distance in a scene, making the rest of the scene appear blurry. This is opposed to a rendered image, where the entire scene appears sharp.
In this thesis work, it is investigated if a neural network is able to replicate the depth of field effect in computer rendered images, when given an image and the distance from the camera of objects in the image. Three neural networks based on the same structure are created and studied, and it is found that the simplest model fails to retain background information in the images while the most complex model manages to replicate the depth of field effect, with an average PSNR of 43.12 and average SSIM of 0.987.}},
  author       = {{Holmström, Otto}},
  issn         = {{1404-6342}},
  language     = {{eng}},
  note         = {{Student Paper}},
  series       = {{Master's Theses in Mathematical Sciences}},
  title        = {{Depth of field post-processing using neural networks}},
  year         = {{2022}},
}