Continue to Site

Welcome to EDAboard.com

Welcome to our site! EDAboard.com is an international Electronics Discussion Forum focused on EDA software, circuits, schematics, books, theory, papers, asic, pld, 8051, DSP, Network, RF, Analog Design, PCB, Service Manuals... and a whole lot more! To participate you need to register. Registration is free. Click here to register now.

Image Ciphering Function With Matlab

Status
Not open for further replies.

metalnumb

Newbie level 4
Joined
Jun 7, 2011
Messages
6
Helped
0
Reputation
0
Reaction score
0
Trophy points
1,281
Activity points
1,333
Hey Guys !
I've been woking on this project and i dont know why it does not work....:evil:
its required to make a simple ciphering function for images with any dimension..( just to make its details unclear for example) :cool:

Code:
function [op]=cphx(ip)

n= ip([end:-1:1],[end:-1:1],:) ;    %  flipped 180 degrees and mirrored.

% Puzzling The Image
%====================
a=n([1:end/2],[1:end/2],:) ;       % i.e (1/4) of the image(dividing the image into 4 chunks)=(A)
b=n([end/2:end],[1:end/2],:) ;     % =(B) 
c=n([1:end/2],[end/2:end],:) ;     % =(C)
d=n([end/2:end],[end/2:end],:) ;   % =(D)
op=[a d;c b];                       % Shuffling the pieces will render the image almost ciphered.

it just gives this error everytime i call the function... :shock:


Code:
??? Subscript indices must either be real positive integers or logicals.

Error in ==> cphx at 8
b=n([end/2:end],[1:end/2],:) ;     % =(B)

what am i doing wrong ? please help me out !
thanks in advance !!;-)
 

Here is a good Discussion
h**p://www.mathworks.in/support/tech-notes/1200/1207.html#19
 

Status
Not open for further replies.

Similar threads

Part and Inventory Search

Welcome to EDABoard.com

Sponsor

Back
Top