the digital form of the points and the preview line graph (like above) will be stored automatically.
set a few parameters args
in run_allimgs.m
, also some de_noise related in the head of imgPlot2digital.m
.
There're two modes of removing the grid lines. By setting the formal parameter linemover
of the function imgPlot2digital()
, results are shown in above.
- The
scan
mode is done by setting thestep_x
andstep_y
vars, so when the grid line is covered by the plot line, it'll remove the plot line while removing the grid line. - The
imclose
mode is a digital image processing skill, when the plot line is bolder than the grid line, after binarizing the image, the black pixel size in the gird line is smaller than its in the plot line, so by setting the structuring element size we can remove the small black pixels, aka the grid line. - Empty char [] stands DO NOT apply grid lines removing algorithm.
- convert the image to gray, then binary.
- read the "black" pixels and convert them from the image coordinate system to the "coordinate"(the axis in the image) coordinate system.
- flip the coordinate system, bc matlab use
-y
in image coordinate system. - drop some points (like remove the grid lines in axis, see in function
reduceLines
,reduce_xy
andde_noiser
). - make x-y pairs unique. now we have a perfect line plot~
- do an interpret from the points we have above to obtain the points at x-axis u set.
- find the first derivative of the points above and get rid of the values bigger than a threshold (set the formal parameter of function
final_plot_filter()
) - smooth filter the points above using
mean filter
. - DONE!
simply run run_allimgs.m
and wait for the magic happens.
If u find this repo helps, a star will be the best support.