Analyzing halide segregation in mixed halide perovskites using confocal microscopy and grain type classification