Edited funciton to accept two return values, super pixel mask and superpixel graph