[Little experience] Solve the gray edge of the vector diagram of the ChArUco calibration board generated by using python

background

Refer to github's open source svg generation code, the white squares in the running picture have gray edges, changing the lower edge parameters is useless, so I have to search for the cause and solution

insert image description here

reference

  1. stackoverflow
  2. github source code

solution

The reason for finding this gray edge is that when the pixels cannot be completely aligned in integers, there will be anti-aliasing problems in the overlapping parts of the two patterns, and such a black edge will appear when the edges overlap. The solution is to try a few more The option of edge configuration, I finally chose to change it like this:

self.drawing = svgwrite.Drawing(path,
                                size=(width*mm, height*mm),
                                profile='full', shape_rendering="crispEdges")

In this way, the image that ran out has no gray edges, and the zoom-in is also very fine.
insert image description here

Supongo que te gusta

Origin blog.csdn.net/weixin_42492254/article/details/128249813
Recomendado
Clasificación