Closed ZillionPrey closed 3 years ago
This jumping is coming from wrong recognzized single digits. Your ROIs seems to be very big and with varying size. In the definition, there is a bigger and a smaller rectengular, the smaller one should be just as big as the digit. This already should improve the recognition. Also you have a refection in the lower part of the image, this might disturb the recognition additionally.
Of course jomjol knows best but I can second his tips from a user perspective. I also had rather unreliable readings at first and my ROIs looked the same as yours. Then I optimized them, and fitted them exactly to the numbers. And the readings got much better. And like he said, the reflections may be a problem. Try some kind of diffusor on the LED or use external LEDs from another angle.
You may also get better results, if you position the cam higher, that the meter is in the center of the view and the cam stands perpendicular over the meter. (But maybe this would enhance the reflection-problem)
Thank you two for the feedback on getting a better result.
Isn't it suboptimal to set the cam higher because of the reflections? I tried to diffuse the led somewhat but it always looks the same blurred out in the middle. Like the cam seems to compensate for the fact that the diffused light is not bright enough.
Yes, I suspected the position was a compromise concerning the reflections...
Maybe really try the alternative lighting. Try MakerMeik's video ( https://youtu.be/iUgxwbfkIqU ) on this and break out the onboard LED or use the new GPIO-LED option in version 8.0.0 (if I understood its purpose correctly)
Made them smaller, and they seem to work better now, but why is it reading the correct raw value (821776) and tries to correct it to 821780?
Turn CheckDigitIncreaseConsistency to false, that should help
Got an external LED now glare on the numers is gone, still the readings are compleatly out of place
Can you post your config.ini - especially, which tflite you are using? Normally this kind of power meter works very well, I have a similar one - running smooth. But I'm much closer to the number:
I'd have to modify the box from makermeik to get closer to the numbers. I used his original model like in the video.
This is my config file:
[MakeImage]
;LogImageLocation = /log/source
;LogfileRetentionInDays = 15
WaitBeforeTakingPicture = 5
ImageQuality = 5
ImageSize = VGA
Brightness = -2
FixedExposure = false
[Alignment]
InitialRotate = 272
FlipImageSize = false
/config/ref0.jpg 117 174
/config/ref1.jpg 476 349
SearchFieldX = 20
SearchFieldY = 20
InitialMirror = false
AlignmentAlgo = Default
[Digits]
Model = /config/dig0870s3q.tflite
;LogImageLocation = /log/digit
;LogfileRetentionInDays = 3
ModelInputSize = 20 32
digit2 237 174 22 41
ROI1 272 174 22 41
ROI2 306 174 22 41
ROI3 343 174 22 41
ROI4 377 174 22 41
ROI5 412 174 22 41
ROI6 447 174 22 41
;[Analog]
Model = /config/ana0700s1lq.tflite
;LogImageLocation = /log/analog
;LogfileRetentionInDays = 3
ModelInputSize = 32 32
analog1 444 225 92 92
analog2 391 329 92 92
analog3 294 369 92 92
analog4 168 326 92 92
ExtendedResolution = false
[PostProcessing]
DecimalShift = 0
PreValueUse = true
PreValueAgeStartup = 720
AllowNegativeRates = true
MaxRateValue = 5
ErrorMessage = true
;CheckDigitIncreaseConsistency = false
[MQTT]
Uri = mqtt://192.168.1.83:1883
Topic = stromzaehler/zaehlerstand
TopicError = stromzaehler/error
TopicRate = stromzaehler/rate
TopicTimeStamp = stromzaehler/timestamp
ClientID = stromz
user = ****** - Hidden
password = ****** - Hidden
[AutoTimer]
AutoStart = true
Intervall = 1
[Debug]
Logfile = false
LogfileRetentionInDays = 3
[System]
TimeZone = CET-1CEST
;TimeServer = fritz.box
;Hostname = watermeter
;SetupMode = false
[Ende]
The tflite for the digits is rather old (dig0870s3q.tflite
= v8.7.0). Meanwhile, it is on version v11.0.0. You can find the newest file in this directory: https://github.com/jomjol/AI-on-the-edge-device/tree/master/sd-card/config
Just download it and store it in the /config directory on the sd-card and modify the config.ini correspondingly
Few things I did now
So far it seems to be quite promising, if this continues to work perfectly I'd think it's a great addition in the Installation guide, big numbers = better. So advising the people who might want to try this too to get the cam as close to the digits as possible.
Oh and also, great project btw. I have planned such thing quite a while ago but never came to the idea to just image capture the meter :D
I'll post an update tomorrow to see if it held up :)
Next problem, looks like since the update it stops working completely. No response from the Webinterface and no updates are being pushed to mqtt. Think I'll have to revert to the older firmware.
what exactly did you update? only the html was necesarry, firmware is unchanged.
I downloaded the 8.0.0 zip from the repo and flashed the firmware.bin and the html zip file over OTA
Well, there is v8.0.1 and I just updated from v8.0.0 to v8.0.1 three systems without a problem.
I've read the espcams have power issues, could that be a result of that? Do you use anything special or just the espcams themselves?
Nothing special. Only a strong power supply (USB) and a 470µF condensator
I'm using a Samsung phone charger that gives out about 5.2v - I'll add a cap and try to reflash the esp
Should be okay. How high is the current. The flash can consume up to 500mA. I have 3 devices running on a normal USB power supply without a problem
i had great problems , after i solved a 1000uF elko between vcc and ground , the restarts or broken connection to the 32cam device are very lower ! Powersupply with 3A resolved not the problem
Did everything now and I can't seem to understand why it should fail. I always have to manually add the value because it seems to have skipped some digits. I don't really want to change the maximum rate value to 5 or 10 because then it jumps quite a lot and it's not as clear in the history.
Things I did now:
Have you turned on the log and verified that the value indeed hasn't changed for the time period to rule out a mere MQTT problem?
I don't think it's a MQTT problem, the jumps are because I have to change the preValue per hand so it continues to count up. If I wouldn't do this the line would be flat by now.
Hey, I really wanted my meter in Home Assistant so I found Your solution with the ESPCam sadly this solution is very inconsistent and is jumping around like crazy.
Anything to make it more reliable?