How do I use encoder commands for Images in MATLAB

2 views (last 30 days)
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;

Answers (0)

Categories

Find more on Loops and Conditional Statements in Help Center and File Exchange

Tags

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!