Tuesday, January 29, 2008

Can you zoom in on that license plate?

Can you zoom in on that license plate? Can you zoom in on his face? Why can't you make this image clearer. These are questions that many forensic video analysts deal with on a daily basis. To illustrate the answer to these questions, let's consider this image:


This Monitoring image comes from an Avigilon system's 16 megapixel camera.

With the above image in mind, let's consider the outstanding advice from the UK's Home Office Scientific Development Branch:

To judge the quality of images that will be necessary, you will need to take into account the purpose
for which CCTV is used and the level of quality that will be necessary to achieve the purpose. The
Home Office Scientific Development Branch (HOSDB) recommends identifying the needs of a CCTV system
by using four categories:
  1. Monitoring: to watch the flow of traffic or the movement of people where you do not need to pick out individual figures.
  2. Detecting: to detect the presence of a person in the image, without needing to see their face.
  3. Recognising: to recognise somebody you know, or determine that somebody is not known to you.
  4. Identifying: to record high quality facial images which can be used in court to prove someone’s identity beyond reasonable doubt.
Take a look at the picture above. Can you make out faces or license plates? No. So, if your purpose is to identify these items, that picture view just won't do. 

With Photoshop, we can zoom in. Let's see what happens.




This Detecting view comes from zooming in a 16 megapixel image.

We can now see the people and vehicles more clearly. We can gain a general awareness of types of vehicles. We are closer to identifying them, but we don't have anything yet that will help us to prove identity beyond a reasonable doubt. We can zoom in further to see if we can Recognise anyone.



This Recognising view comes from zooming in a 16 megapixel image.

 At this level of magnification, someone who knows this person or car should be able to say, "that's him" or "that's not the man/car you are looking for." At this point, we can begin to accurately describe the individual in the scene. Let's zoom in some more to see if we can positively identify this man and the car.


This Identifying view comes from zooming in a 16 megapixel image.

With a 16 megapixel image, we can even zoom in closer than this image. But notice what's happened along the way. We've sacrificed field of view for detail. No longer are we looking at the whole parking lot (monitoring). We can't see the other people who are walking around (detecting). In order to identify this individual, we've had to zoom in so far that we've excluded much of this scene from our view. A CCTV Installer might position a camera/lens combination at a choke point specifically to get facial recognition whilst installing other cameras around the area to monitor and detect movement of unauthorised persons.

But what about real life. The good folks at Avigilon have a small piece of a very large market. What if that same monitoring image was only 4CIF or 2CIF. Could we still zoom in and identify the individuals in the scene? You be the judge.

The image from Avigilon contains 15,824,256 pixels and can come in a lossless RAW format.
This image contains only 426,400 pixels and is compressed. 

With an almost 97% reduction in the amount of available pixels and the additional compression, the results speak for themselves.


The result of zooming in on a low pixel count image.

So, the answer to "can you zoom in on that license plate" is ... it depends on the quality of the image and the number of available pixels.

Enjoy.

10 comments:

Jake said...

Great example Jim and well explained.

Not understanding the importance of high resolution images is a common issue for our image zoom tool. In order to be able to zoom in, the original photo must be large and clear. For our purposes, that is normally around 1200 pixels wide, which is easily achievable with today's digital cameras. But it still relies on that camera being in the hands of someone that knows what they are doing!

John Beagle said...

Jim:

Excellent blog post on the importance of having a high resolution camera if you have a goal of campturing a license plate!

But overkill for most applications. Such as a bar camera sytem.

Jim Hoerricks said...

Thanks to Jake and John for the comments. John brings up a point that I'd like to address.

The purpose of CCTV

In John's case, and in the examples on his linked page, a store owner purchases a digital CCTV system from a company for the purpose of attempting to prevent employee theft. For this purpose, a system like John's will do just fine.

The bar's owner is aware of all of the people in his employ. He can play back the video to try to identify problems and confront dishonest employees on the spot. In this case, a bullet camera with a 3.7mm lens and 380TVL should suit his purposes.

I have seen hundreds of these types of installations. Here's how a typical 4 camera system looks:
1 camera mounted on the ceiling looking directly down at the cash register. Often times, this view is connected to a transaction logger. This logger displays the transactions on the screen and may occasionally obscure the view. 1 camera mounted over the doorway looking in the store room. 1 camera mounted on a far wall looking at a long view of the bar. 1 camera looking at the waitress station.

In this way, the owner can see if an employee is stealing money or booze fairly easily. As long as the owner understands that this is all that his CCTV system is good for, he'll be OK.

But what about when/if he gets robbed. Bars are generally dark. Bullet cams generally don't have any day/night functionality built in. Also, compression artifacts occur more frequently in shadow areas. So, circumstances have conspired against the owner. His system is not designed or installed for the purpose of helping the police solve crimes that were committed against him/his patrons - only for stopping employee thefts.

This scenario plays itself out countless times per day in our city. Well meaning store owners buy systems from well meaning manufacturers. They buy them because they are trying to stop shrinkage, or because they want to sell Lotto or Alcohol and are required to put something ... anything ... into their business. They are cost conscious and digital offers a tremendous savings.

When crimes occur, there is very little these systems can do to aid in the investigation - as the Brits have discovered.

I always recommend that cameras be installed to cover all entry and exit points - with an eye towards facial identification. This can be done with a bullet cam, but it must be correctly positioned. Think in terms of pixels/ft. when siting a camera. ID schemes need about 100px/ft. to be effective. For a common bullet cam, this means that 1/4-1/3 of the view must be filled with a face.

