You are now following this question
- You will see updates in your followed content feed.
- You may receive emails, depending on your communication preferences.
Embed watermark in background of an document image
1 view (last 30 days)
Show older comments
I need code to embed and extract watermark in background of a document image.
13 Comments
Walter Roberson
on 26 Jan 2020
Image Analyst
on 20 Mar 2020
Walter Roberson
on 21 Mar 2020
Good point -- in order to add a watermark in the background, you have to be able to figure out which parts of the image are the background.
Unfortunately, there is no reliable way of figuring that out. For example, if you are given a picture of the Sun, then if you are studying the Sun then the main portion is the foreground and everything else is background, but if you are studying solar comments making close approaches to the Sun, then you want to block the Sun out as background, and the other little blobs in the image become the foreground. No program, given just the image, can know from the image alone what part of the image is foreground or background, because foreground and background have to do with intent rather than with inherent properties of the image.
Balkar Singh
on 22 Feb 2021
@KALYAN ACHARJYA yes sir, but did not get solution related to my problem.
Walter Roberson
on 22 Feb 2021
Which algorithm did you decide upon? What error did you encounter in your MATLAB implementation of the algorithm?
Balkar Singh
on 7 Mar 2021
clear all;
a1=imread('Marksheet1.png');
a2=imresize(a1, [256 256]);
a = a2(1:256,1:256,1);
blk1 = our_blkproc(a,blksize1);
cover_img = zeros(8,8,size(blk1,3));
for i=1:size(blk1,3)
cover_img(:,:,i) = dct2(blk1(:,:,i));
end
% cover_img1 = cover_img/2;
b1 = imread('logo.png');
b2 = imresize(b1, [128 128]);
blksize2=[8,8];
b = b2(1:128,1:128,1);
blk2 = our_blkproc(b,blksize2);
water_img = zeros(8,8,size(blk2,3));
for i=1:size(blk2,3)
water_img(:,:,i) = dct2(blk2(:,:,i));
end
%water_img = water_img/2;
%final_value = zeros(8,8,size(blk1,3));
final_value = cover_img;
cnt1=0;
for i = 1:size(water_img,3)
final_value(1,1,i) = water_img(1,1,i);
cnt1=cnt1+1;
end
dct_inv = zeros(8,8,size(final_value,3));
cnt2=0;
for i=1:size(final_value,3)
dct_inv(:,:,i) = idct2(final_value(:,:,i));
cnt2=cnt2+1;
end
output = our_blkproc_rev(dct_inv);
imshow(uint8(output))
Sir, I tried this code
Answers (0)
See Also
Categories
Find more on Computer Vision with Simulink 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!An Error Occurred
Unable to complete the action because of changes made to the page. Reload the page to see its updated state.
Select a Web Site
Choose a web site to get translated content where available and see local events and offers. Based on your location, we recommend that you select: .
You can also select a web site from the following list
How to Get Best Site Performance
Select the China site (in Chinese or English) for best site performance. Other MathWorks country sites are not optimized for visits from your location.
Americas
- América Latina (Español)
- Canada (English)
- United States (English)
Europe
- Belgium (English)
- Denmark (English)
- Deutschland (Deutsch)
- España (Español)
- Finland (English)
- France (Français)
- Ireland (English)
- Italia (Italiano)
- Luxembourg (English)
- Netherlands (English)
- Norway (English)
- Österreich (Deutsch)
- Portugal (English)
- Sweden (English)
- Switzerland
- United Kingdom(English)
Asia Pacific
- Australia (English)
- India (English)
- New Zealand (English)
- 中国
- 日本Japanese (日本語)
- 한국Korean (한국어)