Image size reduction using scaling

1 visualización (últimos 30 días)
Sreya
Sreya el 20 de Abr. de 2017
Comentada: Sreya el 21 de Abr. de 2017
Hi, I want to reduce the size of an image in such a way that, the sample pixels are selected from the image with 16 pixel distance from each other, and in this manner, a smaller image is formed by using an average value of every other pixel in this neighborhood to represent the pixel value in the scaled image. Is it same as imresize(), or is there any other way to do this?

Respuesta aceptada

Jan
Jan el 20 de Abr. de 2017
This can be done efficiently by FEX: BlockMean. You can run the M-version, but if the process is time critical, compile the C-Mex function.
  3 comentarios
Jan
Jan el 20 de Abr. de 2017
Img = rand(640, 480, 3); % Test data
Img16 = BlockMean(Img, 16, 16);
This creates the average over blocks of 16x16 pixels. Pixels on the right and bottom, which do not match into the 16x16 grid are ignored.
Sreya
Sreya el 21 de Abr. de 2017
Thank you

Iniciar sesión para comentar.

Más respuestas (0)

Community Treasure Hunt

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

Start Hunting!

Translated by