Detect rectangle and show bit matrix