Популярное

Музыка Кино и Анимация Автомобили Животные Спорт Путешествия Игры Юмор

Интересные видео

2025 Сериалы Трейлеры Новости Как сделать Видеоуроки Diy своими руками

Топ запросов

смотреть а4 schoolboy runaway турецкий сериал смотреть мультфильмы эдисон
dTub
Скачать

Arithmetic Coding in Digital Image Processing with example&its Implementation in MATLAB||Compression

Автор: Study with Dr. Dafda

Загружено: 2022-08-11

Просмотров: 7955

Описание:

Video lecture series on Digital Image Processing, Lecture: 40,
Arithmetic coding in Digital Image Processing with example and its Implementation in MATLAB
Link to download ppts/lecture notes:
https://drive.google.com/drive/folder...
#DIP
#DIPwithMATLAB
#DigitalImageProcessingUsingMATLAB
#DigitalImageProcessing
#StudywithDrDafda
MATLAB codes...
% % %Program for Arithmetic
close all;
clear all;
clc;
str = 'dafda';
fprintf('The entered string is : %s\n', str);
len = length(str);
fprintf('The length of the string is : %d\n', len);

% % % get unique characters from the string
u = unique(str)
% disp('the unique symbols/characters are');
% disp(u);
fprintf('The unique characters are : %s\n', u);
len_unique = length(u);
fprintf('The length of unique character string is : %d\n', len_unique);
% % % General lookup table
% % % get zeros of length of unique characters
z = zeros(1, len_unique);
p = zeros(1, len_unique);

for i = 1 : len_unique

% % % in 'z' variable we find the occurrence of each characters from 'str'
z(i) = length(findstr(str, u(i)));

% % % in 'p' variable we will get probability of those occurrences
p(i) = z(i) / len;
end
display(z);
display(p);

% % % in 'cpr' variable we will get the cumulative
cpr = cumsum(p);
% % % in 'newcpr' 'cpr' from '0' till last value of 'p'
newcpr = [0 cpr];

display(cpr);
display(newcpr);

% % % make table upto size of 'len_unique'
for i = 1 : len_unique

% % % in first column we are placing 'newcpr' values
table(i, 1) = newcpr(i);

% % % in second column we are placing 'cpr' values
table(i, 2) = cpr(i);
end

% % % Displaying the lookup table
display('The lookup table is : ')
display(table);

% % % Encoder Table

LL = 0;
HL = 1;
for i = 1 : len
for j = 1 : len_unique

% % % if the value from 'str' matches with 'u' then
if str(i) == u(j);
pos = j;
j = j + 1;

% % % displaying position of symbol in unique string
display(pos);

% % % getting the tag value of the matched character
diff_range = HL - LL
HL = LL + (diff_range .* table(pos, 2))
LL = LL + (diff_range .* table(pos, 1))
i = i + 1;
break
end
end
end
% % % displaying tag value
tag = LL;
display(tag);
%%% DECODING %%%
str = '';
% str = [];
for i = 1 : len
for j = 1 : len_unique
% % % If tag value falls between a certain range in lookup table then
if tag (greater than or)= table(j, 1) && tag (less than) table(j, 2)
pos = j;
tag = (tag - table(pos, 1)) / p(j);

% % % Getting the matched tag value character
decoded_str = u(pos);

% % % String concatenating 'decoded_str' into 'str'
str = horzcat(str, decoded_str);
break
end
end
end
% str=horzcat(str);
% Displaying final decoded string
disp('The decoded string is : ');
display(str)

