Home > Back-end >  Drew a straight line on the paper (if even thickness) and the width of the line a few pixels, please
Drew a straight line on the paper (if even thickness) and the width of the line a few pixels, please

Time:09-20

Please give a train of thought for line width pixels thank you

CodePudding user response:

1. Take pictures, to photos, again into 256 gray image;

CodePudding user response:

2. Iterate over all pixels, calculate the average gray level, through again, looking for less than the average gray level of straight line;
3. At this point, according to the direction of eight (or more) to search for the border, get eight line width, the smallest line width is,
  • Related