A possible fix for nighttime IPC-HFW5231E-Z12 autofocus issues

Joined
Nov 25, 2016
Messages
839
Reaction score
2,280
Several people have wrestled with the issue of the IPC-HFW5231E-Z12 camera going out of focus when configured for nighttime LPR operation. Although my cameras have been well behaved overall, I did have an incident two nights ago when something large and nocturnal flew in front of one of cameras, causing it to lose focus for the rest of the night.

So I tried an experiment, and gave the camera something to focus on. I went to the local hardware store and bought a package of white stick-on reflective safety tape, cut out a couple of one inch squares, and stuck them onto the bottom edge of the curb across the street, about 6 feet apart.

You can see the results for yourself. In the video, I deliberately move the camera out of focus, and you can see a very blurred automobile drive by a few seconds later. Then I hit the autofocus just before 9:06 PM, after which the camera returns to the correct focus within a matter of seconds. Afterwards, you see an Uber driver's car (in focus) go by.

So if you're wrestling with an IPC-HFW5231E-Z12 camera that won't behave at night, try placing one or more small reflectors of some type as close as possible to the area of the road where your cameras are aimed. If you make them small and innocuous, chances are that other people won't even notice them, or if they do, will simply ignore them.


reflectors.jpg
 

bigredfish

Known around here
Joined
Sep 5, 2016
Messages
17,016
Reaction score
47,475
Location
Floriduh
Interesting theory @wtimothyholman I'll give it a try this weekend..

Do you set your Z12 to do color during the day and let it switch to B&W at night? I can manually focus it once it goes to B&W and it will indeed stay put and focus is good all night. But once it trips to color the next day, and back to B&W the next night, I'm back to an out of focus camera..
 
Joined
Nov 25, 2016
Messages
839
Reaction score
2,280
Interesting theory @wtimothyholman I'll give it a try this weekend..

Do you set your Z12 to do color during the day and let it switch to B&W at night? I can manually focus it once it goes to B&W and it will indeed stay put and focus is good all night. But once it trips to color the next day, and back to B&W the next night, I'm back to an out of focus camera..
I do set my camera profiles to color for day, and B&W for night, and I use the sunrise / sunset Windows utility to switch between them (and to set the zoom and focus parameters). Except for the one night where one of my cameras went out of focus for several hours, everything has been solid, but I want to prevent that from happening again.

The question to me is this: are the out-of-focus issues that people are having simply the result of autofocus being unable to work against a very dark field of view, or is there some other bug involved, such that the focus is drifting in ways that autofocus cannot compensate for? So I can't be positive that the reflector trick will fix the problem, but it at least eliminates one variable, and it costs very little to try.
 
Joined
Nov 25, 2016
Messages
839
Reaction score
2,280
Some follow-up on my original post: I added three more one-inch squares (possible overkill, but I wanted a good "target" for autofocus), then set night mode shutter time to 1/2000 second with gain set to 0 to 50, and iris set to 30. In addition, I set the camera to switch over from day to night 15 minutes before sunset, when there's still enough ambient light to assist in autofocusing, but it's dim enough for the reflector targets to shine brightly from the camera's IR diodes.

So far, focus has remained steady. I'm getting excellent license images at night. Let's see how it works over the next couple of weeks.

Exported Image.jpg
 

bigredfish

Known around here
Joined
Sep 5, 2016
Messages
17,016
Reaction score
47,475
Location
Floriduh
Thanks for the update @wtimothyholman

Unfortunately didnt get a chance to try it this weekend, but hope to in the coming days. Appreciate your testing
 

achalmersman

Pulling my weight
Joined
Jan 26, 2017
Messages
267
Reaction score
116
Location
Delaware USA
I'm gonna try this. My camera is only in focus at night since I haven't figured out a way to write a script that changes and continually checks and adjusts focus 24/7 but allows different focus based on day vs night.

Mine would even loose focus during the day though. That's what really surprised me. A camera that looses focus in broad daylight at longer focal lengths. Totally unacceptable and unbelievably disappointing considering the potential and outstanding performance of the starlight sensor

Sent from my SM-G965U using Tapatalk
 
Joined
Nov 25, 2016
Messages
839
Reaction score
2,280
I'm gonna try this. My camera is only in focus at night since I haven't figured out a way to write a script that changes and continually checks and adjusts focus 24/7 but allows different focus based on day vs night.

Mine would even loose focus during the day though. That's what really surprised me. A camera that looses focus in broad daylight at longer focal lengths. Totally unacceptable and unbelievably disappointing considering the potential and outstanding performance of the starlight sensor
If your camera is losing focus during the day, you might want to consider the possibility of a defective autofocus. You may need to replace the camera.
 

achalmersman

Pulling my weight
Joined
Jan 26, 2017
Messages
267
Reaction score
116
Location
Delaware USA
If your camera is losing focus during the day, you might want to consider the possibility of a defective autofocus. You may need to replace the camera.
It only seems to do it at near the end of the zoom range. I'm not the only one that has experienced this

Sent from my SM-G965U using Tapatalk
 
Joined
Nov 25, 2016
Messages
839
Reaction score
2,280
It only seems to do it at near the end of the zoom range. I'm not the only one that has experienced this
I haven't had any autofocus issues during the day, but I did notice during my testing that moving the Iris setting above 30 made it harder for the camera to find the correct focus. If you're using manual exposure settings, check that.
 

NoloC

Getting comfortable
Joined
Nov 24, 2014
Messages
701
Reaction score
454
This may be a dumb question but why would you use a starlight cam like the 5231 for lpr?

Since the camera must be made less sensitive to light in order to see the reflective plate by stopping it down with shutter speed. Seems counter intuitive to use a sensitive cam.
Wouldn't a cheaper cam with higher res (or not) be better?
 

