Thank Fred.
It does not give me the colors in those formats with either of this options.
For the practical application at hand this is not a problem, as I will know what is a stripe and what is a background. And actually it is an advantage to have both the types of segments for analysis. In fact I want all the segments form the original, I just need to have the boundary information.
In fact, it occurs to me that I do not need to generate a physical image of each segment to be analysed, rather as long as I know the bounding box of that segment (from your mask), then I can use this information to perform all the analysis required on that segment of the original image. This is more direct and saves writing temporary files. I think.
FWIW, here are my outputs of your suggestions:
~ % convert --version
Version: ImageMagick 6.8.9-9 Q16 i686 2017-07-31
http://www.imagemagick.org
Copyright: Copyright (C) 1999-2014 ImageMagick Studio LLC
Features: DPC Modules OpenMP
Delegates: bzlib cairo djvu fftw fontconfig freetype jbig jng jpeg lcms lqr ltdl lzma openexr pangocairo png rsvg tiff wmf x xml zlib
~ % convert tmp4.png -type bilevel \
~ > -define connected-components:verbose=true \
~ > -define connected-components:mean-color=true \
~ > -connected-components 4 \
~ > null:
Objects (id: bounding-box centroid area):
1: 123x362+0+22 +61.0,+202.5 44526
0: 123x22+0+0 +61.0,+10.5 2706
~ % convert tmp4.png \
-define connected-components:verbose=true \
-define connected-components:mean-color=true \
-connected-components 4 \
null:
Objects (id: bounding-box centroid area):
1: 123x362+0+22 +61.0,+202.5 44526
0: 123x22+0+0 +61.0,+10.5 2706