Read depth buffer on the cpu

I need to read the depth information of the scene on the cpu every frame, which I use to generate a new texture that gets sent to a final image effect shader. How can I read the depth data outside of the shader? I think I have to render it to a rendertexture, but will I be able to read the data from a rendertexture (no GetPixel() function in RenderTexture, only Texture2D)?

You have to copy the Rendertexture to a Texture2d first, which you can do with ReadPixels():

RenderTexture.active = yourRenderTexture;
yourTexture2D.ReadPixels(new Rect(0, 0, yourRenderTexture.width, yourRenderTexture.height), 0, 0);
yourTexture2D.Apply();

You can then use GetPixels() as normal, but, as @elenzil points out, this is slow to do every frame. If you’re sending this back to an image effect anyway, do you really have to retrieve it to the CPU? Can you do all the remaining processing on the GPU side?