Ask Your Question

Revision history [back]

click to hide/show revision 1
initial version

Replace Color of Image

Hello, I recently started with opencv and i need a color-replacement logic for image processing. My Images are RGB with transparent background. (I think this is the main reason i struggle)

What i want to do:

  • Search for groups that only exist of 0xFFF (White)
  • Replace them with 0x000 (Black), but only if the shape has a transparent pixel as a neighbour.

image description

I tried working with connectedComponentsWithStats but the problem is it does not work with rgb + transparent images.

Does anyone have an idea and a hint for me how I could start?

Which methods/algorithms do you recommend for me?

I'm thankful for any kind of help!

Cheers Stefan

Replace Color of Image

Hello, I recently started with opencv and i need a color-replacement logic for image processing. My Images are RGB with transparent background. (I think this is the main reason i struggle)

What i want to do:

  • Search for groups that only exist of 0xFFF (White)
  • Replace them with 0x000 (Black), but only if the shape has a transparent pixel as a neighbour.

image description

I tried working with connectedComponentsWithStats but the problem is it does not work with rgb + transparent images.

Does anyone have an idea and a hint for me how I could start?

Which methods/algorithms do you recommend for me?

I'm thankful for any kind of help!

Cheers Stefan

Replace Color of ImageImage With Criteria

Hello, I recently started with opencv and i need a color-replacement logic for image processing. My Images are RGB with transparent background. (I think this is the main reason i struggle)

What i want to do:

  • Search for groups that only exist of 0xFFF (White)
  • Replace them with 0x000 (Black), but only if the shape has a transparent pixel as a neighbour.

image description

image description

I tried working with connectedComponentsWithStats but the problem is it does not work with rgb + transparent images.

Does anyone have an idea and a hint for me how I could start?

Which methods/algorithms do you recommend for me?

I'm thankful for any kind of help!

Cheers Stefan

Replace Color of Image With Criteria

Hello, I recently started with opencv and i need a color-replacement logic for image processing. My Images are RGB with transparent background. (I think this is the main reason i struggle)

What i want to do:

  • Search for groups that only exist of 0xFFF (White)
  • Replace them with 0x000 (Black), but only if the shape has a transparent pixel as a neighbour.

image description

image description

I tried working with connectedComponentsWithStats but the problem is it does not work with rgb + transparent images.

Does anyone have an idea and a hint for me how I could start?

Which methods/algorithms do you recommend for me?

I'm thankful for any kind of help!

Cheers Stefan