Model based object recognition

I have a use case that is (I believe) outside the scope of CellProfiler at the moment, but maybe someone here can point me towards a solution… :smile:

I have an object (essentially a 2D patch covered in cells), which is a defined size and shape that I wish to identify in a set of images. However, by the time images are captured it is not unusual for rips or tears to have caused fragments of the patch to have been lost.

What I would like to do in each image is identify the remaining patch fragment using the patches predefined size/shape as a model and then transform/rotate the image to a common reference frame before measuring simple parameters such as how much patch was lost. The attached PNG shows conceptually what I mean I hope.

In the academic image analysis literature this problem is usually described as model based object recognition and has applications in digital archaeology (reconstructing pottery fragments, etc…). What I want to do seems much simpler than those applications, but I can’t find any ready made software to do it. Does anyone have any hints?