In the first step, we create a pixel classifier. We only care about good wuality segmentation of the powder content at this step. In our example, we define classes of background, paper label, vial and powder. Our classifier decisions look like this: