How to perform salt and noise attack on watermarked video ?

7 次查看(过去 30 天)
There is various attacts exists for image processing. I want to conduct an image processing attacks (like salt and pepper) on entire watermarked video. Therefore, the retrived watermarke is going to further analysis after an image processing attack.
In last, I want to know, how to pefrom atacks on watermarked video?

回答(1 个)

Suraj Kumar
Suraj Kumar 2024-10-3
To perform a salt and pepper noise attack on a video in MATLAB, you can use the ‘imnoise function in MATLAB.
1. Read the video file using the class ‘VideoReader in MATLAB and then prepare to write the output video using ‘VideoWriter class.
videoReader = VideoReader(videoFile);
outputFile = 'attacked_video.mp4';
videoWriter = VideoWriter(outputFile, 'MPEG-4');
You can refer to the following links to learn more about these classes:
2. Loop through each frame of the video, add noise in each frame using the ‘imnoise function and then write the frame to the new video file.
while hasFrame(videoReader)
frame = readFrame(videoReader);
% Add salt-and-pepper noise
noisyFrame = imnoise(frame, 'salt & pepper', 0.1);
writeVideo(videoWriter, noisyFrame);
end
To learn more about ‘imnoise function in MATLAB, refer to the following documentation:
Hope this helps!

Community Treasure Hunt

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

Start Hunting!

Translated by