how select a frame from video and calculate its RBG value for watermark project

3 ビュー (過去 30 日間)
Shahad
Shahad 2015 年 11 月 15 日
コメント済み: Image Analyst 2022 年 5 月 13 日
Hi everyone, i'm a newbie to Matlab and i'm facing problem with it. I'm working on implementing a watermark algorithm for videos based on compressive sensing domain. i need to calculate the RGB value of each frame being read and then compare it to a pre-defined threshold. if it is greater than or equal to the threshold then i can embed the watermark text in a randomly selected sub-block of the frame. one more question, i run my initial code and i got this error:
Expected outputformat to match one of these strings:
'native', 'default'
The input did not match any of the valid strings.
the line which caused this error is:
for k =1:1: nFrames
mov(1).cdata =readFrame(v,k);
im = mov(1).cdata;
[r ,c, d ] = size (im);
if (1==1)
im (r, c, d ) = length (a);
else
try
im (r, c, d) = a(1-1);
end
end
end
any help will be much appreciated!
  2 件のコメント
cao Huynh
cao Huynh 2022 年 5 月 13 日
hello sir!
can u solve this problemm ?
Image Analyst
Image Analyst 2022 年 5 月 13 日
He accepted the answer so I guess he looked over my demo and figured out how to do it. Anyway, this was 7 years ago so I'm sure he wouldn't need it solved anymore if he hadn't gotten it solved by now.
If you have a simialr problem, and aren't able to adapt my demo to process your video, then read this first:
and post your m-file in a new question of your own (not here).

サインインしてコメントする。

採用された回答

Image Analyst
Image Analyst 2015 年 11 月 15 日
See my demo where I read in a video and "calculate the RGB value of each frame being read".
Your code is non-functional for several reasons, like the badly-named "a" not being defined, testing for the condition 1==1, using an index of (1-1) on an undefined array, etc. Just scrap that code and try to adapt mine, which is much more robust.
  1 件のコメント
Shahad
Shahad 2015 年 11 月 16 日
thank you so much for this helpful tutorial! if i need any more help, i will send you if that's not a bother to you.

サインインしてコメントする。

その他の回答 (0 件)

Community Treasure Hunt

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

Start Hunting!

Translated by