The easiest way to do it without using a 3D scene would just be to use a series of Rectangle TOPs. They can overlay a rectangle outline over the input image entirely in 2D.
If you’ve got a relatively small fixed number of rectangles, then you could just manually create a top for each one. If you want to get a little fancier, you could use a Replicator COMP to dynamically create a Rectangle TOP for each of your boxes based on the data in a table.
I’d recommend checking out the Operator Snippets to see some examples of how both of those nodes work.
it seems I found the solution, although I had forgotten about this discussion from two years ago. The solution involves working within a 3D environment. To achieve this:
Create an Orthographic Camera.
Set the Orthographic Width to 1.
Adjust the Y Scale to match the proportion of resx / resy.
Create a render with dimensions that correspond to input image
Then instance the rectangle from a table or chop, and set the material to LineMat or Wireframe Mat (remember to select Topology Wire Frame from Wireframe mode )