to extract squares and circles off input image