## entropy encoding for images

on 24 Dec 2012

Walter Roberson

### Walter Roberson (view profile)

on 24 Dec 2012

What difficulty are you having with the code version of it that you wrote?

FIR

### FIR (view profile)

on 25 Dec 2012

I am using 2010a version

code is

` [dict,avglen] = huffmandict(symbols,p) `
` comp = huffmanenco(img,dict);`

but taking long time to run and crashes out

## Products

No products are associated with this question.

on 24 Dec 2012

FIR

### FIR (view profile)

on 25 Dec 2012

is there any codes available for shanon fano encoding

Walter Roberson

### Walter Roberson (view profile)

on 25 Dec 2012

what does

```length(count)
```

show? And also

```sum(count <= 0)
```

?

FIR

### FIR (view profile)

on 25 Dec 2012

length(count)

ans =

`   238`

>> sum(count <= 0)

ans =

`     8`

### Walter Roberson (view profile)

on 25 Dec 2012
Edited by Walter Roberson

### Walter Roberson (view profile)

on 25 Dec 2012

http://www.mathworks.com/help/stats/tabulate.html

```If x is a numeric array, TABLE is a numeric matrix. If the elements of x are nonnegative integers, TABLE includes 0 counts for integers between 1 and max(x) that do not appear in x.
```

But you already read the documentation so you already knew that, so somehow you must have gotten some negative counts. What does

```count(counts <= 0)
```

show, and what does class(count) show?

FIR

### FIR (view profile)

on 25 Dec 2012

No walter i could not findout,so walter is there any codes for shanon fanon

FIR

### FIR (view profile)

on 25 Dec 2012
```after deleting zeros i get error
```
```Error using ==> arithenco at 36
The symbol sequence parameter can take values only between 1 and the length of the
symbol counts parameter.
```
```Error in ==> sample6 at 79
code=arithenco(seq,count);
```
Walter Roberson

### Walter Roberson (view profile)

on 25 Dec 2012

Sorry, Google doesn't seem to be accessible to me tonight. Perhaps you could try it from your end?

#### Join the 15-year community celebration.

Play games and win prizes!

MATLAB and Simulink resources for Arduino, LEGO, and Raspberry Pi