% % %Program for Arithmetic encoding and decoding of an image
close all;
clear all;
clc;
I = imread('Cameraman.tif');
I = imresize(I, [3 NaN]);
disp('the pixel values are:');
disp(I);
subplot(1,2,1);
imshow(uint8(I));
title('Original image');
str=reshape(I.',1,[] ); % Convert Image from 2D to 1D
len = length(str);
fprintf('The length of the string is : %d\n', len);
u = unique(str)
disp('the unique symbols/characters are');
disp(u);
% fprintf('The unique characters are : %s\n', u);
% length of the unique characters string
len_unique = length(u);
fprintf('The length of unique character string is : %d\n', len_unique);
z = zeros(1, len_unique);
p = zeros(1, len_unique);

for i = 1 : len_unique
z(i) = length(findstr(str, u(i)));
p(i) = z(i) / len;
end
display(z);
display(p);
cpr = cumsum(p);
newcpr = [0 cpr];

display(cpr);
display(newcpr);

% % % make table till 'len_unique' size
for i = 1 : len_unique

% % % in first column we are then placing 'newcpr' values
table(i, 1) = newcpr(i);

% % % in second column we are placing 'cpr' values
table(i, 2) = cpr(i);
end

% % % Displaying the lookup table
display('The lookup table is : ')
display(table);

% % % Encoder Table

LL = 0;
UL = 1;
for i = 1 : len
for j = 1 : len_unique

% % % if the value from 'str' matches with 'u' then
if str(i) == u(j);
pos = j;
j = j + 1;

% % % displaying position of symbol in unique string
display(pos);

% % % getting the tag value of the matched character
diff_range = UL - LL;
UL = LL + (diff_range .* table(pos, 2));
LL = LL + (diff_range .* table(pos, 1));
i = i + 1;
break
end
end
end

% % % displaying tag value
tag = LL;
display(tag);
%%% DECODING %%%
%str = '';
str = [];

for i = 1 : len
for j = 1 : len_unique

% % % If tag value falls between a certain range in lookup table then
if tag (greater than or)= table(j, 1) && tag (less than) table(j, 2)
pos = j;
tag = (tag - table(pos, 1)) / p(j);

% % % Getting the matched tag value character
decoded_str = u(pos);

% % % Image pixel values concatenating 'decoded_str' into 'str'
str = horzcat(str, decoded_str);
break
end
end
end
% str=horzcat(str);
% % % Displaying final decoded image pixel values
display(str)
DD=uint8(str);
Restore=reshape(DD,3,3);
subplot(1,2,2);
imshow(Restore.');
title('Decoded Image');

Arithmetic Coding in Digital Image Processing with example&its Implementation in MATLAB||Compression

Поделиться в:

Доступные форматы для скачивания:

Скачать видео mp4

  • Информация по загрузке:

Скачать аудио mp3

Похожие видео

LZW compression using easy method(Dictionary-based coding)in DIP & its Implementation in MATLAB #DIP

LZW compression using easy method(Dictionary-based coding)in DIP & its Implementation in MATLAB #DIP

these compression algorithms could halve our image file sizes (but we don't use them) #SoMEpi

these compression algorithms could halve our image file sizes (but we don't use them) #SoMEpi

Digital Image Processing

Digital Image Processing

Data Compression (Summer 2023) - Lecture 14 - Arithmetic Coding

Data Compression (Summer 2023) - Lecture 14 - Arithmetic Coding

Image Compression

Image Compression

АРИФМЕТИЧЕСКОЕ КОДИРОВАНИЕ

АРИФМЕТИЧЕСКОЕ КОДИРОВАНИЕ

Thresholding : Global and Adaptive(local) in DIP and its implementation in MATLAB

Thresholding : Global and Adaptive(local) in DIP and its implementation in MATLAB

Как сжимаются изображения? [46 МБ ↘↘ 4,07 МБ] JPEG в деталях

Как сжимаются изображения? [46 МБ ↘↘ 4,07 МБ] JPEG в деталях

Куда дрейфует Латынина: фактчек недавних заявлений

Куда дрейфует Латынина: фактчек недавних заявлений

LZW-кодирование | Цифровая обработка изображений

LZW-кодирование | Цифровая обработка изображений

Huffman Coding in Digital Image Processing with example & its Implementation in MATLAB ||Compression

Huffman Coding in Digital Image Processing with example & its Implementation in MATLAB ||Compression

Typst: Современная замена Word и LaTeX, которую ждали 40 лет

Typst: Современная замена Word и LaTeX, которую ждали 40 лет

Объяснение двумерной свертки: фундаментальная операция в компьютерном зрении

Объяснение двумерной свертки: фундаментальная операция в компьютерном зрении

Для Чего РЕАЛЬНО Нужен был ГОРБ Boeing 747?

Для Чего РЕАЛЬНО Нужен был ГОРБ Boeing 747?

Arithmetic coding Procedure

Arithmetic coding Procedure

4 Hours Chopin for Studying, Concentration & Relaxation

4 Hours Chopin for Studying, Concentration & Relaxation

Huffman Codes: An Information Theory Perspective

Huffman Codes: An Information Theory Perspective

Краткое объяснение больших языковых моделей

Краткое объяснение больших языковых моделей

Почему простые числа образуют эти спирали? | Теорема Дирихле и пи-аппроксимации

Почему простые числа образуют эти спирали? | Теорема Дирихле и пи-аппроксимации

Arithmetic coding in image compression.

Arithmetic coding in image compression.

© 2025 dtub. Все права защищены.



  • Контакты
  • О нас
  • Политика конфиденциальности



Контакты для правообладателей: infodtube@gmail.com