Watermarking

Anything you want added or changed in future versions of ZoneMinder? Post here and there's a chance it will get in! Search to make sure it hasn't already been requested.
User avatar
zoneminder
Site Admin
Posts: 5215
Joined: Wed Jul 09, 2003 2:07 pm
Location: Bristol, UK
Contact:

Post by zoneminder »

All the jpegs are created by the 3rd party libjpeg library, which is somewhat advanced in years but pretty much the standard. There is also the jpeg2000 and jpeg mmx libraries which people have reported varying degrees of success with. I've also heard of much faster commercial libraries but they obviously cost money, which handicaps me a bit. I assume the watermark would be added to the jpeg data before being written to file?

Phil
SifuDean
Posts: 26
Joined: Thu Apr 21, 2005 1:24 am
Location: Melbourne - Australia

Post by SifuDean »

Hi,

Yes you are correct - the watermark would be applied before the file is written.

I will get one of our developers to look into it and see what we can do.

One question I would ask you is your thoughts on the generation of a ID number for each system to link the watermarked files to each ZM system?

Is there a unique ID generated already somewhere in the code? What do you think?

Regards,

Deano
User avatar
zoneminder
Site Admin
Posts: 5215
Joined: Wed Jul 09, 2003 2:07 pm
Location: Bristol, UK
Contact:

Post by zoneminder »

An Id could be generated from a hash created from hostname, mac address etc if necessary without too much difficulty. It depends whether you want it to be at all cryptic or not. Otherwise you could just use ZM_WEB_TITLE_PREFIX for instance.

Phil
Baylink
Posts: 338
Joined: Sun Jun 19, 2005 3:19 am

Post by Baylink »

Seems to me you have to decide *what you're trying to do*.

If all you want to do is mark individual frames, you could GPG encrypt a batch of random numbers plus the timestamp data for the frame, and use stagno tools to embed that in the picture itself.

If you want to prove that a sequence is unaltered and nothing is missing, you have a different problem.

But remember: pictures are hearsay, anyway; what's *admissible* in court is usually "Yes, I took that picture, and that's what the scene looked like."

I suspect the exception on which security footage is admissible is the "contemporaneously maintained business records" one, though IANAL, and what the requirements are for that, I don't know.

The person to ask would be a prosecuting attorney, I suspect.
User avatar
cordel
Posts: 5210
Joined: Fri Mar 05, 2004 4:47 pm
Location: /USA/Washington/Seattle

Post by cordel »

From an investigators standpoint this all seems really great but how is one supposed to verify that all the images are in fact intact? Yet something else that everyone would have to be aware of in order to inspect it and verify that in fact the images haven't been tampered with. It would make more since to use a standard already in practice so that we can use the tools we already have that are tried and true. A watermark is basically a bumpmap where an image is overlaid on top of another image to create something we can visually inspect. The other type of coarse digital watermarking is a technique for adding hidden copyright or other verification messages in digital audio, video or image signals. That hidden message can be a group of bits or a name/place etc information pertaining to the signal or the creator of the signal. The first method being the usual that we normally see for DVR's is the most typical.

Here is a link to Peter Meerwald's page where you can find C source for digital watermarking:
http://www.cosy.sbg.ac.at/~pmeerw/
Find the watermarking link there.
If there is a way to deploy this with ZM and maybe use Phils idea to use various bits of the environment would be superb.

The other type bump mapping you can find with any google search.

IMHO I think it best if watermarking is to be deployed it needs to follow the standards to be regarded as viable evidence.

Also someone might be interested in this:
http://watermarker.com/books/Jpeg2000-.aspx
Regards,
Cordel
tuna
Posts: 1
Joined: Thu Jun 23, 2005 3:19 pm
Location: Brazil
Contact:

Post by tuna »

Hello, first post :)
I read about watermarking image, and I think I can help if you want to do something like alphablend a logo or another image over the original RGB frame.
I have such function programmed in my project, called videodog.
Other than that, stuff like put a digital signature inside a jpeg file can be done, IIRC, by some padding fields in the file structure...
Best regards
--
Isn't a lie, if you believe it (George Constanza)
User avatar
Blazer
Posts: 234
Joined: Sun Jun 05, 2005 12:57 pm

