Blue Iris and DeepStack ALPR

Joined
Oct 16, 2018
Messages
1,676
Reaction score
5,526
Location
Florida, USA
This is in LPRCam folder, not ALPR.

02/13/2022 14:42:18 Plate: NoCharactersFound 0.0% CropTime: 15.6 ms OCRTime: 0.0 ms AlertTime: 15.6 ms TotalTime: 31.2 ms File:

D13CD386-A771-4C4A-9837-A60C626E8A68.jpeg

Notice that the files only have the extensions of .json and .txt

So, I guess I do not have everything setup correctly.

I did change the LPR directory in the .ini file to Alerts\LPRCam from Alerts\ALPR.
 

MikeLud1

IPCT Contributor
Joined
Apr 5, 2017
Messages
2,219
Reaction score
4,261
Location
Brooklyn, NY
This is in LPRCam folder, not ALPR.

02/13/2022 14:42:18 Plate: NoCharactersFound 0.0% CropTime: 15.6 ms OCRTime: 0.0 ms AlertTime: 15.6 ms TotalTime: 31.2 ms File:

View attachment 118677

Notice that the files only have the extensions of .json and .txt

So, I guess I do not have everything setup correctly.

I did change the LPR directory in the .ini file to Alerts\LPRCam from Alerts\ALPR.
Change the directory back to Alerts\ALPR
 

MikeLud1

IPCT Contributor
Joined
Apr 5, 2017
Messages
2,219
Reaction score
4,261
Location
Brooklyn, NY
I changed it back. How does your program know to look at LPRCam folder under alerts?
Below is the flow that show how DeepStackALPR works

  1. When the LPR camera is triggered Blue Iris will start sending images to DeepStack
  2. DeepStack will use the license-plate model to determine if a license plate is in the FOV
  3. If DeepStack determines that a license plate is in the FOV DeepStack will send back the results to Blue Iris
  4. If Blue Iris receives a confirmed license plate from DeepStack then Blue Iris will send the confirmed image to DeepStackALPR API on port 5000
  5. Then DeepStackALPR API will reconfirm if the image just received has a license plate using the license-plate model.
  6. If a license plate is confirmed then DeepStackALPR API will overwrite the last saved cropped image that is in folder /www/ALPR
  7. Next DeepStackALPR API will open the cropped image that is in folder /www/ALPR and use the lplate_char model to read the characters in the license plate.
  8. If DeepStackALPR API determined that characters are read it will send the results back to the LPR camera and Blue Iris will log the results.
  9. Also DeepStackALPR API send a JSON trigger with a memo containing the characters read to the camera that was created in step 3 "ALPR" and Blue Iris will log the results.
  10. After the JSON trigger DeepStackALPR API will update the logfile.txt, and save a JSON and YOLO.txt file that contains details about the characters found in the alert folder for the ALPR camera that was created in step 3
    1. If DeepStackALPR API determined that no characters were found it will send a -N-C-F- result to the LPR camera and Blue Iris will log the result
    2. Also DeepStackALPR API will send a JSON trigger with a memo containing "No Characters Found" to the camera that was created in step 3 "ALPR" and Blue Iris will log the results.
    3. After the JSON trigger DeepStackALPR API will update the logfile.txt, and save a JSON and YOLO.txt file that contains details about the No Characters Found in the alert folder for the ALPR camera that was created in step 3
 

johnstjs

Getting the hang of it
Joined
Dec 7, 2020
Messages
74
Reaction score
36
Location
08070
Hey Mike

Any chance you can post screenshots of the record settings on both of your cameras (the physical LPR and the virtual ALPR)? I am still getting "Deepstack: Alert cancelled [nothing found]" in the logs. Attached is a pic of the alert folder. Also, is there any way to change where it reads the alerts? I'd like it to read a little sooner (one of my goals is to connect it to our gate reader to automatically open the gate depending on the plate) but to also read it when it's closer to the camera. Basically, when a car pulls in or out I'd like to see 3 or 4 alert pics to ensure a good pic of the plate.

Thanks!

Jeff

LPR.20220215_065959.638602.131-9.1823.1823.jpg
 

johnstjs

