segment generate different results using API and mogrify

Questions and postings pertaining to the usage of ImageMagick regardless of the interface. This includes the command-line utilities, as well as the C and C++ APIs. Usage questions are like "How do I use ImageMagick to create drop shadows?".
Post Reply
xinito

segment generate different results using API and mogrify

Post 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
User avatar
magick
Site Admin
Posts: 11064
Joined: 2003-05-31T11:32:55-07:00

Post 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.
xinito

Post 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.
xinito

Post by xinito »

Could someone tell me what the C++ API equivalent of command line:"mogrify -segment 1000 ***.bmp"? Thanks
Post Reply