I want to encrypt an colour image with a psuedo random sequence and decrypt the image with the same sequence.How will be the program for the same.
MATLAB: How can i encrypt a colour image with a psuedo random sequence
encryptionpsuedo random sequence
Related Solutions
OK, try this...looks like I think yours would given the aforementioned fact that the actual data range is so compacted into the limits that there's nothing but a blob going to show up...but it does handle the ticks and labels as I think you want...
Note that the full five tick marks/labels show up at the very beginning where they matchup precisely but after that since you're continually munging on the limits the number in range varies as they shift off to the left until refreshed. This may be okay for your purpose.
hax=axes('Position',[0.07,0.1,0.9,0.80],'ylim',[-1,1],'box','on');set(hax,'xtick',[],'xticklabel',[])set(gcf,'position',[579 344 560 420]) % get it out of the way...
hold(hax,'on') % Initialization constants
onehundredmsec = 1/864000;Fs=2460; % sample rate in case changes
Fs2=Fs/2;xLen=Fs2-1; x1=0; x2=x1; % data buffer lengths, start
xLLen=Fs2*2*120; % xlim width
xLDel=Fs2; % xlim delta
xl1=-Fs2*120; % axis limit initialization
xl2=xl1+xLLen;tix=xl1:xLLen/4:xl2; % 5 tick positions based on above
idx=0;cntr=0;B=[];for i = 1:120 idx = idx + 1; D = rand(246,1); T = linspace(now - onehundredmsec, now,246)'; B = [B; [T D]]; if idx>4 cntr=cntr+1; x1=x2+1; x2=x1+xLen; % increment x-axis value ranges (no mult needed)
xl1=xl1+xLDel; xl2=xl1+xLLen; % xlimit ranges
tix=tix+xLDel; % update ticks, too...
xlim(hax,[xl1,xl2]) x=[x1:x2]'; % new x range
plot(x,B(:,2)) if cntr==1 || rem(cntr,120)==0 CTime = B(1,1); [y,mo,d,h,m,s]=datevec(CTime); ds=datestr(datenum(y,mo,d,h,m-1,fix(s)+[0:30:120]'),'hh:MM:ss'); set(hax,'xtick',tix,'xticklab',ds) end B=[]; idx=0; end pause(0.1)end
Also, note for overhead reduction you really don't need the T vector at all for the plotting, only the current time with the 100 msec subtracted is the only actual value used, at least for the plotting. If you need it for archiving purposes, that's the obvious reason to keep it anyway, of course.
ADDENDUM:
The real overhead in the above is the use of plot() repeatedly--this is creating a new line object every call and all the associated overhead of a full call and the associated handles, etc. I suspect it will eventually fail on memory and/or handles or somesuch.
Once you think the effect is at wanted, then can work on a much more efficient manner to present the actual data. Basically, you'll want to mung on the [x|y]data property directly after the initial data are drawn. There's an article in the 2D graphics section on animation that outlines the general ideas to use. But, before for that see if the above doesn't at least give the initial desired appearance.
Developing another Photoshop is a daunting task. If you can't afford Photoshop, try the free GIMP. That said, if you want to do morphology on grayscale images (even pseudocolored images which are just indexed images which are grayscale images with an associated color map), you can do that with no problem. Doing morphology on RGB images by doing each color channel independently can also be done, though I don't know why you'd want to do that since it's not clear what the result really means. You can extract individual color channels like this redChannel = rgbImage(:,:,1); and so on. You can also do CLAHE using adapthisteq() in the Image Processing Toolbox, or you can look at my Custom-shaped Histogram File Exchange submission if you want to do a really perfect histogram equalization (much better than the standard methods since it really flattens the histogram unlike traditional methods). http://www.mathworks.com/matlabcentral/fileexchange/?term=authorid%3A31862
Best Answer