Getting the hang of it
Joined
Dec 7, 2020
Messages
74
Reaction score
36
Location
08070
Below is the flow that show how DeepStackALPR works

  1. When the LPR camera is triggered Blue Iris will start sending images to DeepStack
  2. DeepStack will use the license-plate model to determine if a license plate is in the FOV
  3. If DeepStack determines that a license plate is in the FOV DeepStack will send back the results to Blue Iris
  4. If Blue Iris receives a confirmed license plate from DeepStack then Blue Iris will send the confirmed image to DeepStackALPR API on port 5000
  5. Then DeepStackALPR API will reconfirm if the image just received has a license plate using the license-plate model.
  6. If a license plate is confirmed then DeepStackALPR API will overwrite the last saved cropped image that is in folder /www/ALPR
  7. Next DeepStackALPR API will open the cropped image that is in folder /www/ALPR and use the lplate_char model to read the characters in the license plate.
  8. If DeepStackALPR API determined that characters are read it will send the results back to the LPR camera and Blue Iris will log the results.
  9. Also DeepStackALPR API send a JSON trigger with a memo containing the characters read to the camera that was created in step 3 "ALPR" and Blue Iris will log the results.
  10. After the JSON trigger DeepStackALPR API will update the logfile.txt, and save a JSON and YOLO.txt file that contains details about the characters found in the alert folder for the ALPR camera that was created in step 3
    1. If DeepStackALPR API determined that no characters were found it will send a -N-C-F- result to the LPR camera and Blue Iris will log the result
    2. Also DeepStackALPR API will send a JSON trigger with a memo containing "No Characters Found" to the camera that was created in step 3 "ALPR" and Blue Iris will log the results.
    3. After the JSON trigger DeepStackALPR API will update the logfile.txt, and save a JSON and YOLO.txt file that contains details about the No Characters Found in the alert folder for the ALPR camera that was created in step 3
I've got it grabbing some license plates, but not all of them. Here's one that it found and it copied the cropped file to the C:\.......\www\ALPR\ALPR.jpg, but I can't find a logfile.txt or json file anywhere. Also for this one, does 50% confidence seem right or do I need to tweak some settings? Last - the "file path.txt" file doesn't seem to be updating. There was the name of a file from a few weeks ago, but it stays the same.

Thanks for everything!

Jeff

LPR.20220215_065959.3244975.6147-9.17699.20597.jpg
 

MikeLud1

IPCT Contributor
Joined
Apr 5, 2017
Messages
2,219
Reaction score
4,261
Location
Brooklyn, NY
I've got it grabbing some license plates, but not all of them. Here's one that it found and it copied the cropped file to the C:\.......\www\ALPR\ALPR.jpg, but I can't find a logfile.txt or json file anywhere. Also for this one, does 50% confidence seem right or do I need to tweak some settings? Last - the "file path.txt" file doesn't seem to be updating. There was the name of a file from a few weeks ago, but it stays the same.

Thanks for everything!

Jeff

View attachment 118845
I will respond with more details later tonight, I am working right now. For a start make sure you have DeepStack mode set to High, 50% is low, I normally get about 90%. Also if your camera has more zoom then zoom in, you should try to have the image FOV like the below image.

1644944998206.png
1644945390822.png
 

johnstjs

Getting the hang of it
Joined
Dec 7, 2020
Messages
74
Reaction score
36
Location
08070
Thanks for taking the time to respond! It is much appreciated. I zoomed in a bit on the camera (not quite a much as you have - this camera is also for security not just LPR so we want to get the cars coming and going). I set Deepstack to high earlier this morning, just to be sure, I just stopped and started the service. I've obviously also got a setting wrong somewhere. I'm not getting a logfile.txt file anywhere and I'm not getting a folder created for in my Alerts subdirectory for ALPR. I've gotta get back to work also. Thanks again!
 

sebastiantombs

Known around here
Joined
Dec 28, 2019
Messages
11,511
Reaction score
27,696
Location
New Jersey
As an aside, LPR and and overview in the same camera won't really work. LPR need a good, tight, FOV that just includes the vehicle as much as possible. That eliminates it from being an overview/observation camera. Consider adding a camera there to get good plates and a good overview.
 

johnstjs

Getting the hang of it
Joined
Dec 7, 2020
Messages
74
Reaction score
36
Location
08070
As an aside, LPR and and overview in the same camera won't really work. LPR need a good, tight, FOV that just includes the vehicle as much as possible. That eliminates it from being an overview/observation camera. Consider adding a camera there to get good plates and a good overview.
Yup - but this is a non-profit club and the LPR portion is a "nice to have". As long as the plate can be read manually, there's not a whole lot of money/time/energy to make it better. And actually, this camera is primarily used for license plates (just not LPR except at night when the settings are changed to account for license plate glare). I'm going to zoom in during daylight a little at a time to see if I get any feedback.

Thanks

Jeff
 

