How to add embedded frame in video?

 Accepted Answer

Image Analyst
Image Analyst on 1 May 2013
Use MATLAB. Maybe just average it into each frame. I have no idea really since you weren't specific enough. Do you have some algorithm in mind?

2 Comments

tic
mov=aviread('C:\Users\PRIT\final1\wm1.avi');
ai=aviinfo('C:\Users\PRIT\final1\wm1.avi');
ai1 = mmreader('C:\Users\PRIT\final1\wm1.avi');
num=ai.NumFrames;
% disp (num);
im1 = read(ai1,1);
% b=rgb2gray(im1);
% imshow(im1);
disp(im1);
% c=de2bi(b);
% disp(c);
[m,n]=size(im1);
% d=c;
% disp(d);
b= reshape(im1,1,m*n);
disp(b);
% imshow(b);
.................................................
F1=fopen('e.txt');
c= fread(F1);
disp(c);
t1=uint8(c);
% im2 =im1';
% disp(im2);
t2=de2bi(t1);
disp(t2);
[o,p]=size(t2);
a= reshape(t2,1,o*p);
% % mat=padarray(im3,[0,1], 0, 'pre');
disp(a);
% [o,p]=size(mat);
.........................................
x=min(n,p)
for i=1:1
for j=1:x
% if(n==7)
%
% for k=1:o
% for l=1:p
b(i,j)=bitset(b(i,j),1,a(i*j));
% end
% end
%
end
end
% end
disp(b);
out= reshape(b,m,n);
% im7=imresize(b,[350 500]);
imshow(out);
SIR, this is a code for embedding text file. i have to add embedded frame into original video. i need ur help. please reply.
Why not just get rid of the loops over i and j and take the average:
b = uint8((double(b)+double(a))/2);
Is there anything wrong with that? Of course you could add weights to a and b to make a fainter or bolder.

Sign in to comment.

More Answers (1)

Pritish
Pritish on 1 May 2013
SIR I HAVE CODE FOR THIS. tic mov=aviread('C:\Users\PRIT\final1\wm1.avi'); ai=aviinfo('C:\Users\PRIT\final1\wm1.avi');
ai1 = mmreader('C:\Users\PRIT\final1\wm1.avi'); num=ai.NumFrames; % disp (num);
im1 = read(ai1,1);
% b=rgb2gray(im1); % imshow(im1); disp(im1); % c=de2bi(b); % disp(c); [m,n]=size(im1); % d=c; % disp(d); b= reshape(im1,1,m*n); disp(b); % imshow(b); ................................................. F1=fopen('e.txt'); c= fread(F1); disp(c); t1=uint8(c); % im2 =im1'; % disp(im2); t2=de2bi(t1); disp(t2); [o,p]=size(t2); a= reshape(t2,1,o*p); % % mat=padarray(im3,[0,1], 0, 'pre'); disp(a); % [o,p]=size(mat);
......................................... x=min(n,p) for i=1:1 for j=1:x % if(n==7) % % for k=1:o % for l=1:p b(i,j)=bitset(b(i,j),1,a(i*j)); % end % end % end end % end disp(b); out= reshape(b,m,n); % im7=imresize(b,[350 500]); imshow(out);
AFTER EMBEDDING TEXT FILE INTO FRAME, I HAVE TO ADD THIS FRAME INTO ORIGINAL VIDEO.BUT I AM UNABLE TO DO THAT. I NEED UR HELP TO ADD EMBEDDED FRAME INTO VIDEO WITH SAME FRAME NUMBER.

1 Comment

??? Is this the answer to your question? Or should it have been a comment to me? If you still have an issue, why did you accept my answer?

Sign in to comment.

Categories

Find more on Programming in Help Center and File Exchange

Community Treasure Hunt

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

Start Hunting!