color blend blobs
in
Contributed Library Questions
•
2 years ago
Hi all, thank you in advance for your time.
I'm using opencv in processing..one of the issues, critical for me, is to mix and split the colors blobs. I mean..if I have two blobs: 0 (255,0,0) and 1 (0,255,0) I want the following one (255,0,0)...this in case the area is the same...otherwise the proportion is different. When I want to split the last blob..I want also to split the color..and it depends again basically on how much area they have now.
So for example, if I divide the blob in 10 / 90 % the following blob should get 10 % of (255,255,0) and 90 % (255,255,0).
by now...i just putted some conditions..based on area pixel and blob ID..
if (area > 6500) {
if (i == 0) {
// fill(255,0,0); magenta
fill (236,0,140);
beginShape();
for( int j=0; j<points.length; j++ ) {
stroke(0,255);
vertex( points[j].x, points[j].y );
}
endShape(CLOSE);
noStroke();
etc...but it doesn't make sense when I want the new color blob as a sum of the previous ones.
Essentially the only initial condition is to have a 255,255,255 for one blob..and then to subtract value more and more I split it. I don't mind if I don't get exactly the same colors after 2/3 operations..but it's important to have a right color from the previous where it comes from, eventually from more than two blobs.
Any help or suggestion would be really appreciated. Thanks!
I'm using opencv in processing..one of the issues, critical for me, is to mix and split the colors blobs. I mean..if I have two blobs: 0 (255,0,0) and 1 (0,255,0) I want the following one (255,0,0)...this in case the area is the same...otherwise the proportion is different. When I want to split the last blob..I want also to split the color..and it depends again basically on how much area they have now.
So for example, if I divide the blob in 10 / 90 % the following blob should get 10 % of (255,255,0) and 90 % (255,255,0).
by now...i just putted some conditions..based on area pixel and blob ID..
if (area > 6500) {
if (i == 0) {
// fill(255,0,0); magenta
fill (236,0,140);
beginShape();
for( int j=0; j<points.length; j++ ) {
stroke(0,255);
vertex( points[j].x, points[j].y );
}
endShape(CLOSE);
noStroke();
etc...but it doesn't make sense when I want the new color blob as a sum of the previous ones.
Essentially the only initial condition is to have a 255,255,255 for one blob..and then to subtract value more and more I split it. I don't mind if I don't get exactly the same colors after 2/3 operations..but it's important to have a right color from the previous where it comes from, eventually from more than two blobs.
Any help or suggestion would be really appreciated. Thanks!
1