some restructuring work for contour detection
implemented image negative function
sorting of both dark and bright contours
attempt at saving sorted contours