MikeLud1

IPCT Contributor
Joined
Apr 5, 2017
Messages
2,219
Reaction score
4,261
Location
Brooklyn, NY
Thanks for taking the time to respond! It is much appreciated. I zoomed in a bit on the camera (not quite a much as you have - this camera is also for security not just LPR so we want to get the cars coming and going). I set Deepstack to high earlier this morning, just to be sure, I just stopped and started the service. I've obviously also got a setting wrong somewhere. I'm not getting a logfile.txt file anywhere and I'm not getting a folder created for in my Alerts subdirectory for ALPR. I've gotta get back to work also. Thanks again!
Make sure the ALPR camera has the below trigger setting, did you do all of settings shown is step 3. The logfile.txt will be in the ALPR alert folder. The only setting that needs to be changed in the ALPR record tab is to override the folder with this setting &CAM\%Y%m%d\&CAM.%Y%m%d_%H%M%S

Also please post your DS_ALPR_config.ini file

1644977349459.png
1644977895485.png

1644977537708.png

My LPR Record settings
1644978090759.png
 

johnstjs

Getting the hang of it
Joined
Dec 7, 2020
Messages
74
Reaction score
36
Location
08070
Thanks Mike

I'm getting my Deepstack alerts now and getting a cropped image in the C:\Program Files\Blue Iris 5\www\ALPR folder, but there is nothing going into my alerts folder for the virtual ALPR camera (D:\BlueIris\Alerts\ALPR). Below is my .ini settings as well as some screen shots.

DS_ALPR.ini
[shared]
; If Blue Iris and DeepStack is installed with default settings no changes needed, otherwise adjusted as needed
bi_server = ds_server = alpr_server_ip = 127.0.0.1
alpr_server_port = 5000

; Blue Iris userid and password is needed so script can communicate back to Blue Iris (must have admin rights)
userid = DeepstackALPR
password = DeepstackALPR

[ds_lpr]
; Blue Iris short name for cropped licence plate camera and resolution settings
camera = ALPR
image_x = 160
image_y = 120

; Use to rotate cropped licence plate, positive number for CCW or negative number for CW
rotate_deg = 0

; If cropped licence plate is rotated increase number by "1" until black corners are removed
image_offset = 0

; If Blue Iris is installed with default settings no changes needed, where script will save the cropped licence plate
cropped_directory = C:\Program Files\Blue Iris 5\www\ALPR

[ds_ocr]
; Where cropped camera's alert directory is
lpr_directory = D:\BlueIris\Alerts\ALPR\*

; Leave default setting of 4, how close the characters can be before the inferior one is ignored
overlapping_threshold = 4

; Leave default setting 0.40, if worst confidence is less than this, the result wont be written to output_logfile
min_conf_thres = 0.40

; Leave default setting of 2, if there is not more than this number of characters detected on the plate, the result wont be written to output_logfile
min_len_thres = 2

; Leave default setting of 8, if there is more character detected than this number, program will cut out the weakest confidence characters until value met.
plate_len_threshold = 8

; Leave default setting of 0.150 ms
path_delay = 0.150

ALPR Trigger
1645016522499.png

ALPR Record
1645016574861.png

ALPR Video
1645016646718.png


LPR.20220216_070000.2779991.6147-9.6501.9498.jpg

LPR.20220216_070000.2777889.6147-9.18854.30200.jpg

Cropped plate (from a different car than above - it appears as if I need to adjust the size from 160x120 to something else?)
ALPR.jpg
 

Attachments

MikeLud1

IPCT Contributor
Joined
Apr 5, 2017
Messages
2,219
Reaction score
4,261
Location
Brooklyn, NY
Thanks Mike

I'm getting my Deepstack alerts now and getting a cropped image in the C:\Program Files\Blue Iris 5\www\ALPR folder, but there is nothing going into my alerts folder for the virtual ALPR camera (D:\BlueIris\Alerts\ALPR). Below is my .ini settings as well as some screen shots.

DS_ALPR.ini
[shared]
; If Blue Iris and DeepStack is installed with default settings no changes needed, otherwise adjusted as needed
bi_server = ds_server = alpr_server_ip = 127.0.0.1
alpr_server_port = 5000

; Blue Iris userid and password is needed so script can communicate back to Blue Iris (must have admin rights)
userid = DeepstackALPR
password = DeepstackALPR

[ds_lpr]
; Blue Iris short name for cropped licence plate camera and resolution settings
camera = ALPR
image_x = 160
image_y = 120

