CPC H04N 19/117 (2014.11) [H04N 19/124 (2014.11)] | 8 Claims |
1. A method for vertically filtering an image, comprising:
caching a preset number of rows of image data and reading a to-be-read row of the image data, wherein the to-be-read row is a first row, not cached, in the image data;
calling a filter to vertically filter the preset number of rows of the image data and the to-be-read row of the image data to obtain first filtered data, wherein the step of calling the filter to vertically filter the preset number of rows of the image data and the to-be-read row of the image data to obtain the first filtered data, comprises:
acquiring a filter order and determining a number of prepositive rows and a number of postpositive rows in a to-be-filtered row of the image data according to the filter order;
generating prepositive rows of the image data according to the preset number of rows of cached image data, and determining postpositive rows of the image data according to the preset number of rows of the cached image data and the to-be-read row of the image data; and
calling the filter to vertically filter the prepositive rows and the postpositive rows of the image data to obtain filtered data in the to-be-filtered row of the image data as the first filtered data;
updating the image data according to the first filtered data, and judging whether the to-be-read row is a last row of the image data;
in response to the to-be-read row not being the last row of the image data, updating the to-be-read row to a next row of the to-be-read row, and returning to execute the step of caching the preset number of rows of the image data and reading the to-be-read row of the image data; and
in response to the to-be-read row being the last row of the image data, calling the filter to vertically filter the preset number of rows of the image data and the to-be-read row of the image data to obtain second filtered data, and updating the image data according to the second filtered data to obtain vertically filtered image data.
|