ALPR: anyone have a 100mm lens they like?

Discussion in 'Alarm & Security Systems' started by cam235, Nov 9, 2016.

Share This Page

  1. cam235

    cam235 Getting the hang of it

    Joined:
    Oct 5, 2016
    Messages:
    150
    Likes Received:
    35
    Due to the number of burglaries in my neighborhood lately, I want to keep a record of cars passing by. Because of a bend in the road, I have a view directly along it from one corner of my house, but depending on how tall the nearby parked cars are, plus other obstructions limiting my camera elevation, plates may be visible only when they are 250 to 300 feet away. I have an "IR Cannon" illuminator that is actually good enough for that distance (for reflective plates; nothing else) and I've got a Dahua 4MP HF5421E that I like (especially the remote manual focus feature). The trick is the lens.

    I have tried two CS-mount varifocal lenses: a pricey Theia 9-40mm and a cheap noname 6-60mm. Both lenses show legible plates by eye (day & night) with the 40mm giving better detail and brighter image despite the shorter length. Even with careful focusing, neither one is optimal for reliable ALPR operation at that distance.
    Theia Technologies CS-Mount 9 to 40mm Telephoto Day/Night SL940A
    Vari-focal Lens CS Auto Iris 6-60mm for CCTV Security Surveillance Camera | eBay

    So... I have a few lenses that don't quite work. Can anyone suggest one that will? I see 100mm lenses such as the one below, but I worry it will be dark and blurry like my 6-60.
    8 - 100 mm CCTV Camera CS mount Lens, auto iris, varifocal, mega pixel! MO08100G | eBay
     
    Last edited: Nov 9, 2016
  2. cam235

    cam235 Getting the hang of it

    Joined:
    Oct 5, 2016
    Messages:
    150
    Likes Received:
    35
    It is curious... I have now tried to order three different kinds of CS-mount 100mm lens from three separate suppliers (ebay, Amazon, and B&H Photo in New York). In each case, after several days, the vendor replied that the supposedly in-stock lens is either simply not available, or backordered with no ETA. As if the product doesn't really exist. Looks like the way to get that kind of reach is with a PTZ camera with 20x lens.
     
    Last edited: Nov 24, 2016
  3. Kawboy12R

    Kawboy12R Getting comfortable

    Joined:
    Nov 18, 2014
    Messages:
    1,212
    Likes Received:
    249
    I've seen adapters for CS mount to DSLR-type lenses before. A box camera with a Canon 75-300mm lens on it is seriously badass. I don't remember where the adapter came from though.
     
  4. cam235

    cam235 Getting the hang of it

    Joined:
    Oct 5, 2016
    Messages:
    150
    Likes Received:
    35
    Thanks- yes, I do have a Canon EF - CS lens mount adaptor from ebay. I tested a Sigma 70mm macro and it works, I was just hoping to avoid using a big heavy expensive DSLR lens, and I also wanted a lens with auto-iris the IP cam could control. But maybe the DSLR lens is my only real option at this point.

    EDIT: Would love to find a decent 100mm lens for DSLR "cheap", but haven't seen them under $400 new. I see an old used Canon FD 100mm macro for $65, maybe that's an option.
     
    Last edited: Nov 27, 2016
  5. Kawboy12R

    Kawboy12R Getting comfortable

    Joined:
    Nov 18, 2014
    Messages:
    1,212
    Likes Received:
    249
    Seems to me that the old film Canon stuff doesn't work with newer EOS Rebel stuff so would be available cheap used. But yeah, apart from size the auto iris problem might present the most complications.
     
  6. cam235

    cam235 Getting the hang of it

    Joined:
    Oct 5, 2016
    Messages:
    150
    Likes Received:
    35
    In case anyone else needs a long lens: I finally got one, and can confirm this particular model works pretty well on the 4 MP Dahua box camera for reading plates at 250-300 feet.
    SPECO TECHNOLOGIES VF5100DC 5-100mm Auto Iris Lens CS Mount
    Amazon.com : SPECO TECHNOLOGIES VF5100DC 5-100mm Auto Iris Lens CS Mount : Surveillance Camera Lenses : Camera & Photo

    That lens is good enough for OpenALPR to get a correct read from 250 feet with 94% confidence level (assuming the plate frame doesn't touch the numbers, as many CA plates tend to)
     
  7. nayr

    nayr Known around here

    Joined:
    Jul 16, 2014
    Messages:
    7,003
    Likes Received:
    2,580
    Location:
    Denver, CO
    sweet, thats what I was hoping.. post up some samples pls.. thats really good for such a distance.
     
  8. cam235

    cam235 Getting the hang of it

    Joined:
    Oct 5, 2016
    Messages:
    150
    Likes Received:
    35
    Sure, I will post some. I want to actually set up a plate at a known distance. With such a long lens looking along the road, as a random car drives it is hard to tell exactly how far away it is. One thing I can say is you definitely need to refocus morning & evening, because the 850nm IR and visible focus points are different (I was spoiled before with my IR-compensated Theia 40mm).

    Hmm... even with refocus, this lens may actually work better at night, than during the day, due to chromatic aberration. When all of your light is only one wavelength (eg. 850nm) focus looks better. Just morning now; likely will do better during daytime when the lens is more stopped down.
     
    Last edited: Dec 2, 2016
  9. cam235

    cam235 Getting the hang of it

    Joined:
    Oct 5, 2016
    Messages:
    150
    Likes Received:
    35
    So far I am happier with this lens at night, than during the day, but I'll see if I can focus it better this weekend. Here are a few shots using the 5-100mm Speco zoom lens at the long end, on the Dahua 4MP box camera. The night shot is a 1:1 crop where I am holding the plate at a distance of 310 feet from the camera (IR illuminator also right next to the camera). There are three small reflective tape squares below the plate, spaced 6" apart on centers. The two daytime photos of the school bus are at (very approximately) 200 and 300 feet away.

    TestPlate-310ft.jpg TestPlate-close.jpg BUS200.jpg BUS300.jpg
     
  10. bp2008

    bp2008 Staff Member

    Joined:
    Mar 10, 2014
    Messages:
    4,060
    Likes Received:
    1,328
    Nice results. Does that lens auto-focus? I'm guessing not since you said you need to refocus it twice a day.

    I think a good PTZ would be easier to work with (20-30x zoom + autofocus + long range powerful IR built in). Better if they would build one without the pan and tilt parts to make it cheaper and more compact, though. If I recall, most 20x PTZs are close to or beyond 100mm focal length at the far end of their zoom.
     
  11. cam235

    cam235 Getting the hang of it

    Joined:
    Oct 5, 2016
    Messages:
    150
    Likes Received:
    35
    Absolutely a good PTZ would be easier. First thing I tried was a Sunba mini-PTZ with lens to 94mm and the hardware was OK but firmware very poor. No manual exposure! night images totally overexposed. Also cannot view horizon, about five or ten degrees short. Awkward to mount the thing tilted to compensate. Don't want to pay for a good quality 25x PTZ. Also they are a bit large & obtrusive.

    My Speco lens does not autofocus, but the Dahua box cam can move its sensor to focus with remote command. For example with my setup, this command:
    http://myuser:mypass@192.168.1.46/cgi-bin/devVideoInput.cgi?action=adjustFocus&focus=0.07&zoom=0
    is about the right focus setting for daytime. If I use "&zoom=1" then it does an autofocus adjustment but that locks onto the nearby tree branch at the edge of frame, so that's no good.
     
    Last edited: Dec 3, 2016
  12. bp2008

    bp2008 Staff Member

    Joined:
    Mar 10, 2014
    Messages:
    4,060
    Likes Received:
    1,328
    Ah, yes, now that you mention it my Dahua PTZs have a heck of a time autofocusing on the thing I want when there is something closer like that tree branch. And at night I am lucky if they focus on anything at all if it isn't very brightly lit when the focusing is happening. I guess you'd still need to automate manual focus changes even with a PTZ.
     
  13. nayr

    nayr Known around here

    Joined:
    Jul 16, 2014
    Messages:
    7,003
    Likes Received:
    2,580
    Location:
    Denver, CO
    yeah unless he mounts a license plate out there on a permanent fixture auto-focus wont work at night with exposure so high it cant see anything..

    though presets usually include a focus setting so they can auto-focus faster; so if you turn off autofocus you could use presets instead of API commands w/a PTZ

    What shutter speed you looking at? That tree is a bitch; chainsaw? lol heh
     
  14. cam235

    cam235 Getting the hang of it

    Joined:
    Oct 5, 2016
    Messages:
    150
    Likes Received:
    35
    Right now I use a shutter speed of 1/500 during the day and 1/120 at night. The one good thing about the view under the trees is it's almost exactly along the road. Also that's a T junction just before the house at the end, so there's a limit to how fast cars will go. Result is hardly any motion blur with 1/120 so it's good enough in this case.
     
    Last edited: Dec 3, 2016
  15. nayr

    nayr Known around here

    Joined:
    Jul 16, 2014
    Messages:
    7,003
    Likes Received:
    2,580
    Location:
    Denver, CO
    turn on WDR, start off low and work your way up.. with them shadows your gonna need it and it'll probably let you crank it up to 1/1000 in day.

    im running over 2x that but im half the distance; you may need even more IR at night to run higher; mebe dual cannons.. reducing noise/gain is the best way to increase reading accuracy.
     
    cam235 likes this.
  16. cam235

    cam235 Getting the hang of it

    Joined:
    Oct 5, 2016
    Messages:
    150
    Likes Received:
    35
    Thanks for the tip @nayr about WDR. I enabled that and a setting of 25 makes the picture low-contrast, but ALPR seems to like it just fine. Here's a car somewhere around 200 or 250 ft. Since then I've backed off the WDR settings to 18.

    CAM3_141709_WDR25.jpg
     
  17. cam235

    cam235 Getting the hang of it

    Joined:
    Oct 5, 2016
    Messages:
    150
    Likes Received:
    35
    UPDATE! I just tried a Canon EF 100mm f/2 lens I happened to have on the shelf, obviously big & heavy but holy cow it's so much better, there is no comparison. No need to stop it down; even wide open the image is crisp. From 250 feet I can read a dealership phone number printed along the edge of a license plate frame.

    The main drawback is, um... the price: Amazon.com : Canon EF 100mm f/2 USM Lens : Camera Lenses : Camera & Photo

    Back in the day I remember people claiming the other Canon full-frame DSLR choice in this focal length (Canon EF 100mm f/2.8 Macro) is sharper than this one, so maybe you can find a deal on this lens used. Seems like a waste to be using a full-frame DSLR lens on a 1/3" sensor camera, but I wasn't using it otherwise.
     
    Last edited: Dec 3, 2016
    nayr likes this.
  18. tangent

    tangent Pulling my weight

    Joined:
    May 12, 2016
    Messages:
    625
    Likes Received:
    141
    So you just happened to have some sort of EF to CS mount adapter? Or are you just looking through a DSLR?

    Good optics make a big difference. The canon lens obviously contains a bunch of auto focus hardware that wouldn't do any good mounted to a box camera part of the reason for the price.
     
  19. cam235

    cam235 Getting the hang of it

    Joined:
    Oct 5, 2016
    Messages:
    150
    Likes Received:
    35
    Yes, I also had a Canon EF to CS mount adaptor handy. they are around $15 on ebay.
    Canon EOS EF EFs lens to C Mount Film Movie Bolex Video Camera CCTV Adapter Ring | eBay

    It's a pretty righteous lens for the little box camera, but the mount has held up to the weight, so far.

    Dahua-Canon100mm.jpg

    If I didn't have the Canon handy, I might have tried something like Amazon.com : Nikon 100mm f/2.8 series E AIS manual focus lens : Camera & Photo together with Camera Adapter For Nikon F Mount Lens To 16mm C Mount Film Movie Adapter | eBay
     
    Last edited: Dec 4, 2016
  20. cam235

    cam235 Getting the hang of it

    Joined:
    Oct 5, 2016
    Messages:
    150
    Likes Received:
    35
    I put the previously shown test plate in the trunk of my car, left the lid up and drove down the street. This image is a 1:1 crop with Dahua 4MP and the Canon EF 100/2 lens, at a distance between 250 and 300 feet.
    CanonEF-Night-TestPlate.jpg

    You can see by the fuzziness of the taillights how far apart the 850nm and visible-light focus settings with this lens are (of course, the Canon EF lenses were never intended for IR). In my case, using the HTTP API "action=adjustFocus" I need to set focus=0.19 for daytime and focus=0.37 at night.

    BTW, the Speco CS-mount 5-100mm lens was usable at night, it's just during the day that it had veiling glare, low contrast and blur issues. The Canon EF image is really clear and detailed during the day. For example, this delivery truck is between 200 and 250 feet away.
    15-06-09.jpg
     
    Last edited: Dec 6, 2016
    looney2ns and nayr like this.
  21. cam235

    cam235 Getting the hang of it

    Joined:
    Oct 5, 2016
    Messages:
    150
    Likes Received:
    35
    As a side note, either my settings are wrong, or the designers of the camera haven't used it much with a lens this long. During the day, when a car occupies nearly the entire frame, it is not detected as an object, so the "line crossing" feature is not triggered with larger vehicles. It works at night because you see only the lights and the plate which are much smaller light areas in an otherwise dark image.
     
    Last edited: Dec 6, 2016
  22. nayr

    nayr Known around here

    Joined:
    Jul 16, 2014
    Messages:
    7,003
    Likes Received:
    2,580
    Location:
    Denver, CO
    object detection requires the object to be smaller than the frame and for it to have room on either side to detect it.. it wont work when tightly zoomed as it does not have adequate time to detect the object before it crosses the line.

    amazing difference; now you got me thinking about upgrading my 60mm
     
  23. Kawboy12R

    Kawboy12R Getting comfortable

    Joined:
    Nov 18, 2014
    Messages:
    1,212
    Likes Received:
    249
    Awesome lens upgrade. No issues with having no auto iris?
     
  24. cam235

    cam235 Getting the hang of it

    Joined:
    Oct 5, 2016
    Messages:
    150
    Likes Received:
    35
    The lens works fine without auto-iris. I guess most security cams except for box-cams have fixed iris. The camera compensates the exposure by using a shorter exposure time during the day. It is true, wIth most lenses you only get the best resolution somewhat stopped down, but as you can see, this lens does pretty well wide open.
     
  25. j4co

    j4co Getting the hang of it

    Joined:
    Jan 17, 2016
    Messages:
    319
    Likes Received:
    58
    Location:
    Netherlands
    Question. That focus difference for day and night is that done with the function Dahua describes as ABF ?
    edit: I guess yes as I found this post by nayr: Dedicated License Plate Cam project

    And the need for the focus to be different for day and night is that retro reflective of the license plate than I assume..

    Looked it up and it is returning the light back in the direction it came from. So that is than directly the reason the ir cannon must be very close to the lens, as the light is returned there.
     
    Last edited: Dec 18, 2016
  26. cam235

    cam235 Getting the hang of it

    Joined:
    Oct 5, 2016
    Messages:
    150
    Likes Received:
    35
    FYI, in case anyone else wants to do something similar. I wanted to try a lens with manual adjustable iris, so I got a used Nikon f/2.8 100mm Series E lens, plus Nikon F mount to C adaptor. This works pretty much as well as the Canon lens, at lower cost. I ended up leaving it open (at f/2.8) because I get wicked diffraction spikes on headlights at night from the iris blades. If you only wanted it during the day, you could stop it down for better depth of field.
     
    nayr likes this.
  27. steve457

    steve457 Young grasshopper

    Joined:
    Jan 7, 2016
    Messages:
    66
    Likes Received:
    6
    I am about to tackle this project again now that there have been reports on Nextdoor of kids throwing eggs at houses/cars in the neighborhood. I previously attempted this project using a Hikvision bullet, but had problems getting a clean JPEG file from the H264 stream (the camera did not support MJPEG at high resolutions). This time I'm likely to go with the camera that Nayr used, but am open to other Dahua options based on my setup.

    I am planning on mounting the camera towards the street as indicated on the map. I am hoping that with this setup I would be able to catch cars coming down the court as well as those that turn left from the side street. I am thinking I would not need that much zoom given the cameras proximity to the street. Would I be able to get by with a simple bullet camera with a 6mm lens from this distance? I am sure a box camera with a 10-60mm lens would work, but wondering if that would be overkill.
     

    Attached Files:

  28. nayr

    nayr Known around here

    Joined:
    Jul 16, 2014
    Messages:
    7,003
    Likes Received:
    2,580
    Location:
    Denver, CO
  29. steve457

    steve457 Young grasshopper

    Joined:
    Jan 7, 2016
    Messages:
    66
    Likes Received:
    6
    Thanks, Nayr! According to the tool I will need at least a 14mm lens at a distance of 44'. Looks like the box camera will be the best option. Would you recommend the same IR illuminator that you used, or could I get by with a less powerful one?
     
  30. wantafastz28

    wantafastz28 Getting the hang of it

    Joined:
    Nov 18, 2016
    Messages:
    148
    Likes Received:
    55
    Location:
    Phoenix, az
    This makes me frustrated with AZs lack of required plates in front and back of the vehicles... I need 2 setups for my road since they are rear only required. :(
     
    Last edited: Jan 4, 2017