Skip to content

Commit 78d3a31

Browse files
authored
Update quantization.m
1 parent ab6bb19 commit 78d3a31

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

Quantization/quantization.m

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,9 +7,14 @@
77

88
for i = 1:size(input_image,1)
99
for j = 1:size(input_image,2)
10-
out_image(i,j) = (((round(input_image(i,j))/cluster_size)-cluster_size)/2);
10+
aux=0;
11+
while(aux<input_image(i,j))
12+
aux = aux + cluster_size;
13+
end
14+
out_image(i,j)=aux-cluster_size/2;
1115
end
1216
end
1317

1418
out_image = uint8(out_image);
1519
end
20+

0 commit comments

Comments
 (0)