this is a tough one. I think what you should do is use a Hough-Transform to find the rectangles in the images (e.g.see http://dsp.stackexchange.com/questions/3324/how-to-detect-edges-and-rectangles) This functionality is not available as a KNIME node yet. However, pretty soon we will release a new version of KNIME Image Processing which allows you to reach out to Python or write java scripts in an ImageJ2 Scripting Node. I'm sure this will help you alot.