; Use to rotate cropped licence plate, positive number for CCW or negative number for CW
rotate_deg = 0

; If cropped licence plate is rotated increase number by "1" until black corners are removed
image_offset = 0

; If Blue Iris is installed with default settings no changes needed, where script will save the cropped licence plate
cropped_directory = C:\Program Files\Blue Iris 5\www\ALPR

[ds_ocr]
; Where cropped camera's alert directory is
lpr_directory = D:\BlueIris\Alerts\ALPR\*

; Leave default setting of 4, how close the characters can be before the inferior one is ignored
overlapping_threshold = 4

; Leave default setting 0.40, if worst confidence is less than this, the result wont be written to output_logfile
min_conf_thres = 0.40

; Leave default setting of 2, if there is not more than this number of characters detected on the plate, the result wont be written to output_logfile
min_len_thres = 2

; Leave default setting of 8, if there is more character detected than this number, program will cut out the weakest confidence characters until value met.
plate_len_threshold = 8

; Leave default setting of 0.150 ms
path_delay = 0.150

ALPR Trigger
View attachment 119020

ALPR Record
View attachment 119021

ALPR Video
View attachment 119022


View attachment 119024

View attachment 119025

Cropped plate (from a different car than above - it appears as if I need to adjust the size from 160x120 to something else?)
View attachment 119026
Does your user have admin rights
; Blue Iris userid and password is needed so script can communicate back to Blue Iris (must have admin rights)
userid = DeepstackALPR
password = DeepstackALPR
Also does you ALPR camera have the below settings

1645018702262.png

Also the Short name needs to be ALPR for the ALPR camera

1645018940326.png
 

johnstjs

Getting the hang of it
Joined
Dec 7, 2020
Messages
74
Reaction score
36
Location
08070
Does your user have admin rights


Also does you ALPR camera have the below settings

View attachment 119028

Also the Short name needs to be ALPR for the ALPR camera

View attachment 119031
Just verified username, password, and admin rights. ALPR is the Short name (regular long name doesn't matter correct?)

Setup Actions exactly as above. Just to be sure, this is on the ALPR (virtual cropped camera), go to <Alerts Tab>, and click on Actions--> <On Alert>

Question - the ALPR camera <Trigger> tab, it is set to "Add to alerts list: Hi-res JPEG files" under the "When triggered" section. How does it know when to trigger? Should something be set under the "Sources" section?

1645021599153.png

Thanks for all of your help!!!!

Jeff
 

MikeLud1

IPCT Contributor
Joined
Apr 5, 2017
Messages
2,219
Reaction score
4,261
Location
Brooklyn, NY
Just verified username, password, and admin rights. ALPR is the Short name (regular long name doesn't matter correct?)

Setup Actions exactly as above. Just to be sure, this is on the ALPR (virtual cropped camera), go to <Alerts Tab>, and click on Actions--> <On Alert>

Question - the ALPR camera <Trigger> tab, it is set to "Add to alerts list: Hi-res JPEG files" under the "When triggered" section. How does it know when to trigger? Should something be set under the "Sources" section?

View attachment 119033

Thanks for all of your help!!!!

Jeff
Just verified username, password, and admin rights. ALPR is the Short name (regular long name doesn't matter correct?)
It should not matter.
Setup Actions exactly as above. Just to be sure, this is on the ALPR (virtual cropped camera), go to <Alerts Tab>, and click on Actions--> <On Alert>
Correct it is on the ALPR (virtual cropped camera)
Question - the ALPR camera <Trigger> tab, it is set to "Add to alerts list: Hi-res JPEG files" under the "When triggered" section. How does it know when to trigger? Should something be set under the "Sources" section?
DeepStackALPR API will send a JSON trigger with a memo containing the characters read to the camera that was created in step 3 "ALPR" and Blue Iris will log the results.
 

MikeLud1

IPCT Contributor
Joined
Apr 5, 2017
Messages
2,219
Reaction score
4,261
Location
Brooklyn, NY
Just verified username, password, and admin rights. ALPR is the Short name (regular long name doesn't matter correct?)

Setup Actions exactly as above. Just to be sure, this is on the ALPR (virtual cropped camera), go to <Alerts Tab>, and click on Actions--> <On Alert>

Question - the ALPR camera <Trigger> tab, it is set to "Add to alerts list: Hi-res JPEG files" under the "When triggered" section. How does it know when to trigger? Should something be set under the "Sources" section?

View attachment 119033

Thanks for all of your help!!!!

Jeff
Can you post a screenshot of Blur Iris log

1645024938644.png
 
Top