Shortest distance between two point sets

I have two 2D point sets (saved as ROI) of >300 points each and for every point in one dataset, I want to find the shortest distance to any point in the other data set. Is there a plugin or macro for ImageJ that can do that?

Here you find some good references:

https://forum.image.sc/search?q=%20distance%20points

If you are a R user you can easily use spatstat package, see: