The subject of my thesis is creating depth maps by focus stacked images. In this paper I introduce the two most popular methods. Following a detailed analysis, I developed my own algorithm based on these two ideas. In the paper, I also introduce the mathematic filters which are connected to all the methods in question. My algorithm has three parts. The first step is aligning the stacked images, which basically is a creation of a panoramic picture. As a second step, the aligned images are filtered. In the third step I add relative high score to different points of the filtered images. Concerning the first and the third steps, I used methods that have been successfully applied throughout relevant scientific literature, however, I tried novel approaches regarding the second step. When I elaborated the second step, I used my knowledge in signs and systems. The C++ programme based on openCV functions that I implemented is a bit faster than the usual algorithms, also, less sensitive to noises, but sometimes it locates the referenced zero points a bit incorrectly, although it is a common problem even with popular algorithms.