Ridler-Calvard image thresholding

I wasn’t satisfied with the existing Matlab implementations of the Ridler-Calvard algorithm, so I wrote my own.