VC program for color images
조회 수: 11 (최근 30일)
이전 댓글 표시
I was writing a program for my college project.The program'saim is to hid color images using meaningful shares.So in order to hide an image.I used two cover images.I was supposed to write two function programs for the main programs.I am unable to accept values returned from the first function SecCodTbl.
Here is the code for the main program %main.m %Clear Memory & Command Window clc; clear all; close all;
%Read input color image(Secret Image) inpsi=imread('lenaV.jpg');
%cmy output opsi=rgb2cmy(inpsi); figure;imshow(opsi);
%Read input color image(Cover Image A) inpca=imread('veg.jpg');
%cmy output opca=rgb2cmy(inpca); opca=imresize(opca,[512 512]); figure;imshow(opca);
%Read input color image(Cover Image B) inpcb=imread('Castle.png');
%cmy output opcb=rgb2cmy(inpcb); figure;imshow(opcb); share1=zeros(512,512,3); share2=zeros(512,512,3); %Secret coding table [share1, share2] = SecCodTbl(opsi); figure;imshow(share1); figure;imshow(share2);
and the function SecCodTbl %SecCodTbl.m function [share1, share2] = SecCodTbl(inImg)
s=size(inImg); for i=1:s(1) for j=1:s(2) if(inImg(i,j)=='w') share1(2*i-1,2*j-1)='y'; share1(2*i-1,2*j)='c'; share1(2*i,2*j-1)='w'; share1(2*i,2*j)='m'; share2(2*i-1,2*j-1)='y'; share2(2*i-1,2*j)='c'; share2(2*i,2*j-1)='w'; share2(2*i,2*j)='m';
elseif(inImg(i,j)=='c')
share1(2*i-1,2*j-1)='y';
share1(2*i-1,2*j)='c';
share1(2*i,2*j-1)='w';
share1(2*i,2*j)='m';
share2(2*i-1,2*j-1)='y';
share2(2*i-1,2*j)='w';
share2(2*i,2*j-1)='c';
share2(2*i,2*j)='m';
elseif(inImg(i,j)=='m')
share1(2*i-1,2*j-1)='y';
share1(2*i-1,2*j)='c';
share1(2*i,2*j-1)='w';
share1(2*i,2*j)='m';
share2(2*i-1,2*j-1)='y';
share2(2*i-1,2*j)='c';
share2(2*i,2*j-1)='m';
share2(2*i,2*j)='w';
elseif(inImg(i,j)=='y')
share1(2*i-1,2*j-1)='y';
share1(2*i-1,2*j)='c';
share1(2*i,2*j-1)='w';
share1(2*i,2*j)='m';
share2(2*i-1,2*j-1)='y';
share2(2*i-1,2*j)='c';
share2(2*i,2*j-1)='m';
share2(2*i,2*j)='w';
elseif(inImg(i,j)=='b')
share1(2*i-1,2*j-1)='y';
share1(2*i-1,2*j)='c';
share1(2*i,2*j-1)='w';
share1(2*i,2*j)='m';
share2(2*i-1,2*j-1)='y';
share2(2*i-1,2*j)='m';
share2(2*i,2*j-1)='w';
share2(2*i,2*j)='c';
elseif(inImg(i,j)=='r')
share1(2*i-1,2*j-1)='y';
share1(2*i-1,2*j)='c';
share1(2*i,2*j-1)='w';
share1(2*i,2*j)='m';
share2(2*i-1,2*j-1)='m';
share2(2*i-1,2*j)='c';
share2(2*i,2*j-1)='w';
share2(2*i,2*j)='y';
elseif(inImg(i,j)=='g')
share1(2*i-1,2*j-1)='y';
share1(2*i-1,2*j)='c';
share1(2*i,2*j-1)='w';
share1(2*i,2*j)='m';
share2(2*i-1,2*j-1)='c';
share2(2*i-1,2*j)='y';
share2(2*i,2*j-1)='w';
share2(2*i,2*j)='m';
elseif(inImg(i,j)=='k')
share1(2*i-1,2*j-1)='y';
share1(2*i-1,2*j)='c';
share1(2*i,2*j-1)='w';
share1(2*i,2*j)='m';
share2(2*i-1,2*j-1)='m';
share2(2*i-1,2*j)='w';
share2(2*i,2*j-1)='c';
share2(2*i,2*j)='y'
end
end
end
Please help me out.
댓글 수: 1
Image Analyst
2017년 4월 16일
I don't know what kind of help you need, but we're not supposed to talk about cryptography on the Mathworks servers.
답변 (0개)
참고 항목
카테고리
Help Center 및 File Exchange에서 Encryption / Cryptography에 대해 자세히 알아보기
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!