Quarter of an image.

3 visualizaciones (últimos 30 días)
Ferdows Dolon
Ferdows Dolon el 13 de Sept. de 2014
Respondida: Image Analyst el 13 de Sept. de 2014
Hi everyone, I am stuck with this problem. I need to Write a Matlab function that will drop every second even number pixel. Row-wise: you retain one pixel, and then you drop the next pixel, until you reach the end of that row. Column-wise: you retain one pixel, and you drop the next pixel, until you reach the end of that column. The image should therefore be a quarter of its original size.
Thank you very much. regards.

Respuesta aceptada

Image Analyst
Image Analyst el 13 de Sept. de 2014
Try this on your input matrix m:
quarterMatrix = m(2 : 2 : end, 2 : 2 : end);

Más respuestas (1)

Youssef  Khmou
Youssef Khmou el 13 de Sept. de 2014
Using vector function,the problem becomes simple, here is an example to select 1/4 of matrix :
N=400;
H=randn(N);
line=1:2:N;
V=H(:,line);
Final=V(line,:);

Categorías

Más información sobre Images en Help Center y File Exchange.

Community Treasure Hunt

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

Start Hunting!

Translated by