fSpy is a free software that allows you to recreate the perspective of an image from the real world in a virtual environment.
Video Transcript
Hi! What you see on the screen is a photo from about 30 years ago in which my younger brother, my mother, and my paternal grandfather are portrayed, at the school I attended when I was a child.

What you are currently looking at is that same location recreated in Blender, textured in Substance Painter, and made navigable in Unity.
Starting from this simple corridor, I then recreated other environments, but all projects have one thing in common: I always begin with fSpy to recreate the position of the virtual camera and, since we can specify the dimensions of a reference object, also the dimensions of the environments and objects.
fSpy is a free software that allows you to recreate the perspective of an image from the real world in a virtual environment. It's extremely useful for creating photomontages or recreating objects or environments based on a photograph. In the description of this video, you'll find the link to the software's main page, which I am currently showing on the screen. fSpy is a stand-alone software that exports the reconstructed data into a project file. To import this project file into Blender, it's necessary to also download the add-on that enables its integration with Blender. Before diving into the tutorial, I think it's appropriate to show you the page of its creator, Per Gantelius.
After downloading and installing fSpy, let's launch the application. In the center of the screen, there's a button that allows you to start the sample project, which has a tutorial on the software's website. Let's ignore that and import a photograph into fSpy. You can do this either through the File menu or simply by dragging the image onto the main fSpy screen.

In the menu on the left, we can define the number of vanishing points to identify in the image. I'm keeping it at 2 because, at a glance, I can immediately identify one vanishing point that should be in the door at the back of the photograph, while a second vanishing point should be to the right, outside the image, following the lines of the tiles and the beam at the end of the corridor.

Using fSpy is extremely simple: all we need to do is click on the ends of the colored segments and position them in a way that traces vanishing lines, which fSpy will then use to find the vanishing points. Pressing the SHIFT key while clicking on one of these control points activates a magnifying glass, allowing for more accurate placement. We have two pairs of segments in particular, as each pair needs to be directed along one of the two axes, X and Y. In my case, I'm very fortunate because the flooring, walls, and beams provide many lines to use for placing the two pairs of segments.

You might have also noticed that as I position the control points, the reference system centered on the white dot is aligning itself, particularly with the X and Y axes oriented along the vanishing lines of the image. The white dot represents what will be the Origin of the virtual universe in Blender.

In this case, the reference system has been recreated well with just a few steps. If the Z-axis were to point downward or if other issues with axis orientations arise, try adjusting the axis orientations in the Vanishing Point Axes menu.

If there are distances in the image of which you know the value or objects for which you have approximate dimensions, you can choose an axis to use for this reference in the Reference Distance menu and move the control points of the segment that appears to assign it a length. In my case, I don't know the height of the door at the back, but I do know that the base of the pillars was about 1 meter high. Therefore, I am moving the origin of the virtual universe to a vertex at the base of the pillar and resizing the Reference Distance segment to match the height of the pillar's base before specifying 1 meter in the numerical field that appears in the Reference Distance section of the menu.

Once this is done, all that's left is to export the obtained information, which can be done by simply choosing "Save As" from the File menu and specifying a disk path to save the file.

As mentioned earlier, in addition to the fSpy stand-alone software, it's necessary to download the Blender import add-on, which can be installed through the Add-Ons tab in the Preferences window.

To use it, we need to go to the Import section of the File menu and import the project file we saved to disk a moment ago.

The add-on will create a virtual camera with the same background image used in the fSpy project. The origin of Blender's virtual universe will be where we positioned the white dot with the Cartesian axes in fSpy when we saved the project.

In the fSpy project, I positioned the Origin at the base of one of the pillars and set the measurements so that the bottom of each pillar is considered 1 meter high. By now inserting a cube with sides measuring one meter and placing it at the origin of the virtual universe, this cube will perfectly overlap with the base of the pillar in the photograph.

At this point, you can proceed with modeling the environment and the elements within it. Here, I'm showing a timelapse of a rough modeling of the environment to show how the orientation of the virtual camera created by fSpy aligns the geometries with the elements in the original photograph.

In this second timelapse, I'm showing the placement of some individually crafted assets that were then imported into the scene. By using vertex and edge snapping tools, it becomes easy to position elements in the environment and resize them. Subsequently, adjustments, UV unwrapping, and surface texturing follow, resulting in the rapid reconstruction of a virtual environment from a photograph, with reasonably accurate measurements, distances, and proportions.

I hope this tutorial has been helpful! See you soon!