Fixed problem with group method, from now it works better than one point method, but it shuts down when it's given by one-colour picture - too many points in one array.