Navigation

    Logo
    • Register
    • Login
    • Search
    • Recent
    • Tags
    • Unread
    • Categories
    • Unreplied
    • Popular
    • GitHub
    • Docu
    • Hilfe
    1. Home
    2. ruebenschuss

    NEWS

    • [erledigt] 15. 05. Wartungsarbeiten am ioBroker Forum

    • ioBroker goes Matter ... Matter Adapter in Stable

    • Monatsrückblick - April 2025

    R
    • Profile
    • Following 0
    • Followers 0
    • Topics 0
    • Posts 6
    • Best 0
    • Groups 1

    ruebenschuss

    @ruebenschuss

    Starter

    0
    Reputation
    10
    Profile views
    6
    Posts
    0
    Followers
    0
    Following
    Joined Last Online

    ruebenschuss Follow
    Starter

    Latest posts made by ruebenschuss

    • RE: Wasserzähler - Selfmade

      Und noch ein Update:
      Der Grund, warum bei mir die Bilder nicht angezeigt wurden ist, dass ich Safari als Browser benutzt habe. Im Debugging Modus zeigt er die Nachricht :

      "Failed to load resource: Cancelled load from ... because it is using HTTP/0.9"

      Wenn ich Firefox nehme, dann sehe ich alle Bilder.
      🤦‍♂️ und ich hab im python code tausend debug messages eingebaut...

      Jetzt sind die ausgelesenen Werte noch grützig, die Ziffern gehen gar nicht. Muss noch an der config.ini schrauben oder eventuell bei meinem Bild vorher noch den Kontrast erhöhen.

      posted in Hardware
      R
      ruebenschuss
    • RE: Wasserzähler - Selfmade

      okay: ich habe jetzt mein Bild erst Mal so ausgeschnitten, wie der Referenzausschnitt ist und dann auf 800x600 skaliert und nun läuft es durch.

      convert -rotate 90 -crop 452x339+0+114 -scale 800x600 /data/webcam/in.jpg /data/webcam/out.jpg
      

      Im Moment kann er noch gar nichts Sinnvolles erkennen und die Bilder, die er auf "&full" zurück geben sollte, sind alle leer. Aber zumindest läuft er nun ohne Fehlermeldung durch.

      Ich gucke mir jetzt mal die Bilder an, die er extrahiert, eventuell hab ich noch einen Fehler in meiner config.ini

      Dies nur schnell, damit ihr wisst, dass das Problem gelöst ist, wenn man das Bild vorher ordentlich skaliert.

      posted in Hardware
      R
      ruebenschuss
    • RE: Wasserzähler - Selfmade

      Mein Bild, das der Server hochgeladen und rotiert hat:
      root@dasding:~/water-meter-system-complete/code# jpeginfo image_tmp/rot.jpg
      image_tmp/rot.jpg 480 x 640 24bit JFIF N 195283

      Dein Referenz Bild.
      root@dasding:~/water-meter-system-complete/code# jpeginfo image_tmp/Referenz.jpg
      image_tmp/Referenz.jpg 800 x 600 24bit Exif N 92628

      posted in Hardware
      R
      ruebenschuss
    • RE: Wasserzähler - Selfmade

      @jomjol Meine Webcam macht Bilder in ca der halben Auflösung wie Deine. Mein Zähler sieht fast exakt so wie Deiner aus, die Referenz-Bilder würden also exakt passen, aber die Koordinaten im Bild und Pixel-Dimensionen sind alle ca die Hälfte von Deinen. Macht das Probleme mit den Referenz-Bildern? Muss ich die bei mir ausschneiden und in exakt der gleichen Pixel-Dimension ablegen?

      posted in Hardware
      R
      ruebenschuss
    • RE: Wasserzähler - Selfmade

      @jomjol Hey, DU brauchst Dich doch für gar nichts zu entschuldigen !!! 😉 Du machst so eine tolle Arbeit und stellst sie allen zur Verfügung, ganz locker bleiben... Es war auch gar nicht als Kritik gemeint, sondern nur als Feedback und Frage, ob jemand Hilfe weiss... Und dass Du dann auch noch so schnellen Support gibst ist echt ein Traum. Wenn ich es zum Laufen bekommen hab, spendiere ich 'ne Kiste eines Kaltgetränkes Deiner Wahl 🙂

      Ich hab die neue Version gezogen. Er scheint jetzt ein bisschen weiter zu kommen, "Start CutImage" kommt jetzt, das gab es vorher noch nicht. Aber ich kriege immer noch Fehler geworfen:

      ----------------------------------------
      Picture Download done
      Start CutImage
      ----------------------------------------
      Exception happened during processing of request from ('10.0.0.71', 50101)
      Traceback (most recent call last):
        File "/usr/lib/python3.7/socketserver.py", line 316, in _handle_request_noblock
          self.process_request(request, client_address)
        File "/usr/lib/python3.7/socketserver.py", line 347, in process_request
          self.finish_request(request, client_address)
        File "/usr/lib/python3.7/socketserver.py", line 360, in finish_request
          self.RequestHandlerClass(request, client_address, self)
        File "/usr/lib/python3.7/socketserver.py", line 720, in __init__
          self.handle()
        File "/usr/lib/python3.7/http/server.py", line 426, in handle
          self.handle_one_request()
        File "/usr/lib/python3.7/http/server.py", line 414, in handle_one_request
          method()
        File "wasseruhr.py", line 31, in do_GET
          result = wasserzaehler.getZaehlerstand('./image_tmp/original.jpg', simple, preValue)
        File "/root/water-meter-system-complete/code/lib/ZaehlerstandClass.py", line 34, in getZaehlerstand
          resultcut = self.CutImage.Cut(img_file)
        File "/root/water-meter-system-complete/code/lib/CutImageClass.py", line 58, in Cut
          target = self.Alignment(target)
        File "/root/water-meter-system-complete/code/lib/CutImageClass.py", line 96, in Alignment
          p0 = self.getRefCoordinate(source, ref0)
        File "/root/water-meter-system-complete/code/lib/CutImageClass.py", line 111, in getRefCoordinate
          res = cv2.matchTemplate(image, template, method)
      cv2.error: OpenCV(4.1.0) /io/opencv/modules/imgproc/src/templmatch.cpp:1107: error: (-215:Assertion failed) (depth == CV_8U || depth == CV_32F) && type == _templ.type() && _img.dims() <= 2 in function 'matchTemplate'
      
      ----------------------------------------
      
      

      Hab ich ein falsches Bildformat? Ich gucke auch mal in den Code ob ich was erahnen kann...
      Danke noch Mal und beste Grüße, Ruebenschuss

      posted in Hardware
      R
      ruebenschuss
    • RE: Wasserzähler - Selfmade

      Hi,
      auch von mir noch Mal ein großes Danke und Hochachtung für die schöne Umsetzung! Ich hab schon seit Jahren eine OCR für die Ziffern im Einsatz und hatte es mir als Projekt für den Urlaub vorgenommen, die analogen Nadeln mit Tensorflow zu lernen. Beim Googeln hab ich Dein Projekt gefunden und das ist natürlich viel schöner!
      Blöderweise hatte ich es vor zwei Wochen angefangen, alles für nodejs installiert und als ich heute weiter machen wollte, ist es plötzlich in python ;-)) nee nee, viel besser, alles gut 🙂

      Das pip install requirements hat bei mir nicht funktioniert.
      Ich musste unter debian 10.0 / x86_64 das folgende machen, ich hoffe, es hilft jemandem :

      pip3 install requests Keras numpy Pillow opencv-python tensorflow --no-cache-dir
      

      Ich hab die config.ini angepasst und kann den Server starten. Leider bekomme ich eine Fehlermeldung, mit der ich nicht weiter komme:

      root@dasding:~/water-meter-system-complete/code# python3 wasseruhr.py
      Using TensorFlow backend.
      /usr/local/lib/python3.7/dist-packages/tensorflow/python/framework/dtypes.py:516: FutureWarning: Passing (type, 1) or '1type' as a synonym of type is deprecated; in a future version of numpy, it will be understood as (type, (1,)) / '(1,)type'.
        _np_qint8 = np.dtype([("qint8", np.int8, 1)])
      /usr/local/lib/python3.7/dist-packages/tensorflow/python/framework/dtypes.py:517: FutureWarning: Passing (type, 1) or '1type' as a synonym of type is deprecated; in a future version of numpy, it will be understood as (type, (1,)) / '(1,)type'.
        _np_quint8 = np.dtype([("quint8", np.uint8, 1)])
      /usr/local/lib/python3.7/dist-packages/tensorflow/python/framework/dtypes.py:518: FutureWarning: Passing (type, 1) or '1type' as a synonym of type is deprecated; in a future version of numpy, it will be understood as (type, (1,)) / '(1,)type'.
        _np_qint16 = np.dtype([("qint16", np.int16, 1)])
      /usr/local/lib/python3.7/dist-packages/tensorflow/python/framework/dtypes.py:519: FutureWarning: Passing (type, 1) or '1type' as a synonym of type is deprecated; in a future version of numpy, it will be understood as (type, (1,)) / '(1,)type'.
        _np_quint16 = np.dtype([("quint16", np.uint16, 1)])
      /usr/local/lib/python3.7/dist-packages/tensorflow/python/framework/dtypes.py:520: FutureWarning: Passing (type, 1) or '1type' as a synonym of type is deprecated; in a future version of numpy, it will be understood as (type, (1,)) / '(1,)type'.
        _np_qint32 = np.dtype([("qint32", np.int32, 1)])
      /usr/local/lib/python3.7/dist-packages/tensorflow/python/framework/dtypes.py:525: FutureWarning: Passing (type, 1) or '1type' as a synonym of type is deprecated; in a future version of numpy, it will be understood as (type, (1,)) / '(1,)type'.
        np_resource = np.dtype([("resource", np.ubyte, 1)])
      /usr/local/lib/python3.7/dist-packages/tensorboard/compat/tensorflow_stub/dtypes.py:541: FutureWarning: Passing (type, 1) or '1type' as a synonym of type is deprecated; in a future version of numpy, it will be understood as (type, (1,)) / '(1,)type'.
        _np_qint8 = np.dtype([("qint8", np.int8, 1)])
      /usr/local/lib/python3.7/dist-packages/tensorboard/compat/tensorflow_stub/dtypes.py:542: FutureWarning: Passing (type, 1) or '1type' as a synonym of type is deprecated; in a future version of numpy, it will be understood as (type, (1,)) / '(1,)type'.
        _np_quint8 = np.dtype([("quint8", np.uint8, 1)])
      /usr/local/lib/python3.7/dist-packages/tensorboard/compat/tensorflow_stub/dtypes.py:543: FutureWarning: Passing (type, 1) or '1type' as a synonym of type is deprecated; in a future version of numpy, it will be understood as (type, (1,)) / '(1,)type'.
        _np_qint16 = np.dtype([("qint16", np.int16, 1)])
      /usr/local/lib/python3.7/dist-packages/tensorboard/compat/tensorflow_stub/dtypes.py:544: FutureWarning: Passing (type, 1) or '1type' as a synonym of type is deprecated; in a future version of numpy, it will be understood as (type, (1,)) / '(1,)type'.
        _np_quint16 = np.dtype([("quint16", np.uint16, 1)])
      /usr/local/lib/python3.7/dist-packages/tensorboard/compat/tensorflow_stub/dtypes.py:545: FutureWarning: Passing (type, 1) or '1type' as a synonym of type is deprecated; in a future version of numpy, it will be understood as (type, (1,)) / '(1,)type'.
        _np_qint32 = np.dtype([("qint32", np.int32, 1)])
      /usr/local/lib/python3.7/dist-packages/tensorboard/compat/tensorflow_stub/dtypes.py:550: FutureWarning: Passing (type, 1) or '1type' as a synonym of type is deprecated; in a future version of numpy, it will be understood as (type, (1,)) / '(1,)type'.
        np_resource = np.dtype([("resource", np.ubyte, 1)])
      Start Init Zaehlerstand
      WARNING:tensorflow:From /usr/local/lib/python3.7/dist-packages/tensorflow/python/ops/init_ops.py:97: calling Zeros.__init__ (from tensorflow.python.ops.init_ops) with dtype is deprecated and will be removed in a future version.
      Instructions for updating:
      Call initializer instance with the dtype argument instead of passing it to the constructor
      WARNING:tensorflow:From /usr/local/lib/python3.7/dist-packages/tensorflow/python/ops/init_ops.py:97: calling Ones.__init__ (from tensorflow.python.ops.init_ops) with dtype is deprecated and will be removed in a future version.
      Instructions for updating:
      Call initializer instance with the dtype argument instead of passing it to the constructor
      WARNING:tensorflow:From /usr/local/lib/python3.7/dist-packages/tensorflow/python/ops/init_ops.py:97: calling GlorotUniform.__init__ (from tensorflow.python.ops.init_ops) with dtype is deprecated and will be removed in a future version.
      Instructions for updating:
      Call initializer instance with the dtype argument instead of passing it to the constructor
      WARNING:tensorflow:From /usr/local/lib/python3.7/dist-packages/tensorflow/python/ops/init_ops.py:1251: calling VarianceScaling.__init__ (from tensorflow.python.ops.init_ops) with dtype is deprecated and will be removed in a future version.
      Instructions for updating:
      Call initializer instance with the dtype argument instead of passing it to the constructor
      2019-09-02 16:36:45.093960: I tensorflow/core/platform/cpu_feature_guard.cc:142] Your CPU supports instructions that this TensorFlow binary was not compiled to use: AVX2 FMA
      2019-09-02 16:36:45.116365: I tensorflow/core/platform/profile_utils/cpu_utils.cc:94] CPU Frequency: 1992000000 Hz
      2019-09-02 16:36:45.116783: I tensorflow/compiler/xla/service/service.cc:168] XLA service 0x43bb350 executing computations on platform Host. Devices:
      2019-09-02 16:36:45.116823: I tensorflow/compiler/xla/service/service.cc:175]   StreamExecutor device (0): <undefined>, <undefined>
      2019-09-02 16:36:45.136602: W tensorflow/compiler/jit/mark_for_compilation_pass.cc:1412] (One-time warning): Not using XLA:CPU for cluster because envvar TF_XLA_FLAGS=--tf_xla_cpu_global_jit was not set.  If you want XLA:CPU, either set that envvar, or use experimental_jit_scope to enable XLA:CPU.  To confirm that XLA is active, pass --vmodule=xla_compilation_cache=1 (as a proper command-line flag, not via TF_XLA_FLAGS) or set the envvar XLA_FLAGS=--xla_hlo_profile.
      Analog Model Init Done
      Digital Model Init Done
      serving at port 3000
      Picture Download done
      ----------------------------------------
      Exception happened during processing of request from ('10.0.0.71', 55985)
      Traceback (most recent call last):
        File "/usr/lib/python3.7/socketserver.py", line 316, in _handle_request_noblock
          self.process_request(request, client_address)
        File "/usr/lib/python3.7/socketserver.py", line 347, in process_request
          self.finish_request(request, client_address)
        File "/usr/lib/python3.7/socketserver.py", line 360, in finish_request
          self.RequestHandlerClass(request, client_address, self)
        File "/usr/lib/python3.7/socketserver.py", line 720, in __init__
          self.handle()
        File "/usr/lib/python3.7/http/server.py", line 426, in handle
          self.handle_one_request()
        File "/usr/lib/python3.7/http/server.py", line 414, in handle_one_request
          method()
        File "wasseruhr.py", line 30, in do_GET
          result = wasserzaehler.getZaehlerstand('./image_tmp/original.jpg', simple, preValue)
      NameError: name 'preValue' is not defined
      ----------------------------------------
      

      Kann jemand damit was anfangen und mir weiterhelfen? Der Server bleibt weiter am Leben und nimmt neue requests an. Die Fehlermeldung ist immer die gleiche.

      Vielen Dank für alle Hinweise und schöne Grüße,
      Ruebenschuss

      posted in Hardware
      R
      ruebenschuss
    Community
    Impressum | Datenschutz-Bestimmungen | Nutzungsbedingungen
    The ioBroker Community 2014-2023
    logo