Sketched out code for comparing object to box.

This commit sketches out an outline. The details of extract_object_from_bg() still need to be worked out.