Opencv wind filter

Can someone suggest me how to make the wind filter effect in opencv look like the one available in photoshop and gimp?

Here is an image of text with a filter created by the wind. text with wind effect

thanks

+4
source share
1 answer

I suggest the following steps:

Use the original text image as a mask. White pixels are "1", black pixels are "0".

Smooth the image in the X direction (as in the example you added)

  • You can perform smoothing using a horizontal vector filter.
  • or use distance conversion, where the distance is calculated only along the x axis.
  • I think remote conversion will work faster

Multiply the result by (1-mask), so smoothing will occur only outside the text.

Multiply each row of the result by a random number in the range [0,1..1]. This will make the smoothing uneven.

Add the original image of the text to the result to get the final image

0
source

Source: https://habr.com/ru/post/1344305/


All Articles