Not sure I exactly understand what's going on. Let me summarize as I
understand it. You are taking a photo of a person standing in front of
a light blue backdrop. The backdrop varies in color due to shadows,
non-flatness (is that a word?) of it, etc. You want to segment the
image into person and background, and then print out only the person.
Is that correct? (At first I wasn't clear if "background" was the
backdrop behind the person, or the pattern/color of the sheet you are
Can't you just do a color classification to find a certain color range
(say light blue), and then clean up the image a bit (keep only the
largest blob so there are no light blue points on the person's
clothing, then fill holes in that blob to get a completely solid
background blob). Then you just replace those background blob pixels
with white (System.Drawing.Color.White) and then print. White pixels
won't lay down any ink and won't obscure any color or pattern you may
have on your printing substrate.
Regarding your A. Once you find the background, you'll need to clea it
up a bit to extend any pixels within a certain distance of the image
edges to be background - in case some part near the edge of the image
were not selected initially by color because it was in a shadow. Then
you'll need to find edges of the background blob that are not image
edges - these will be edges that meet the edge of the person's
silouhette. Then use that edge (enlarged a bit) as a mask to blur the
person's edges. This will blur just the person's edges (and not the
middle of the person) a bit so as to not get sharp jaggies when
printed. You could segment the image into just two blobs - the
background color and non-background color. Keep the largest two blobs.
This should be the background and the person. Then do a hole filling
to get rid of any color islands that are mixed in the wrong blob. Then
binarize those two and dilate each and find the overlap (union). This
overlap area is where the person's edge meets the background edge and
this is what you want to use as a mask for blurring the person blob.
There are many companies that produce small systems for printing ID
badges (or drivers licenses) that do something similar but I don't
think any cheap standalone cameras do this.