Page 1 of 1

segment generate different results using API and mogrify

Posted: 2007-01-12T15:12:39-07:00
by xinito
hello,

i used C++ API, e.g. image.segment(cluster_size,1.5), and get a grayvalue image with only one graytone.

However, if I write it out "image.write("***.bmp"), and use Dos command, mogrify -segment cluster_size ***.bmp, it gives me a reasonable segmented image with a few graytones.

Could someone please tell me what went wrong? The image is a grayscale image.

Thanks

Posted: 2007-01-12T16:03:54-07:00
by magick
Calling image.segment(2.5,1.5) should be equivalent to the command line option -segment 2.5x1.5. Try that. If you get different results let us know and we will take a closer look.

Posted: 2007-01-12T16:36:37-07:00
by xinito
wow, you are right. If i use command line mogrify -segment cluster_sizex1.5 ***.bmp, it give me the same as I use API segment(cluster_size,1.5). But the segmented image is not reasonable, becuase it has only one graytone, though not for all images.

how can i produce the same segmented image using API as I did in command line mogrify -segment cluster_size ***.bmp, which gives me a few different graytones?

what is exactly the difference, cluster_sizex1.5 vs cluster_size. I read the document saying that by default the smoothing_threshold is 1.5.

Posted: 2007-01-15T08:43:50-07:00
by xinito
Could someone tell me what the C++ API equivalent of command line:"mogrify -segment 1000 ***.bmp"? Thanks