I have few codes that count number of pixels in different classes in GEE, and then calc the precentage of them using the total number of pixels that were count. The code seems to work, but when I check the results, I find out that it never count all the pixels. for example, here is the results of raster that has only 3 possible class values- high, mean and low.
If you sum all the count, you don't get to the total count numner (338+598+771 =1707, not 1789), and then ,also when I calc precentage I never get to 100%.
I believe it's result of the way that GEE works with polygon that on the border (e.g takes only "whole" pixels), but is there any way to change it and to make it count all of the pixels?
My end goal: when I calculate precentage, to get to 100%.
Edit: link to sample code which has the same problem: https://code.earthengine.google.com/761d16596d243e9bc0d053fa84fa2c66