Compression is nice for downloading music from the internet. Compression in images and video means a loss of detail. Details, once lost to compression, can not be regained. Try to manage with as little compression as possible - especially in the identification shots.

Use motion detection sparingly. A criminal walks in and stands - shouting directions. As he has stopped moving, that view no longer records. Some systems have pre/post event recording which can help. LE needs as many frames of video as possible.

Understand the differences between progressive and interlaced video. Interlaced digital video just won't work right in areas where motion will occur. It will lead to tearing and often confuses juries - who wonder why that head appears here, then there. Interlacing also makes it hard to pull faces accurately from video. Progressive systems offer the advantage of capturing the entire scene at once and as such are better suited to our purposes.

Most of all, research your provider thoroughly. Many companies come and go in this business. Find out who else is using their recorders and how long they've been running without problems. Insist that they train you to use your equipment. If you don't know how to retrieve your own video - chances are no one else does either. This can add hours on to the initial call to LE, as specialists like myself are dispatched around the city to download video from private systems.

And ... not to leave Jake out of the discussion ... that's a nice piece of JAVA script. Well done.

All that being said, thanks for the comments. Keep them coming.

Jake said...

Jim, I was wondering whether good quality CCTV systems these days will write to a hard drive instead of a tape?

Storage prices get cheaper and cheaper. With the right balance of frame rate (10 frames per second?) and resolution (1000+ pixels width?) and good quality compression codec (DivX?) you should be able to get 24 hours of video into about 50GB or less, right?

Combine this with wifi and you could stream the video back to a remote storage device, helping keep the camera as small as possible.

Jim Hoerricks said...

You present a number of good questions.

"I was wondering whether good quality CCTV systems these days will write to a hard drive instead of a tape?"

The answer is ... it depends. If you compare discrete vs. non-discrete systems, it all comes down to the final product - the still image as its used in court.

With tape, I can dive into the depth of the signal and reveal details lost in shadow. I can frame average to clear up noise and sharpen details. Thus, I can do a number of things that I simply can't do with digital. With digital, it's either a 1 or a 0. This changes when systems are attached to multi-megapixel cameras and a capable of operating in an uncompressed fashion, such as the example system from Avigilon. Then, digital far exceeds a tape based system.

"Storage prices get cheaper and cheaper. With the right balance of frame rate (10 frames per second?) and resolution (1000+ pixels width?) and good quality compression codec (DivX?) you should be able to get 24 hours of video into about 50GB or less, right?"

For my purposes, good quality starts with the lens and works backwards. A good quality lens, properly suited to the task for which it was installed, can make or break your system.

Looking at frame rates, the answer is always "the more the better." Beyond that, the answer becomes stability. Too many systems advertise a specific frame rate capability, but fail to produce that rate in the real world. If the system's max frame rate is 60fps, then manufacturers should publish this result vs. the speed of the bus/hard drive combination used to produce this result. For example, if that result was achieved by the manufacturer using a 10k rpm drive, is it also possible to achieve that rate with a 7600 rpm drive? What about 5400 rpm? Added to this is alarm prioritization. In the case of multiple alarm triggers, which views take priority if they are triggered to increase frame rate upon alarm? I have yet to see a system that handles this scenario well.

"Combine this with wifi and you could stream the video back to a remote storage device, helping keep the camera as small as possible."

This sounds good on paper, but does not work well in practice. Wireless systems that record first at the head end, then transmit tend to perform better than systems that simply transmit to a recorder (like Axis). This has a lot to do with the error checking inhearant in the 802.11x standard. The best frame rate I've ever seen with 802.11x was 5fps - with a ton of dropped frames due to errors in transmission. This was achieved on the bench. The best I've seen in the real world was less than 1fps. That's why, in my wireless installations, I use microwave to transmit (a combination of 900Mhz locally and 4.8GHz backhaul).

Good questions - keep them coming.

Andy Wendt said...

Great blog post and lots of good points that should get customers to think about their security needs. But speaking of looking good on paper: I see from the aviGilon spec sheet for the 16 Megapixel camera, the one you are using for your above examples, that at full resolution it will capture 3 images per second. If you are familiar with how the world works this should not be a surprise. At that resolution it’s actually an impressive feat. However 3 images per second may fall far short of the frame rate required for many situations. So once again, it is important for customers to have the proper expectations, even when buying the “stat of the art” in video surveillance.

Jim Hoerricks said...

Thanks Andy for the comment. You are absolutely right about making sure that camera installations are fit to purpose (managing expectations) - which was my primary point.

I've seen some good installations in the $2k price range and some bad installations in the $3 million price range.

Keep the comments coming.

Darren Smart said...

Jim,

I have a quick question. I was wondering if you knew of anyway that an image that with lower resolution (becomes fuzzier when you zoom in) can be made at least a little bit clearer when zooming? A trick of the trade or something. I have read about software "guessing" pixels, but I have no idea how this works. Maybe there's something that you could offer that might make it better (obviously not perfect, haha).

Great post!

Anonymous said...

Hello Sir,
I have read what was given above. It is true and I liked your article. But I need to know whether is there any possible way to make a low resolution Picture more clear? . Please anybody who knows it Please help.
ThanK you.

Jim Hoerricks said...

Feel free to send it to me: jimhoerricks @ gmail DOT com.