Hi, I am trying to test your program to use it to read analog electricity meter numbers so I know how much electricity I am consuming daily and how much I am producing with solar panels. I intend to use an Android phone to take a photo, upload it somewhere (probably on the computer running watermeter) and once processing is working, integrate it into Home Assistant.
However I immediately run into a problem with processing the image. I took a photo with Samsung Galaxy S24 (tried both landscape and potrait modes) and when watermeter is processing the photo, the coordinates and width/height are inverted. It seems the coordinates are being read from right side of the photo instead of the left.
For example, if I use width of 200 and height of 1000 for cropping, it will actually crop 1000 in width and 200 in height. If I use start/end coordinates for the cropping, they are reversed and X seems to be counting from the right and not from left; i.e. if I use start for x=200 and y=1000 it will actually start at x=1000 (but counting 1000 pixels from right) and y=200.
Same happens with digits.
Now with your example image it works correctly. Obviously there is something going on with the image from the phone. Do you have an idea of how to fix this problem?
Hi, I am trying to test your program to use it to read analog electricity meter numbers so I know how much electricity I am consuming daily and how much I am producing with solar panels. I intend to use an Android phone to take a photo, upload it somewhere (probably on the computer running watermeter) and once processing is working, integrate it into Home Assistant.
However I immediately run into a problem with processing the image. I took a photo with Samsung Galaxy S24 (tried both landscape and potrait modes) and when watermeter is processing the photo, the coordinates and width/height are inverted. It seems the coordinates are being read from right side of the photo instead of the left.
For example, if I use width of 200 and height of 1000 for cropping, it will actually crop 1000 in width and 200 in height. If I use start/end coordinates for the cropping, they are reversed and X seems to be counting from the right and not from left; i.e. if I use start for x=200 and y=1000 it will actually start at x=1000 (but counting 1000 pixels from right) and y=200.
Same happens with digits.
Now with your example image it works correctly. Obviously there is something going on with the image from the phone. Do you have an idea of how to fix this problem?