achalmersman

Pulling my weight
Joined
Jan 26, 2017
Messages
267
Reaction score
116
Location
Delaware USA
This may be a dumb question but why would you use a starlight cam like the 5231 for lpr?

Since the camera must be made less sensitive to light in order to see the reflective plate by stopping it down with shutter speed. Seems counter intuitive to use a sensitive cam.
Wouldn't a cheaper cam with higher res (or not) be better?
Idk I have thought about this. There's a whole other aspect of LPRs that I am thinking about experimenting with where the starlight will shine. My states license plates are extremely difficult to get consistent exposures on so I am thinking about adding ambient flood light and dissabling IR. This is low speed (less than 10 mph) captures.

Sent from my SM-G965U using Tapatalk
 
Joined
Nov 25, 2016
Messages
839
Reaction score
2,280
This may be a dumb question but why would you use a starlight cam like the 5231 for lpr?

Since the camera must be made less sensitive to light in order to see the reflective plate by stopping it down with shutter speed. Seems counter intuitive to use a sensitive cam.
Wouldn't a cheaper cam with higher res (or not) be better?
You need a very short shutter time in order to capture the license plate without it blurring. But a very short shutter time also means that the camera captures much less light. Try it, and you'll see how the image gets dimmer and dimmer as you reduce the shutter time. So a sensitive camera is essential to getting a good image at very short shutter times.

But more than that, you need some zoom capability. Based on my own experience, I would say that 12X is the absolute minimum, unless you can mount the cameras very close to the road. A 25X or 30X PTZ camera may be necessary in extreme cases. And cameras with that much zoom are going to have good sensors by default.
 

NoloC

Getting comfortable
Joined
Nov 24, 2014
Messages
701
Reaction score
454
So, it WAS a dumb question...

Yes I get the optical zoom part, just don't get the sensitivity part. I am using an old hik 2032 set at 1/1000 and it captures plates but granted in a driveway where they aren't really moving much.

So I should probably go read the lpr section and shut up.
 

bigredfish

Known around here
Joined
Sep 5, 2016
Messages
17,016
Reaction score
47,475
Location
Floriduh
Not dumb.
I've been playing with LPR for 3 years now and still learning ;) Obviously shutter control and optical zoom are the big keys. After all, many, many Analog LPR cams out there that are still doing the job. Speed of the vehicle and angle of attack seem to be the biggest hurdles once you have a cam that's capable..
 
Joined
Nov 25, 2016
Messages
839
Reaction score
2,280
Just a followup to my original post - I have had no problems with autofocus for the last several weeks. Besides using the reflective targets, I also switch over from daytime to nighttime mode an hour before sunset, and switch back an hour after sunrise. Doing so provides additional ambient light to assure that the autofocus doesn't get confused and misfocus during the switching transition.
 

hamsoplo

Getting the hang of it
Joined
Jun 8, 2014
Messages
144
Reaction score
55
Tried this, been good for 3 nights now so seems to help. Hopefully my neighbor doesn't remove it. Daytime still has the same problem of focus shifting and not coming back into focus. I'm almost all the way zoomed out, like 90%. I also switch and hour before sunset and an hour after sunrise.
 

bigredfish

Known around here
Joined
Sep 5, 2016
Messages
17,016
Reaction score
47,475
Location
Floriduh
Sad that Dahua cant make this cam reliable,

I'm needing another 60mm or so lens cam for LPR and was thinking about getting another of these from Andy along with some other new cams, but after continuing to wrestle with my first one I'm going to have to shop around I think...

(scratch referenced HIK camera, not enough lens)

For about $500 I wonder if ths might be an option? Assuming not all of Dahua's longer distance cameras have the same focus problem?
ITC237-PU1B-IR
https://www.dahuasecurity.com/products/productDetail/12241
 
Last edited:

hamsoplo

Getting the hang of it
Joined
Jun 8, 2014
Messages
144
Reaction score
55
Nevermind, camera still goes out of focus and stays out of focus even with the reflectors day and night. Might have to try a little less zoom or figure a way to constantly send a focus command to it every few minutes.
 

bigredfish

Known around here
Joined
Sep 5, 2016
Messages
17,016
Reaction score
47,475
Location
Floriduh
So thanks to @wtimothyholman I've recently tried the reflective tape thing with good success so far 4 nights running.... keeping fingers crossed.

I had tried a script that another member (@bickford ) was gracious enough to give me that I was able to run from the Axis camera on the same pole, but unfortunately it wasnt the full solution. (I have no device to run the Sunrise/Sunset utility with on that network)

So as you can see in the image captures, I have 3 patches of the reflective tape on the street, and I make sure the schedule changes to night mode 30 minutes prior to dark to allow the camera to focus on the tape. I then wait until 30 min after sunrise to allow the schedule to switch to Day/color mode.

The spot I'm capturing plates is right at 120ft and about a 30 degree? angle.

HOA Entrance_EntrTag_main_20181005205329.jpg HOA Entrance_EntrTag_main_20181005204046.jpg HOA Entrance_EntrTag_main_20181004210128.jpg HOA Entrance_EntrTag_main_20181004211727.jpg HOA Entrance_EntrTag_main_20181004210841.jpg HOA Entrance_EntrTag_main_20181003203053.jpg HOA Entrance_EntrTag_main_20181001230722.jpg HOA Entrance_EntrTag_main_20181001225013.jpg HOA Entrance_EntrTag_main_20181001222045.jpg HOA Entrance_EntrTag_main_20181005080257_@8.jpg HOA Entrance_Overview_main_20181005110439_@8.jpg
 
Top