Post by Blazer »

Any ideas how much more CPU-intensive watermarking every frame would be? I'm not sure I want to know :)
User avatar
cordel
Posts: 5210
Joined: Fri Mar 05, 2004 4:47 pm
Location: /USA/Washington/Seattle

Post by cordel »

As long as there is no apps on the same machine to edit images, I think you could get away with only watermarking them on export. Since your can water mark the image at any time I would strongly suggest that if you were in an area that would require water marking you would also have to prove that there is no way the image was tampered with while it was on the server so it would be a really good idea not to have any image editor loaded.
jameswilson
Posts: 5111
Joined: Wed Jun 08, 2005 8:07 pm
Location: Midlands UK

Post by jameswilson »

just thought id raise this one again for a couple of reasons.

I have been doing a bit of research into jpgs and i beleive you can store certain infomation inside of them (exif?). If this is the case could we insert things like
Alarm frame boolean
a string for watermarking, with a checksum (basic would do if someone commited to 'faking it' im sure any system has weaknesses

someother useful info

This could then be checked

Id like the alarm thing for my own uses and i assume this would tax the server too much as its doing this sort of work anyhow?
James Wilson

Disclaimer: The above is pure theory and may work on a good day with the wind behind it. etc etc.
http://www.securitywarehouse.co.uk
User avatar
Blazer
Posts: 234
Joined: Sun Jun 05, 2005 12:57 pm

Post by Blazer »

Hmmm I didn't think of using the EXIF headers, that's a good idea. Some useful info to embed could be:
* alarm time/date
* a customizable string of text
* hostid of the server (output of "hostid" command - useful to prove the capture came from the zoneminder pc)
* Event ID (that the frame is from)

Inserting this data into every frame would probably be too intensive, if not a waste of space. Perhaps it could be inserted into just the first frame, or first and last frame.
jameswilson
Posts: 5111
Joined: Wed Jun 08, 2005 8:07 pm
Location: Midlands UK

Post by jameswilson »

oh i see if its too intesive not prabably a good idea then. Problem with only doing the first and last frame is chances are the fram you would use in evidence wouldnt be the first or last one, especially (like i do) you mainly use mocord.
James Wilson

Disclaimer: The above is pure theory and may work on a good day with the wind behind it. etc etc.
http://www.securitywarehouse.co.uk
User avatar
cordel
Posts: 5210
Joined: Fri Mar 05, 2004 4:47 pm
Location: /USA/Washington/Seattle

Post by cordel »

Keep in mind that since things have been ajusted for ffmpeg cvs...
ffmpeg cvs can bumpmap watermark images. This would be great for use in exporting to a CD.

Regards,
Cordel
jameswilson
Posts: 5111
Joined: Wed Jun 08, 2005 8:07 pm
Location: Midlands UK

Post by jameswilson »

great but technically mpeg's arnt admissable in the uk as evidence as there condistional refresh based

sorry
James Wilson

Disclaimer: The above is pure theory and may work on a good day with the wind behind it. etc etc.
http://www.securitywarehouse.co.uk
svaliv49
Posts: 3
Joined: Sun Nov 27, 2005 5:37 pm
Location: Slovenija

Post by svaliv49 »

Maybe that link will help: http://www.iqeye.com/IQauthenticate.html

IQinvision did it in the camera. You just send the pictures to them and they will determine if the image is original or was edited.

Ivan
Ruler
Posts: 232
Joined: Mon Nov 08, 2004 9:02 pm
Location: Bay City, MI

Post by Ruler »

While reading through this, something occurred to me. It would be highly CPU intensive and I don't know if it'd be practical or not, but why not calculate the md5sum of each image as it's captured and store that in the DB somewhere? (If it wouldn't alter the contents of the file and therefore it's MD5, it could be stored in the file information header itself; I'm thinking one of the text fields that you can set when saving a jpeg in GIMP.)

Like I said, calculating the MD5 of each and every frame captured would be highly CPU intensive, but it'd be another method of proving the image wasn't altered.
This message is made up of not less than 90% recycled electrons.
Post Reply