Code a simulation of image compression , Programming Languages

Your task will be to code a simulation of image compression based on the approximate low rank structure of the set of image patches. You will write functions .code = my block compress(I, B, nz); .I = my block reconstruct(code, B,m,n);

The function my block compress takes as input an m×n image grayscale I, extracts all the distinct 8 × 8 blocks from the image using the matlab command im2col, and finds the representation of each block in the (64× 64) orthogonal basis B, and then discards all but the nz largest magnitude coefficients over all the blocks in the image. The output code is a nz × 3 array which gives the nz most valuable coefficients for reconstructing all the patches, and the locations. It should be structured as follows: each entry of the first column of the variable code contains a coefficient. Each entry in the second column specifies which block that coefficient belongs to. Each entry in the third column specifies which basis element the coefficient belongs to1.

The function my block reconstructs takes as input a coded array code, a 64 × 64 basis B, and output size parameters m and n. It outputs an m× n image I reconstructed from the coefficients in code; you may use the function col2im if you find it convenient.

For example, suppose I is a 24×24 image. We can write I in block form:
I =0@
I1 I4 I7
I2 I5 I8
I3 I6 I9
1A
,
where Ik is a 8×8 matrix for k 2 {1, 2, ..., 9}. Using im2col on I, we obtain
J = (J1 J2 J3 J4 J5 J6 J7 J8 J9) = im2col(I, [8 8], 'distinct'),

Posted Date: 4/1/2013 2:09:14 AM | Location : United States







Related Discussions:- Code a simulation of image compression , Assignment Help, Ask Question on Code a simulation of image compression , Get Answer, Expert's Help, Code a simulation of image compression Discussions

Write discussion on Code a simulation of image compression
Your posts are moderated
Related Questions
Define a Prolog predicate flatten(List, FlattenedList)  that asserts List  is any nested list of atoms and  FlattenedList  is the same list with the nesting removed. The atom [] sh

Plan, design and dry run a program for the Little Man Computer (LMC) that produces the same result using a fixed number of 10 iterations.

Part 1 Given the following Regular Expressions, explain in detail the pattern accepted by each. Pay attention to all the characters being used. Your answers need not appear with

Normal 0 false false false EN-US X-NONE X-NONE MicrosoftInternetExplorer4

specify the function of the instruction and also specify whether its right or wrong-: (5) 1) MOV [BX],AX? Register Indirect addressing 2) MOV CX,[BX+DI]?Base plus index add

The last matrix operation which we'll see is matrix multiplication. Now there we will start along with two matrices, A nxp and B pxm . Remember hat A must have similar number of c

Define the Syntax of FOR Loop? The universal form of this statement is for(initialization;condition;increment/decrement)             { statements;             }

Question: (a) How does HTML allow you to: (i) turn an image into a clickable hyperlink? Include code to switch off the default border (ii) convert the above hyperlink i

Short Arrays: Array = randi(10,1,randi(6,1,1)+4)-5 This command will generate an array which you should be able to evaluate by hand (and also have your code evaluate for te

This case will lead to similar problem that we've had all other time we've run in double roots or double eigenvalues. We only find a single solution and will require a second solut