Files

41 lines
1.0 KiB
Matlab
Executable File

% Create the text in an axis
hFstrip=figure;
%figure(hFstrip,'Visible','off')
t=text(.05,.05,tmPtTx,'FontSize',8, 'FontWeight','bold'); %, 'FontWeight','demi')
%Bspace= zeros(20,size(Fcutsc,2))+255;
F=[];
% Capture the text from the screen:
F=getframe(gca,[10 10 200 200]);
% Close the figure:
close
cc=[];
c=[];
% Select any plane of the resulting image:
cc=F.cdata(:,:,1);
c= cc(182:195,18:60);
%
i=[];
j=[];
% Determine where the text was (black is 0):
%[i,j]=find(cc == 0);
[i,j]=find(c < 255);
% Read in or load the image that is to contain the text:
% Use the size of that image, plus the row/column locations
% of the text, to determine locations in the new image:
%Bspace= zeros(20,size(Fcutsc,2))+255;
Bspace= zeros((210-size(Fcutsc,1)),size(Fcutsc,2))+255;
ind=[];
ind=sub2ind(size(Bspace),i,j);
% Index into new image, replacing pixels with white:
Bspace(ind)=uint8(0);
%figure
% Display and color the new image:
%imagesc(Bspace)
%axis image
%colormap(bone)
%htest=imagesc(Fstrip)