Rooster generating overlapping curves

Hi, I’ve been playing with the Rooster component a lot lately but keep running into issues.

First of all let me say I think that Rooster is one of the most interesting components I’ve used within Grasshopper. It has given me creative ideas that are a lot of fun to work with. However, there are some issues with it that I’d like to know more about. Maybe these are limitations of Grasshopper, I don’t know,

The first thing I ran into is that it seems the Threshold for curve detection doesn’t seem to do anything.

But the bigger issue is that it generates curve areas that overlap each other. Also, the areas do not meet each other around the borders of the contour of each area.
A lot of the time two similarly shaped curves overlap completely, but the edges are not entirely the same, this causes a lot of issues when using the generated data from the Rooster component.

Are there any ways I can get rid of these double curves?

For example here we see two curves that partially overlap:

And here is an example of the settings I use:

A lot of photo editing has been done prior to coming to the forum, I have tried raising the contrast between areas, etc. Lowering the color count sometimes helps but it also causes a lot of detail to disappear from the image. Sometimes when I vectorize a face, one of the eyes or hole of the nose just disappears even though it has high contrast with the surrounding areas.

I have tried using other methods of vectorization, but these do not offer added color support per area so in this sense rooster is still superior despite the obvious drawbacks.

I’m wondering if there are ways to deal with these curves, if there are maybe plans to improve on the component, or if there are other things I can try to avoid having almost-duplicate curves that overlap.
What I’m looking for is a way to get rid of the double curves, while keeping the color data linked to the correct curves.

Maybe someone else has run into this issue as wel and found a fix, or maybe the creator can shed a little light on this.

Hi @ohmarinus
Rooster is based on the CsPotrace vectorization library. It creates blobs (closed curves) for each patch of color. The threshold defines the allowed variance for each color - think the threshold of the ‘Wand’ selection tool in Adobe Photoshop. If you are trying to vectorize photographs or images with a lot of detail, they may not give the best results. If you have ever tried ‘Vectorizing’ an image in a vector graphics application like Adobe Illustrator, you can expect a similar output here.

I’m not entirely sure what it is that you’re trying to achieve with your script, but the description you’ve provided is the expected behavior of Rooster. If you’re trying to get a single curve out of the image, you can try making it a grayscale image with high contrast. That should ensure that you get only 2 curve outputs - one for white and one for black.

I hope this helps.

1 Like

Have you tried using @Dani_Abalde 's Rasterize component in the Peacock plugin?

That gives really good results but with any image processing component, expect to start with low res and gradually build up the resolution as things take a lot of time.

1 Like

Hi Praneet, I understand perfectly what the threshold is supposed to do, however, whether setting it to 1 or to 100, it doesn’t supposed to do anything in any condition. That’s why I was wondering if the input for threshold could be broken. There is zero change in output data when changing this threshold setting. I’ve tried this in tandem with many other settings as well (such as adding more colors, less colors, tolerance, etc,), but threshold is the only setting that doesn’t seem to make any difference.

Do you get a difference in output when changing the threshold setting? What am I supposed to look at?

I’m talking about this one:

I’ve worked with many vectorization methods over the years so I know what to expect. It’s just that some behavior is raising questions. Like the one above. I really like this component, and it’s very useful.

About the double curves, I’ll try to create an example but am not in the position to do that right now.

That one looks really interesting as well, however, the unique option of rooster to pull color data from each blob is something I use in every sketch I’ve made so far.

I don’t know of another way to achieve this, maybe there are ways to combine the image sampler and a vectorizer to get color data, but it eludes me how to achieve this.