Coordinate system in CSV from deeplabcut.analyze_videos()

I am trying to compare hand measurements in imageJ with DLC pose estimations. The R package my colleague wrote has no problem with calculating distances from the CSV generated by DLC, but when he tries to calculate angles his R script fails.

We believe it is due to where DLC vs ImageJ call the origin(0,0). In imageJ the origin is in the bottom left. And when comparing my videos to the X, Y values I believe DLC counts the origin as being in the top Left.

Any suggestions for overcoming this? Can I change the coordinate system in DLC, or maybe a simple calculation will “change the origin”?

I’m very new to this stuff so any insight would be awesome.

Thank you!