HI everyone. I’m using opencv for java (truly I’m using opencvForUnity but is the same as java version)
I’ve a black image with a white blob. I need to reduce the white blob every frame until it disappear. I need to control the speed of that reduction and the effect shouldn’t be stuttering.
this is my solution for each frame:
element = Imgproc.getStructuringElement(Imgproc.MORPH_ELLIPSE, new Size(2*morph_size + 1 , 2*morph_size +1), new Point( morph_size, morph_size));
if(timerErode < Time.time) {
timerErode = Time.time + speedErode;
Imgproc.morphologyEx(contoursRemoveImage, contoursRemoveImage, Imgproc.MORPH_ERODE, element);
}
“SpeedErode” is the delay between one erode and another (with this value > 0.05s, the effect is stuttering)
“contoursRemoveImage” is the image
"morph_size " is set to 1, otherwise the erosion is too large.
Is there another way to obtain this effect? Is this the minimum erosion that I can do?
Thank you very much and sorry for my English, this is not my language