Many smaller changes, including improved comments
Performance increase by using opencv for measuring regionprops