Borrar filtros
Borrar filtros

how to generate location of matrix?

2 visualizaciones (últimos 30 días)
Tia
Tia el 22 de Mzo. de 2013
1.how to generate location (1,1) of matrix 2. For example, we may have a 512x512 pixel image, on which we impose a grid of 512x512 threads that are subdivided into thread blocks with 8x8 threads each, for a total of 64x64 thread blocks. how to generate location (1,1) of matrix on each block 8x8 for 64x64thread blocks?i would like to get location (1,1) on each block 8x8 then multiply with 0-255.
thanks
  2 comentarios
Image Analyst
Image Analyst el 22 de Mzo. de 2013
Editada: Image Analyst el 22 de Mzo. de 2013
Define "thread" and "thread block". They are not standard terms when discussing images.
Tia
Tia el 22 de Mzo. de 2013
Editada: Andrei Bobrov el 22 de Mzo. de 2013
I=double(imread('lena.jpg'));
T=dctmtx(8);
dct2 = @(a) T * a.data * T';
[mI,nI]=size(I);
mb=mI/8;nb=nI/8;
x=randi([0,255],8,8);
dc=mean2(I);
m=x.*dc;
B = blockproc(I,[8 8],dct2);
B2 = blockproc(B,[8 8],@(a) m .* a.data);
idct2 = @(a) T' * a.data * T;
I2 = blockproc(B2,[8 8],idct2);
imshow(I), figure, imshow(I2)
i want to change value on dc (DCT coefficient) from 0 to 255. how to write it? when i run it, B2 can't be operate. actually, i want to generate location (1,1) of matrix from that image. thank you

Iniciar sesión para comentar.

Respuesta aceptada

Walter Roberson
Walter Roberson el 22 de Mzo. de 2013
B2(1:64:end, 1:64:end) = 255;

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