it's ok MAtt i fixed it there is no version 2.4.8. i changed it to 2.4.9
now i tried to make it work with my RPI webcam using this documentation
:
http://lukagabric.com/raspberry-pi-license-plate-recognition/i changed in that PyALPR.py document these lines:
#webcam subprocess args
webcam_command = "raspivid -o alpr.jpg"
self.webcam_command_args = shlex.split(webcam_command)
#alpr subprocess args
alpr_command = "alpr -c tn -t hr -n 300 -j alpr.jpg"
self.alpr_command_args = shlex.split(alpr_command)
def webcam_subprocess(self):
return subprocess.Popen(self.webcam_command_args, stdout=subprocess.PIPE, shell=True)
def alpr_subprocess(self):
return subprocess.Popen(self.alpr_command_args, stdout=subprocess.PIPE, shell=True)
to give it the right raspberry camera command and the right "alpr -c tn" command
and corrected that fault (added shell=True) in those 2 lines trying to make it work but !....... i got all of this :
pi@raspberrypi ~/PyALPR-master $ python PyALPR.py
raspivid Camera App v1.3.12
Display camera output to display, and optionally saves an H264 capture at requested bitrate
usage: raspivid [options]
Image parameter commands
-?, --help : This help information
-w, --width : Set image width <size>. Default 1920
-h, --height : Set image height <size>. Default 1080
-b, --bitrate : Set bitrate. Use bits per second (e.g. 10MBits/s would be -b 10000000)
-o, --output : Output filename <filename> (to write to stdout, use '-o -')
-v, --verbose : Output verbose information during run
-t, --timeout : Time (in ms) to capture for. If not specified, set to 5s. Zero to disable
-d, --demo : Run a demo mode (cycle through range of camera options, no capture)
-fps, --framerate : Specify the frames per second to record
-e, --penc : Display preview image *after* encoding (shows compression artifacts)
-g,
--intra : Specify the intra refresh period (key frame rate/GoP
size). Zero to produce an initial I-frame and then just P-frames.
-pf, --profile : Specify H264 profile to use for encoding
-td, --timed : Cycle between capture and pause. -cycle on,off where on is record time and off is pause time in ms
-s, --signal : Cycle between capture and pause on Signal
-k, --keypress : Cycle between capture and pause on ENTER
-i, --initial : Initial state. Use 'record' or 'pause'. Default 'record'
-qp, --qp : Quantisation parameter. Use approximately 10-40. Default 0 (off)
-ih, --inline : Insert inline headers (SPS, PPS) to stream
-sg, --segment : Segment output file in to multiple files at specified interval <ms>
-wr, --wrap : In segment mode, wrap any numbered filename back to 1 when reach number
-sn, --start : In segment mode, start with specified segment number
-sp, --split : In wait mode, create new output file for each start event
-c, --circular : Run encoded data through circular buffer until triggered then save
-x, --vectors : Output filename <filename> for inline motion vectors
-cs, --camselect : Select camera <number>. Default 0
-set, --settings : Retrieve camera settings and write to stdout
-md, --mode : Force sensor mode. 0=auto. See docs for other modes available
-if, --irefresh : Set intra refresh type
H264 Profile options :
baseline,main,high
H264 Intra refresh options :
cyclic,adaptive,both,cyclicrows
Preview parameter commands
-p, --preview : Preview window settings <'x,y,w,h'>
-f, --fullscreen : Fullscreen preview mode
-op, --opacity : Preview window opacity (0-255)
-n, --nopreview : Do not display a preview window
Image parameter commands
-sh, --sharpness : Set image sharpness (-100 to 100)
-co, --contrast : Set image contrast (-100 to 100)
-br, --brightness : Set image brightness (0 to 100)
-sa, --saturation : Set image saturation (-100 to 100)
-ISO, --ISO : Set capture ISO
-vs, --vstab : Turn on video stabilisation
-ev, --ev : Set EV compensation
-ex, --exposure : Set exposure mode (see Notes)
-awb, --awb : Set AWB mode (see Notes)
-ifx, --imxfx : Set image effect (see Notes)
-cfx, --colfx : Set colour effect (U:V)
-mm, --metering : Set metering mode (see Notes)
-rot, --rotation : Set image rotation (0-359)
-hf, --hflip : Set horizontal flip
-vf, --vflip : Set vertical flip
-roi, --roi : Set region of interest (x,y,w,d as normalised coordinates [0.0-1.0])
-ss, --shutter : Set shutter speed in microseconds
-awbg, --awbgains : Set AWB gains - AWB mode must be off
-drc, --drc : Set DRC Level
-st, --stats : Force recomputation of statistics on stills capture pass
-a, --annotate : Enable/Set annotate flags or text
-3d, --stereo : Select stereoscopic mode
-dec, --decimate : Half width/height of stereo image
-3dswap, --3dswap : Swap camera order for stereoscopic
-ae, --annotateex : Set extra annotation parameters (text size, text colour(hex YUV), bg colour(hex YUV))
Notes
Exposure mode options :
auto,night,nightpreview,backlight,spotlight,sports,snow,beach,verylong,fixedfps,antishake,fireworks
AWB mode options :
off,auto,sun,cloud,shade,tungsten,fluorescent,incandescent,flash,horizon
Image Effect mode options :
none,negative,solarise,sketch,denoise,emboss,oilpaint,hatch,gpen,pastel,watercolour,film,blur,saturation,colourswap,washedout,posterise,colourpoint,colourbalance,cartoon
Metering Mode options :
average,spot,backlit,matrix
Dynamic Range Compression (DRC) options :
off,low,med,high
Warning: You are running an unsupported version of Tesseract.
Expecting version 3.03, your version is: 3.02.02
Error opening data file /usr/local/src/openalpr/tesseract-ocr/tessdata/tessdata/lus.traineddata
Please make sure the TESSDATA_PREFIX environment variable is set to the parent directory of your "tessdata" directory.
Failed loading language 'lus'
Tesseract couldn't load any languages!
^CTraceback (most recent call last):
File "PyALPR.py", line 64, in <module>
plate_reader.read_plate()
File "PyALPR.py", line 40, in read_plate
alpr_json, alpr_error = self.alpr_json_results()
File "PyALPR.py", line 26, in alpr_json_results
alpr_out, alpr_error = self.alpr_subprocess().communicate()
File "/usr/lib/python2.7/subprocess.py", line 746, in communicate
stdout = _eintr_retry_call(self.stdout.read)
File "/usr/lib/python2.7/subprocess.py", line 478, in _eintr_retry_call
return func(*args)
KeyboardInterrupt
knowing that it works on RPI with pics and videos
how can i correct this?