I'm using this code to convert a XLD to a region:
gen_region_contour_xld (ConnectedDirtRegionsXLDWorld,RegionWorld,'filled')
the XLD is like this:
and the resulting region looks like this:
If we overlap them, we can see that there are some differences, in particular the one marked with the arrow:
I understand that float values are converted to its nearest integer, so on average I would expect some to be rounded up, and some down and the area to be roughly the same. I cannot understand the differences in this case, since it looks that the values have all been rounded up..
I also tried by using set_system('neighborhood',4)
, it got a little bit better, but not really much. Also this causes a whole load of problem in the rest of the code, so I have set it back to 8 as it was before.
How can this conversion be made more precisely?
please have a look at the following image.
Here you can see the real dimension of a pixel (the red square).
So space, where you have drawn the arrow, has 1-pixel width!