Skip to content
/ CGH Public

A project aimed to create a hologram from a text file (CGH - Computer-Generated Holography).

Notifications You must be signed in to change notification settings

Yee7i/CGH

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

26 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

CGH - Computer-Generated Holography

What this program aims to do is to generate a hologram based on a binary 64x64 object, saved in a text file. The program consists of a basic graphical UI, in which user can select options he wants and set the properties of generated images, like color and whether or not to generate a chart.

I utilized SFML libraries by SFML-Team (GitHub link - https://github.com/SFML/SFML) and some ugly textures I made myself, but plan to change them once I find some time. They are sort of placeholders as of now.

The output of the program are some .txt files, which contain data processed by the program. They are not really useful, but can prove so if you want to analyze the images generated by the program. Staying on the topic of images - the program generates 4 images:

  1. 'object.png' - the data on the input as a .png file. To be quick - the program reads data, translates the binary numbers to image and outputs it here.
  2. 'spectrum.png' - data processed as a spectrum of an image. It is made by using Fast Fourier Transformation on the object.
  3. 'hologram.png' - a spectrum but considering phase and amplitude. This is in fact the most important image, that can be projected. Plus it looks quite nice :)
  4. 'image.png' - hologram that was processed once more, but the other way around, with the Fourier transformation - to put it simply. It shows how quantization impacts the result.

This was my school project for a contest, called "Olympics of Technical Innovation 2019". Of course the title is translated from Polish. I took the 2nd place in my region and didn't make it to the next stage, sadly, but for a beginner programmer it's a huge success that someone appreciated my efforts and wanted to work with me on making something I'd be proud of.

The Fast Fourier Transform (FFT) was prepared by my project coordinator - Krzysztof Łyszczek, who gave the idea and was the inspiration for all this mess. I have his permission to upload it here and I am really grateful for all the hard work he did to teach me about physics and how FFT, spectrums, imagery and optics in general work.

Authors:

  1. Adrian Tomicki - main developer and translator, beginner at coding, responsible for this mess of a code and the repository.
  2. Krzysztof Łyszczek - project coordinator and manager, provided Fast Fourier Transform and theoretical knowledge of physics, optics and more.

To do:

  1. I plan on making the whole program in GUI, so I'll probably rewrite half of the code, so it fits.
  2. The GUI has been updated, but I'm still waiting for the textures. They should be updated soon.

Done:

  1. Redesigned the UI, so it's more convenient for the user and detects resolution.
  2. Created a window to cut out a fragment of the spectrum in GUI, instead of console.
  3. Rewritten the code in English instead of mixed Polish/English and fully translated both the code and the UI.
  4. Redesigned source files to be more intuitive. You can now tell what is where, more or less.

From the author:

Thank you for reading this. It really means a lot to me.

I'm an 18 years old IT student of a technical high school in Szczecin, Poland.

I am still a beginner. Maybe I know some stuff, but I still have very, very much to learn. I wish to be a big-brained, hard-working, coffee-drinking programmer someday.

I have spent about 4 months making this with my coordinator - Krzysztof Łyszczek, who I owe pretty much the fact that this program has become a thing. He gave the idea and directed the project to turn out what it currently is. We started at the beginning of January and spent several hours a week, sometimes after hours. And for those hours I want to thank him.

I also want to thank my programming teacher - Filip Majewski - who recommended me as a person suitable for making the project, and I hope I proved capable, just as he thought. To him I owe my first #include <iostream>, int main() and std::cout<<"Hello world!"<<std::endl;

Uhhh, I speak as if it was over. No, it's not. The project isn't perfect, and that's a fact. There's much work to do, and more to come.

Redistribution and permissions:

If you'd like to redistribute my code or a part of it, please ask me for permission first. I don't mind if you use it personally. It'd make me happy if you actually studied from it and learned something valuable.

Sample images:

  1. An input file (64x64 made of binary numbers, stored in .txt files, chosen in the program):
    <Missing image>

  2. Object, being a translation of the input file to a .png image:
    <Missing image>
  3. Spectrum, which is the object, transformed by FFT:
    <Missing image>
  4. Hologram (spectrum considering amplitude and phase):
    <Missing image>
  5. Image (hologram, transformed by a reversed FFT):
    <Missing image>

Each image has a caption at the bottom, distinguishing which one of the four it is.

Additionally, 'image.png' has PSI and SNR numbers added to the caption. Those two vary depending on quantization level. Ideally, PSI goes lower (0 means that the object was reproduced as original) and SNR goes higher (numbers near-infinite mean that the object was reproduced with the highest accuracy).

About

A project aimed to create a hologram from a text file (CGH - Computer-Generated Holography).

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages