MATLAB Answers

How do I use encoder commands for Images in MATLAB

2 views (last 30 days)
kaano1
kaano1 on 25 May 2020
Hi everbody
I am trying to encode any image input. You can reach belong code MATLAB itself, except the cameraman.tif part. The problem is that when I write below code, I am getting 1x512 double output. My input is 256x256 double. I need to compare my input and output, but I can not use imshow command for output. Can you help me which part I need to change in for loop or any other part?
clear all
g=[1 0 0;1 1 1]; %generator polynomials
[n,K]=size(g);
m=K-1; %number of registers
state=zeros(1,m); %set registers to zero
I = imread('cameraman.tif');
I_in = im2double(I);
[trash,h]=size(I_in);
outputy=[];
for x=1:h
input=I_in(1,x);
for i=1:n
output(i) = g(i,1)*input;
for j = 2:K
z=g(i,j)*state(j-1);
output(i) = xor(output(i),z);
end;
end
state = [input,state(1:m-1)];
outputy=[outputy,output];
end
outputy;

  0 Comments

Sign in to comment.

Answers (0)

Tags