Trine 2 - Mage drawing Box mechanic, is it possible?

Does anyone have an idea of how you would go about building a mechanic like this in blueprint?

Skip to 1:33 or press the video link below.

This version is rather forgiving, but has the same rough features that I would like, is this sort of thing possible in Blueprints?

Does anyone have any proposed ways to tackle this,
I originally thought about triggers that need to be overlapped with using a spline of some kind.

P.S. I don’t need the box to change size based on the size of the drawing, i just need it to be able to recognize shapes or drawings of some kind.