I'm changing the shutter speed by logging into the camera directly using the web interface. I also have a Hikvision NVR, but the NVR does not expose all the camera functionality in its web interface so you need to log into the camera directly.
Here is what the screen looks like.
View attachment 8865
uuid, datetime, plate, confidence, match_pattern
example:
mysite-cam1-DFD343SSDF, 3/8/2016 12:54:23, 1FBF234, 81.65765, True
-p <pattern code>, --pattern <pattern code> Attempt to match the plate number against a plate pattern (e.g., md
for Maryland, ca for California)
alpr has a cli trigger for pattern codes, I am not sure how to get that into alprd.. might try dropping it into the config
[B] if[/B] (templatePattern.empty() == false)
alpr.setDefaultRegion(templatePattern);
[B] if[/B] (templatePattern.empty() == true)
alpr.setDefaultRegion("ca");
[B]if[/B] (alpr.isLoaded() == false)
{
#!/usr/bin/python
import beanstalkc
import datetime
import json
import os
import time
import csv
import re
def main():
# CA license plate regex
# Formats: #@@@###, #@#####, ###@@@, #####@#
plate_patterns = [r'^[0-9][A-Z]{3}[0-9]{3}$',r'^[0-9][A-Z][0-9]{5}$',r'^[0-9]{3}[A-Z]{3}$',r'^[0-9]{5}[A-Z][0-9]$']
csvfile_loc = '/location/to/output/myplates.csv'
plateimage_loc = '/var/lib/openalpr/plateimages/'
# known bad reads to be ignored; add any plates that commonly come up as incorrect via bad images
bad_plates = ['554A1A2']
#db = MySQLdb.connect("localhost", "root", "YOUR_MySQL_PASSWORD","alprdb")
beanstalk = beanstalkc.Connection(host='localhost', port=11300)
#cur = db.cursor()
beanstalk.watch('alprd')
#print beanstalk.stats_tube('alprd')
job = beanstalk.reserve(timeout=0)
while job is not None:
#print job.body
#print job.stats()
json_body = json.loads(job.body)
uuid = json_body['uuid']
datetime = time.strftime('%m/%d/%Y %H:%M:%S', time.localtime(json_body['epoch_time']/1000))
print 'uuid: ' + uuid
print 'datetime: ' + datetime
#print 'len:' + str(len(json_body['results']))
for result in json_body['results']:
plate = result['plate']
confidence = result['confidence']
pattern_match = False # whether the plate matches specified pattern
print 'plate: ' + plate + ' - ' + str(confidence)
# Match license plate pattern
for plate_format in plate_patterns:
is_match = re.search(plate_format, plate)
if is_match:
print 'Found pattern match: ' + is_match.group(0)
pattern_match = True
break
# If we did not find a pattern match, check the list of candidates
if not pattern_match:
for candidate in result['candidates']:
plate_c = candidate['plate']
confidence_c = candidate['confidence']
print 'candidate: ' + plate_c + ' - ' + str(confidence_c)
for plate_format in plate_patterns:
is_match = re.search(plate_format, plate_c)
if is_match:
print 'Found pattern match: ' + is_match.group(0)
pattern_match = True
break
if pattern_match:
# override plate at top level with one that matches
plate = plate_c
confidence = confidence_c
break
if plate in bad_plates:
print 'ignoring invalid plate: ' + plate
## try to delete file ##
#try:
# file_to_delete = plateimage_loc + uuid + '.jpg'
# os.remove(file_to_delete)
#except OSError, e: ## if failed, report it back to the user ##
# print ("Error: %s - %s." % (e.filename,e.strerror))
else:
print 'storing result: ' + plate + ', ' + str(confidence) + ', matched: ' + str(pattern_match)
with open(csvfile_loc, 'a+b') as f:
csvrow = [uuid, datetime, plate, str(confidence), str(pattern_match)]
writer = csv.writer(f)
writer.writerow(csvrow)
f.close()
job.delete()
job = beanstalk.reserve(timeout=0)
if __name__ == "__main__":
main()
sudo iptables -L
Chain INPUT (policy ACCEPT)
target prot opt source destination
REJECT udp -- anywhere anywhere udp dpt:rtsp reject-with icmp-port-unreachable
Chain FORWARD (policy ACCEPT)
target prot opt source destination
Chain OUTPUT (policy ACCEPT)
target prot opt source destination
REJECT udp -- anywhere anywhere udp dpt:rtsp reject-with icmp-port-unreachable
@nayr, thanks. "...A lot of external processing power to do it externally"...So, if all my cameras are going through a NVR, would that mean I could not do this at all?you can get cameras with functionallity built in.. costs alot of money, you can use some free software but it takes alot of knowledge and expertise... you also need alot of processing power to do it externally.
right now there is not much as far as easy to roll out solutions....
iptables -nL and I actually got it slightly wrong
iptables -A OUTPUT -p udp --dport 554 -j REJECT
iptables -A INPUT -p udp --sport 554 -j REJECT
output to 554 - rejected, input from 554 - rejected.