Motion blur of a colored image

19 visualizaciones (últimos 30 días)
May Sherif
May Sherif el 14 de Mayo de 2020
Editada: May Sherif el 14 de Mayo de 2020
I was trying to write a code to do a motion blur in multiple directions so I was able to make it using 2D convolution but after turning it to gray using rgb2gray function so is there is a way to return the image to rgb after the 2Dconvolution .
  1 comentario
Bjorn Gustavsson
Bjorn Gustavsson el 14 de Mayo de 2020
No, not really. There might be some cunning techniques to recolour rgb-images if you have a similar colour-palette. Use the very simple solution I supplied below. You're completely correct in doing it with a 2-D convolution. However, the simplest way is to do this on each of the R, G and B colour-planes separately.

Iniciar sesión para comentar.

Respuesta aceptada

Bjorn Gustavsson
Bjorn Gustavsson el 14 de Mayo de 2020
This is easiest to do color-plane by color-plane:
rgbMB(:,:,3) = conv2(rgbIM(:,:,3),K,'same');
rgbMB(:,:,2) = conv2(rgbIM(:,:,2),K,'same');
rgbMB(:,:,1) = conv2(rgbIM(:,:,1),K,'same');
You would have to handle casting your rgb-image to double, and then back.
In principal you could turn to convn but I think there is not that much time to gain by that.
HTH
  1 comentario
May Sherif
May Sherif el 14 de Mayo de 2020
Editada: May Sherif el 14 de Mayo de 2020
Thanks alot :)

Iniciar sesión para comentar.

Más respuestas (0)

Productos

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by