113projmatlabcode

113projmatlabcode - birdsMatrix = imread('birds','bmp');...

Info iconThis preview shows pages 1–3. Sign up to view the full content.

View Full Document Right Arrow Icon
birdsMatrix = imread('birds','bmp'); buildingMatrix = imread('building','bmp'); birdsMatrix = double(birdsMatrix); buildingMatrix = double(buildingMatrix); imshow(birdsMatrix, [0 255]) title('Birds') imshow(buildingMatrix, [0 255]) title('Building') size(birdsMatrix) size(buildingMatrix) 4.2 birdsMatrix = birdsMatrix - 128; buildingMatrix = buildingMatrix - 128; fun = @dct2; birdsdct = blkproc(birdsMatrix, [8 8], fun); buildingdct = blkproc(buildingMatrix, [8 8], fun); *******4.2.1.c.********* imshow(log(abs(birdsdct)+.001), []) title('Birds after DCT') imshow(log(abs(buildingdct)+.001), []) title('Building after DCT') load('zonal_quant_table.mat'); fun2 = @(X) round(X./(.5*zonal_quant_table); birdsquanthalf = blkproc(birdsdct, [8 8], fun2); buildingquanthalf = blkproc(buildingdct, [8 8], fun2); fun2 = @(X) round(X./(1*zonal_quant_table); birdsquant1 = blkproc(birdsdct, [8 8], fun2); buildingquant1 = blkproc(buildingdct, [8 8], fun2); fun2 = @(X) round(X./(2*zonal_quant_table); birdsquant2 = blkproc(birdsdct, [8 8], fun2); buildingquant2 = blkproc(buildingdct, [8 8], fun2); fun2 = @(X) round(X./(4*zonal_quant_table); birdsquant4 = blkproc(birdsdct, [8 8], fun2); buildingquant4 = blkproc(buildingdct, [8 8], fun2); fun2 = @(X) round(X./(8*zonal_quant_table); birdsquant8 = blkproc(birdsdct, [8 8], fun2); buildingquant8 = blkproc(buildingdct, [8 8], fun2); fun2 = @(X) round(X./(16*zonal_quant_table); birdsquant16 = blkproc(birdsdct, [8 8], fun2); buildingquant16 = blkproc(buildingdct, [8 8], fun2); fun3 = @(X) X.*(.5*zonal_quant_table); birdsinvhalf = blkproc(birdsquanthalf, [8 8], fun3); buildinginvhalf = blkproc(buildingquanthalf, [8 8], fun3);
Background image of page 1

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon
fun3 = @(X) X.*(1*zonal_quant_table);
Background image of page 2
Image of page 3
This is the end of the preview. Sign up to access the rest of the document.

Page1 / 4

113projmatlabcode - birdsMatrix = imread('birds','bmp');...

This preview shows document pages 1 - 3. Sign up to view the full document.

View Full Document Right Arrow Icon
Ask a homework question - tutors are online