CN115988186A - Image processing system and method - Google Patents
Image processing system and method Download PDFInfo
- Publication number
- CN115988186A CN115988186A CN202310268778.XA CN202310268778A CN115988186A CN 115988186 A CN115988186 A CN 115988186A CN 202310268778 A CN202310268778 A CN 202310268778A CN 115988186 A CN115988186 A CN 115988186A
- Authority
- CN
- China
- Prior art keywords
- color
- grids
- grid
- colors
- blank
- Prior art date
- Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
- Granted
Links
Images
Abstract
The invention provides an image processing system and a method, comprising a color palette module, a positioning module, a distance measuring module, a mapping module, a grid size setting module and a color filling module, wherein the color module establishes a color gradient color palette containing 16777216 color blocks based on RGB color standard; the positioning module establishes a coordinate system in the image to position the color area; the distance measurement module calculates the maximum linear distance between pixel elements of the existing colors in the image; the mapping module maps the colors in the ranging module in the color plate; the grid size setting module divides all areas of the image into grids; the color filling module fills colors into the grid cells, firstly fills colors into 100% of the existing color grids which are not completely filled, secondly takes the grids at the original points, the grids close to the X axis and the grids close to the Y axis as initial grids, fills the blank grids into gradient colors at 45 degrees on the upper right, and finally presents a smooth color transition effect in the 45-degree direction of the image.
Description
Technical Field
The invention relates to an image processing system and method.
Background
In the image processing work, blank areas between different color ranges in an image need to be filled into gradually changed colors, and a smooth color transition effect is presented in a certain direction.
Disclosure of Invention
Therefore, the present invention provides an image processing system and method for supplementing gradually changing colors in blank areas between different color ranges in an image, and presenting smooth color transition effect in the 45 degree direction at the upper right.
The technical scheme adopted by the invention is as follows: an image processing system:
the device comprises a color plate module, a positioning module, a distance measuring module, a mapping module, a grid size setting module and a color filling module.
The color plate module divides each primary color of red, green and blue into 256 levels of brightness based on RGB color standard, the brightness is respectively marked as 0, 1, 2, \8230, 255, three primary colors of different levels of brightness are superposed and combined into a color plate of 16777216 colors, the colors in the color plate are sequentially arranged according to the sequence of red, orange, yellow, green, cyan, blue and purple from left to right, the brightness in the color plate is sequentially arranged according to 0, 1, 2, \8230and255 from bottom to top, each color block in the color plate is square, and the width of the color block is S.
The positioning module establishes a plane rectangular coordinate system by taking the lower left corner of the image as an origin, the horizontal right side is an X axis, the vertical upward side is a Y axis, the pixel element is taken as a unit, the coordinate positions of the pixel elements with colors in the image are marked, and the coordinate positions are sequentially marked as (X) 1 ,Y 1 )、(X 2 ,Y 2 )、…、(X n ,Y n ) For example, the coordinates of the pixel element in the 100 th column from left to right and the 200 th row from bottom to top are (100, 200).
The distance measurement module calculates the maximum linear distance L between the pixel elements of the existing colors in the image, and the calculation steps are as follows:
step 1, calculating the distance R between the pixel element of the existing color and the origin, and calculating the distance R according to the R 2 =X n 2 +Y n 2 Solving R;
step 2, screening the maximum value R max Recording the position (X) of the pixel element m ,Y m );
Step 3, screening the minimum value R min Recording the position (X) of the pixel element i ,Y i );
Step 4, according to L 2 =(X m -X i ) 2 +(Y m -Y i ) 2 The distance L is calculated.
The mapping module is positioned in the color palette with (X) m ,Y m ) Color blocks of the same color are positioned, and then the position is determined to be (X) i ,Y i ) And (5) calculating the straight-line distance H between the centers of the color blocks at the two positions in the color plate.
The grid size setting module divides all areas of the image into grids, the grid cells are square, the width D = L/H S of the grid cells, the unit of the width D is millimeter, and the numerical value is accurate to two digits after decimal point.
The color filling module is used for supplementing colors to the grid cells, and the specific steps are as follows:
step 1, supplementing and filling 100% of the existing color grids which are not completely filled with the colors, wherein the supplemented colors are consistent with the adjacent colors of the blank areas in the grids.
Step 2, taking the grid at the origin as an initial grid, searching a blank grid between the existing color grids in the upper right 45-degree direction, recording the colors A and B of the existing color grids at the two ends of the blank grid, and recording the number M of the blank grids between the color A grid and the color B grid; calculating the number N of color blocks between the color block A and the color block B in the color plate; the blank grid between the color a grid and the color B grid is color filled in the following way:
(1) When M/N =1, sequentially filling the colors of color blocks between a color A color block and a color B color block in the color plate into blank grids between a color A grid and a color B grid according to the direction from A to B;
(2) When M/N is more than 1, the colors of the color blocks between the color A color block and the color B color block in the color plate are sequentially filled into the blank grids between the color A grid and the color B grid according to the direction from A to B, each color block color supplements (M/N) blank grids, when the M/N is a non-integer, the third position after the decimal point adds 1 to the second position after the decimal point as long as the numerical value exists, and the numerical value is accurate to the two positions after the decimal point until the blank grids are completely filled;
(3) When M/N is less than 1, the colors of the color blocks between the color A color block and the color B color block in the color plate are sequentially filled into the blank grids between the color A grid and the color B grid according to the direction from A to B, each blank grid is filled with (N/M) colors, when (N/M) is a non-integer, the third position after the decimal point is reduced by 1 at the second position after the decimal point as long as the numerical value exists, and the numerical value is accurate to the two positions after the decimal point until the blank grids are completely filled;
(4) When one end of the blank grid has no existing color grid, the color of the existing color grid at the end is white by default.
And 3, continuously searching for blank grids among other existing color grids along the 45-degree direction at the upper right, wherein the color filling mode is the same as that in the step 2 until all the blank grids are completely filled with color.
And 4, processing grids close to the X axis one by one along the positive direction of the X axis, setting the grids as initial grids in sequence, filling blank grids in the upper right 45-degree direction, and filling the colors in the same way as the step 2 until all the blank grids are filled with the colors.
And 5, processing grids close to the Y axis one by one along the positive direction of the Y axis, setting the grids as initial grids in sequence, filling blank grids in the upper right 45-degree direction, and filling the colors in the same way as the step 2 until all the blank grids are filled with colors.
An image processing method comprises the following steps:
step 1, based on RGB color standard, dividing each primary color of red, green and blue into 256 levels of brightness, wherein the brightness is respectively marked as 0, 1, 2, \ 8230, 255, three primary colors with different levels of brightness are superposed and combined into a 16777216 color plate, the colors in the color plate are sequentially arranged from left to right according to the sequence of red, orange, yellow, green, cyan, blue and purple, the colors in the color plate are sequentially arranged from bottom to top according to the brightness of 0, 1, 2, \ 8230, 255, each color block in the color plate is square, and the width of each color block is S.
Step 2, with the lower left corner of the image as an origin, establishing a plane rectangular coordinate system, with the horizontal right direction as an X axis and the vertical upward direction as a Y axis, marking the coordinate positions of the pixel elements with colors in the image by taking the pixel elements as units, and sequentially marking the coordinate positions as (X) 1 ,Y 1 )、(X 2 ,Y 2 )、…、(X n ,Y n ) E.g. in the left to right 100 th column, from bottom to topThe pixel element of the 200 th row has coordinates of (100, 200).
Step 3, calculating the maximum straight line distance L between the pixel elements of the existing colors in the image, wherein the specific flow is as follows:
(1) Calculating the distance R between the pixel element of the existing color and the origin, and calculating the distance R according to R 2 =X n 2 +Y n 2 Solving R;
(2) Screening for the maximum value R max Recording the position (X) of the pixel element m ,Y m );
(3) Screening for the minimum R min Recording the position (X) of the pixel element i ,Y i );
(4) According to L 2 =(X m -X i ) 2 +(Y m -Y i ) 2 The distance L is calculated.
Step 4, positioning and (X) in the color plate m ,Y m ) Color blocks of the same color are positioned, and then the position is determined to be (X) i ,Y i ) And (5) calculating the straight-line distance H between the centers of the color blocks at the same position with the same color.
And 5, dividing all areas of the image into grids, wherein the grid cells are square, the width D = L/H S of the grid cells, the unit of the width D is millimeter, and the numerical value is accurate to two digits after decimal point.
And 6, supplementing colors into the grid cells, wherein the specific flow is as follows:
(1) And (3) supplementing and filling the colors of the existing color grids which are not completely filled to 100%, wherein the supplemented colors are consistent with the colors adjacent to the blank areas in the grids.
(2) Taking a grid at an original point as an initial grid, searching a blank grid between the existing color grids in the upper right 45-degree direction, recording the colors A and B of the existing color grids at two ends of the blank grid, and recording the number M of the blank grids between the color A grid and the color B grid; calculating the number N of color blocks between a color block A and a color block B in the color plate; the blank grid between the color a grid and the color B grid is color filled in the following way:
(a) When M/N =1, sequentially filling the colors of color blocks between a color A color block and a color B color block in the color plate into blank grids between a color A grid and a color B grid according to the direction from A to B;
(b) When M/N is more than 1, the colors of the color blocks between the color A color block and the color B color block in the color plate are sequentially filled into the blank grids between the color A grid and the color B grid according to the direction from A to B, each color block color supplements (M/N) blank grids, when the M/N is a non-integer, the third position after the decimal point adds 1 to the second position after the decimal point as long as the numerical value exists, and the numerical value is accurate to the two positions after the decimal point until the blank grids are completely filled;
(c) When M/N is less than 1, the colors of the color blocks between the color A color block and the color B color block in the color plate are sequentially filled into blank grids between the color A grid and the color B grid according to the direction from A to B, each blank grid is filled with (N/M) colors, when (N/M) is a non-integer, the third position after the decimal point is reduced by 1 after the decimal point as long as a numerical value exists, and the numerical value is accurate to the two positions after the decimal point until the blank grids are completely filled;
(d) When one end of the blank grid has no existing color grid, the color of the existing color grid at the end is white by default.
(3) And (4) continuously searching for blank grids among other existing color grids along the upper right 45-degree direction, wherein the color filling mode is the same as the item (2) in the step 6 until all the blank grids are filled with colors.
(4) And (3) processing grids next to the X axis one by one along the positive direction of the X axis, setting the grids as initial grids in sequence, filling blank grids in the upper right 45-degree direction, and filling the colors in the same way as the item (2) in the step 6 until all the blank grids are filled with colors.
(5) And (3) processing grids next to the Y axis one by one along the positive direction of the Y axis, setting the grids as initial grids in sequence, filling blank grids in the upper right 45-degree direction, and filling the colors in the same way as the item (2) in the step 6 until all the blank grids are filled with colors.
Further, the above method and principle are also applicable to color smooth transition processing in other directions.
The image processing system and method of the invention have the following advantages:
(1) The RGB color standard covers all color categories visible to naked eyes, the color categories are combined into a color plate for reference contrast according to a gradual change rule, a reasonable color gradual change reference basis is provided for filling colors of blank areas among different color ranges in an image, and the method is reliable;
(2) Constructing a plane rectangular coordinate system in the image, calculating the linear distance between the farthest colors, and increasing the fineness of the grid to the maximum extent and the smoothness of subsequent color gradual change through the mapping of the same color in the color plate, wherein the method is innovative;
(3) And according to the 45-degree direction on the upper right, the mapped gradient colors in the color palette are supplemented into the blank grids in the image, and the scaling of color transformation is carried out at the same time, so that the smooth transition of the colors in the image is realized, the characteristics of 45-degree visual difference of a human body are met, and the innovation is strong.
Additional features and advantages of the invention will be set forth in the description which follows, or may be learned by practice of the invention.
Drawings
The drawings are only for purposes of illustrating particular embodiments and are not to be construed as limiting the invention, wherein like reference numerals are used to designate like parts throughout.
Fig. 1 is a schematic diagram of blank grids between grids at an origin as a starting grid and existing color grids at 45 degrees from the upper right.
FIG. 2 is a schematic diagram of a blank grid between the grid of the third column next to the X-axis and the existing color grid at the upper right 45 degrees.
FIG. 3 is a schematic diagram of a blank grid between the third row of grids next to the Y-axis and the existing color grid at the upper right 45 degrees.
Fig. 4 is a flow chart of a method of the present invention.
Reference numbers in the figures: q1, taking the grid at the original point as an initial grid, and forming a blank grid among the color grids in the 45-degree direction at the upper right; q2, a third column of grids close to the X axis is used as a starting grid, and blank grids among the color grids are arranged in the 45-degree direction at the upper right; q3-is the blank grid between the color grids starting with the grid in the third row next to the Y-axis and existing in the 45 degree upper right direction.
Detailed Description
An image processing system and method according to the present invention will be described in further detail with reference to the accompanying drawings and embodiments.
The technical scheme adopted by the invention is that the image processing system comprises:
the device comprises a color plate module, a positioning module, a distance measuring module, a mapping module, a grid size setting module and a color filling module.
The color plate module divides each primary color of red, green and blue into 256 levels of brightness based on RGB color standard, the brightness is respectively marked as 0, 1, 2, \ 8230, 255, three primary colors with different levels of brightness are superposed and combined into a color plate with 16777216 colors, the colors in the color plate are sequentially arranged from left to right according to the sequence of red, orange, yellow, green, cyan, blue and purple, the colors in the color plate are sequentially arranged from bottom to top according to the brightness of 0, 1, 2, \\ 8230, 255, each color block in the color plate is square, and the width of the color block is S.
The positioning module establishes a plane rectangular coordinate system by taking the lower left corner of the image as an origin, the horizontal right side is an X axis, the vertical upward side is a Y axis, the pixel element is taken as a unit, the coordinate positions of the pixel elements with colors in the image are marked, and the coordinate positions are sequentially marked as (X) 1 ,Y 1 )、(X 2 ,Y 2 )、…、(X n ,Y n ) For example, the coordinates of the pixel element in the 100 th column from left to right and the 200 th row from bottom to top are (100, 200).
The distance measurement module calculates the maximum linear distance L between the pixel elements of the existing colors in the image, and the calculation steps are as follows:
step 1, calculating the distance R between the pixel element of the existing color and the origin, and calculating the distance R according to the R 2 =X n 2 +Y n 2 Solving R;
step 2, screening the maximum value R max Recording the position (X) of the pixel element m ,Y m );
Step 3, screening the minimum value R min Recording the position (X) of the pixel element i ,Y i );
Step 4, according to L 2 =(X m -X i ) 2 +(Y m -Y i ) 2 The distance L is calculated.
The mapping module is positioned in the color palette with (X) m ,Y m ) Color blocks of the same color are positioned, and then the position is determined to be (X) i ,Y i ) And (5) calculating the straight-line distance H between the centers of the color blocks at the two positions in the color plate.
The grid size setting module divides all areas of the image into grids, the grid cells are square, the width D = L/H S of the grid cells, the unit of the width D is millimeter, and the numerical value is accurate to two digits after decimal point.
The color filling module is used for supplementing colors to the grid cells, and the specific steps are as follows:
step 1, supplementing and filling 100% of the existing color grids which are not completely filled with the colors, wherein the supplemented colors are consistent with the adjacent colors of the blank areas in the grids.
Step 2, as shown in fig. 1, using the grid at the original point as an initial grid, searching a blank grid between the existing color grids in the upper right 45-degree direction, recording the colors A and B of the existing color grids at the two ends of the blank grid, and recording the number M of the blank grids between the color A grid and the color B grid; calculating the number N of color blocks between the color block A and the color block B in the color plate; the blank grid between the color a grid and the color B grid is color filled in the following way:
(1) When M/N =1, sequentially filling the colors of color blocks between a color A color block and a color B color block in the color plate into blank grids between a color A grid and a color B grid according to the direction from A to B;
(2) When M/N is more than 1, the colors of the color blocks between the color A color block and the color B color block in the color plate are sequentially filled into the blank grids between the color A grid and the color B grid according to the direction from A to B, each color block color supplements (M/N) blank grids, when the M/N is a non-integer, the third position after the decimal point adds 1 to the second position after the decimal point as long as the numerical value exists, and the numerical value is accurate to the two positions after the decimal point until the blank grids are completely filled;
(3) When M/N is less than 1, the colors of the color blocks between the color A color block and the color B color block in the color plate are sequentially filled into blank grids between the color A grid and the color B grid according to the direction from A to B, each blank grid is filled with (N/M) colors, when (N/M) is a non-integer, the third position after the decimal point is reduced by 1 after the decimal point as long as a numerical value exists, and the numerical value is accurate to the two positions after the decimal point until the blank grids are completely filled;
(4) When one end of the blank grid has no existing color grid, the color of the existing color grid at the end is white by default.
And 3, continuously searching for blank grids among other existing color grids along the 45-degree direction at the upper right, wherein the color filling mode is the same as that in the step 2 until all the blank grids are completely filled with color.
And 4, as shown in fig. 2, processing the grids close to the X axis one by one along the positive direction of the X axis, setting the grids as initial grids in sequence, filling blank grids in the upper right 45-degree direction, and filling the colors in the same manner as the step 2 until all the blank grids are filled with colors.
And 5, as shown in fig. 3, processing the grids close to the Y axis one by one along the positive direction of the Y axis, setting the grids as initial grids in sequence, filling blank grids in the upper right 45-degree direction, and filling the colors in the same way as the step 2 until all the blank grids are filled with colors.
As shown in fig. 4, an image processing method:
step 1, based on RGB color standard, dividing each primary color of red, green and blue into 256 levels of brightness, wherein the brightness is respectively marked as 0, 1, 2, \ 8230, 255, three primary colors with different levels of brightness are superposed and combined into a 16777216 color plate, the colors in the color plate are sequentially arranged from left to right according to the sequence of red, orange, yellow, green, cyan, blue and purple, the colors in the color plate are sequentially arranged from bottom to top according to the brightness of 0, 1, 2, \ 8230, 255, each color block in the color plate is square, and the width of each color block is S.
Step 2, establishing the original point of the lower left corner of the imageA plane rectangular coordinate system with horizontal right as X axis and vertical upward as Y axis, marking the coordinate position of the pixel element with color in the image by using the pixel element as unit, and sequentially marking as (X) 1 ,Y 1 )、(X 2 ,Y 2 )、…、(X n ,Y n ) For example, the coordinates of the pixel element in the 100 th column from left to right and the 200 th row from bottom to top are (100, 200).
Step 3, calculating the maximum straight line distance L between the pixel elements of the existing colors in the image, wherein the specific flow is as follows:
(1) Calculating the distance R between the pixel element of the existing color and the origin, and calculating the distance R according to R 2 =X n 2 +Y n 2 Solving R;
(2) Screening for the maximum value R max Recording the position (X) of the pixel element m ,Y m );
(3) Screening for the minimum R min Recording the position (X) of the pixel element i ,Y i );
(4) According to L 2 =(X m -X i ) 2 +(Y m -Y i ) 2 The distance L is calculated.
Step 4, positioning and (X) in the color plate m ,Y m ) Color blocks of the same color are positioned, and then the position is determined to be (X) i ,Y i ) And (5) calculating the straight-line distance H between the centers of the color blocks at the two positions in the color plate.
And 5, dividing all areas of the image into grids, wherein the grid cells are square, the width D = L/H S of the grid cells, the unit of the width D is millimeter, and the numerical value is accurate to two digits after decimal point.
And 6, supplementing colors into the grid cells, wherein the specific flow is as follows:
(1) And (3) supplementing and color-filling 100% of the existing color grids which are not completely color-filled to 100%, wherein the supplemented colors are consistent with the adjacent colors of the blank areas in the grids.
(2) As shown in fig. 1, a grid at an origin is used as an initial grid, a blank grid between existing color grids is searched in the upper right 45-degree direction, colors a and B of the existing color grids at two ends of the blank grid are recorded, and the number M of the blank grids between the color a grid and the color B grid is recorded; calculating the number N of color blocks between the color block A and the color block B in the color plate; the blank grid between the color a grid and the color B grid is color filled in the following way:
(a) When M/N =1, sequentially filling the colors of the color blocks between the color A color block and the color B color block in the color plate into blank grids between a color A grid and a color B grid according to the direction from A to B;
(b) When M/N is more than 1, the colors of the color blocks between the color A color block and the color B color block in the color plate are sequentially filled into the blank grids between the color A grid and the color B grid according to the direction from A to B, each color block color supplements (M/N) blank grids, when the M/N is a non-integer, the third position after the decimal point adds 1 to the second position after the decimal point as long as the numerical value exists, and the numerical value is accurate to the two positions after the decimal point until the blank grids are completely filled;
(c) When M/N is less than 1, the colors of the color blocks between the color A color block and the color B color block in the color plate are sequentially filled into blank grids between the color A grid and the color B grid according to the direction from A to B, each blank grid is filled with (N/M) colors, when (N/M) is a non-integer, the third position after the decimal point is reduced by 1 after the decimal point as long as a numerical value exists, and the numerical value is accurate to the two positions after the decimal point until the blank grids are completely filled;
(d) When one end of the blank grid has no existing color grid, the color of the existing color grid at the end is white by default.
(3) And (4) continuously searching for blank grids among other existing color grids along the upper right 45-degree direction, wherein the color filling mode is the same as the item (2) in the step 6 until all the blank grids are filled with colors.
(4) As shown in fig. 2, the grids next to the X axis are processed one by one along the positive direction of the X axis, and are set as the starting grid in sequence, and the blank grids in the 45 degree direction at the upper right are filled, and the color filling manner is the same as that in item (2) in step 6, until all the blank grids are filled with color.
(5) As shown in fig. 3, the grids next to the Y axis are processed one by one along the Y axis forward direction, and are sequentially set as the starting grid, and the blank grids in the 45 degree direction at the upper right are filled, and the color filling manner is the same as the item (2) in the step 6, until all the blank grids are filled with color.
The above-mentioned processing of 45-degree direction of the upper right of the image into the color smooth transition effect, and the method and the principle are also applicable to the color smooth transition processing in other directions.
The above description is only for the preferred embodiment of the present invention, but the scope of the present invention is not limited thereto, and any changes or substitutions that can be easily conceived by those skilled in the art within the technical scope of the present invention are included in the scope of the present invention.
Claims (2)
1. An image processing system, comprising:
the device comprises a color plate module, a positioning module, a distance measuring module, a mapping module, a grid size setting module and a color filling module;
the color plate module divides each primary color of red, green and blue into 256 levels of brightness based on RGB color standard, the brightness is respectively marked as 0, 1, 2, \ 8230, 255, three primary colors with different levels of brightness are superposed and combined into a color plate with 16777216 colors, the colors in the color plate are sequentially arranged from left to right according to the sequence of red, orange, yellow, green, cyan, blue and purple, the colors in the color plate are sequentially arranged from bottom to top according to the brightness of 0, 1, 2, \\ 8230, 255, each color block in the color plate is square, and the width of each color block is S;
the positioning module establishes a plane rectangular coordinate system by taking the lower left corner of the image as an original point, the horizontal right side is an X axis, the vertical upward side is a Y axis, the coordinate positions of the pixel elements with colors in the image are marked by taking the pixel elements as units, and the coordinate positions are sequentially marked as (X) 1 ,Y 1 )、(X 2 ,Y 2 )、…、(X n ,Y n );
The distance measurement module calculates the maximum linear distance L between pixel elements of existing colors in the image, and the calculation steps are as follows:
step 1, calculating the existing colorIs arranged to be spaced from the origin by a distance R, in accordance with R 2 =X n 2 +Y n 2 Solving R;
step 2, screening the maximum value R max Recording the position (X) of the pixel element m ,Y m );
Step 3, screening the minimum value R min Recording the position (X) of the pixel element i ,Y i );
Step 4, according to L 2 =(X m -X i ) 2 +(Y m -Y i ) 2 Calculating a distance L;
the mapping module is positioned in the color palette with (X) m ,Y m ) Color blocks of the same color are located, and then the position of the color block is located with (X) i ,Y i ) Calculating the straight-line distance H between the centers of the color blocks at the same position and the same color;
the grid size setting module divides all areas of the image into grids, the grid cells are square, the width D = L/H S of the grid cells, the unit of the width D is millimeter, and the numerical value is accurate to two digits after decimal point;
the color filling module is used for supplementing colors to the grid cells, and the specific steps are as follows:
step 1, supplementing and filling 100% of the existing color grids which are not completely filled with colors to 100%, wherein the supplemented colors are consistent with the adjacent colors of the blank areas in the grids;
step 2, taking the grid at the origin as an initial grid, searching a blank grid between the existing color grids in the upper right 45-degree direction, recording the colors A and B of the existing color grids at the two ends of the blank grid, and recording the number M of the blank grids between the color A grid and the color B grid; calculating the number N of color blocks between the color block A and the color block B in the color plate; the blank grid between the color a grid and the color B grid is color filled in the following way:
(1) When M/N =1, sequentially filling the colors of color blocks between a color A color block and a color B color block in the color plate into blank grids between a color A grid and a color B grid according to the direction from A to B;
(2) When M/N is more than 1, the colors of the color blocks between the color A color block and the color B color block in the color plate are sequentially filled into the blank grids between the color A grid and the color B grid according to the direction from A to B, each color block color supplements (M/N) blank grids, when the M/N is a non-integer, the third position after the decimal point adds 1 to the second position after the decimal point as long as the numerical value exists, and the numerical value is accurate to the two positions after the decimal point until the blank grids are completely filled;
(3) When M/N is less than 1, the colors of the color blocks between the color A color block and the color B color block in the color plate are sequentially filled into blank grids between the color A grid and the color B grid according to the direction from A to B, each blank grid is filled with (N/M) colors, when (N/M) is a non-integer, the third position after the decimal point is reduced by 1 after the decimal point as long as a numerical value exists, and the numerical value is accurate to the two positions after the decimal point until the blank grids are completely filled;
(4) When one end of the blank grid has no existing color grid, the default color of the existing color grid at the end is white;
step 3, continuously searching for blank grids among other existing color grids along the upper right 45-degree direction, wherein the color filling mode is the same as that in the step 2 until all the blank grids are completely filled with color;
step 4, processing grids close to the X axis one by one along the positive direction of the X axis, setting the grids as initial grids in sequence, filling blank grids in the upper right 45-degree direction, and filling the colors in the same way as the step 2 until all the blank grids are filled with colors;
and 5, processing grids close to the Y axis one by one along the positive direction of the Y axis, setting the grids as initial grids in sequence, filling blank grids in the upper right 45-degree direction, and filling the colors in the same way as the step 2 until all the blank grids are filled with colors.
2. An image processing method, comprising:
step 1, based on RGB color standard, dividing each primary color of red, green and blue into 256 levels of brightness, wherein the brightness is respectively marked as 0, 1, 2, \ 8230, 255, three primary colors with different levels of brightness are superposed and combined into a 16777216 color plate, the colors in the color plate are sequentially arranged from left to right according to the sequence of red, orange, yellow, green, cyan, blue and purple, the colors in the color plate are sequentially arranged from bottom to top according to the brightness of 0, 1, 2, \ 8230, 255, each color block in the color plate is square, and the width of each color block is S;
step 2, with the lower left corner of the image as an origin, establishing a plane rectangular coordinate system, with the horizontal right direction as an X axis and the vertical upward direction as a Y axis, marking the coordinate positions of the pixel elements with colors in the image by taking the pixel elements as units, and sequentially marking the coordinate positions as (X) 1 ,Y 1 )、(X 2 ,Y 2 )、…、(X n ,Y n );
Step 3, calculating the maximum linear distance L between the pixel elements of the existing colors in the image, wherein the specific process is as follows:
(1) Calculating the distance R between the pixel element of the existing color and the origin, and calculating the distance R according to R 2 =X n 2 +Y n 2 Solving R;
(2) Screening for the maximum value R max Recording the position (X) of the pixel element m ,Y m );
(3) Screening for the minimum R min Recording the position (X) of the pixel element i ,Y i );
(4) According to L 2 =(X m -X i ) 2 +(Y m -Y i ) 2 Calculating a distance L;
step 4, positioning and (X) in the color plate m ,Y m ) Color blocks of the same color are positioned, and then the position is determined to be (X) i ,Y i ) Calculating the straight line distance H between the centers of the two color blocks in the color plate;
step 5, dividing all areas of the image into grids, wherein the grid cells are square, the width D = L/H S of the grid cells, the unit of the width D is millimeter, and the numerical value is accurate to the two last decimal points;
and 6, supplementing colors into the grid cells, wherein the specific flow is as follows:
(1) Supplementing and filling 100% of the existing color grids which are not completely filled with the colors to 100%, wherein the supplemented colors are consistent with the adjacent colors of the blank areas in the grids;
(2) Taking a grid at an original point as an initial grid, searching a blank grid between the existing color grids in the upper right 45-degree direction, recording the colors A and B of the existing color grids at the two ends of the blank grid, and recording the number M of the blank grids between the color A grid and the color B grid; calculating the number N of color blocks between the color block A and the color block B in the color plate; the blank grid between the color a grid and the color B grid is color filled as follows:
(a) When M/N =1, sequentially filling the colors of color blocks between a color A color block and a color B color block in the color plate into blank grids between a color A grid and a color B grid according to the direction from A to B;
(b) When M/N is more than 1, the colors of the color blocks between the color A color block and the color B color block in the color plate are sequentially filled into the blank grids between the color A grid and the color B grid according to the direction from A to B, each color block color supplements (M/N) blank grids, when the M/N is a non-integer, the third position after the decimal point adds 1 to the second position after the decimal point as long as the numerical value exists, and the numerical value is accurate to the two positions after the decimal point until the blank grids are completely filled;
(c) When M/N is less than 1, the colors of the color blocks between the color A color block and the color B color block in the color plate are sequentially filled into blank grids between the color A grid and the color B grid according to the direction from A to B, each blank grid is filled with (N/M) colors, when (N/M) is a non-integer, the third position after the decimal point is reduced by 1 after the decimal point as long as a numerical value exists, and the numerical value is accurate to the two positions after the decimal point until the blank grids are completely filled;
(d) When one end of the blank grid has no existing color grid, the color of the existing color grid at the end is white by default;
(3) Continuously searching for blank grids among other existing color grids along the 45-degree direction at the upper right, wherein the color filling mode is the same as the item (2) in the step 6 until all the blank grids are completely filled with color;
(4) Processing grids close to the X axis one by one along the positive direction of the X axis, setting the grids as initial grids in sequence, filling blank grids in the upper right 45-degree direction, wherein the color filling mode is the same as the item (2) in the step 6 until all blank grids are filled with colors;
(5) And (3) processing grids next to the Y axis one by one along the positive direction of the Y axis, setting the grids as initial grids in sequence, filling blank grids in the upper right 45-degree direction, and filling the colors in the same way as the item (2) in the step 6 until all the blank grids are filled with colors.
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN202310268778.XA CN115988186B (en) | 2023-03-20 | 2023-03-20 | Image processing system and method |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN202310268778.XA CN115988186B (en) | 2023-03-20 | 2023-03-20 | Image processing system and method |
Publications (2)
Publication Number | Publication Date |
---|---|
CN115988186A true CN115988186A (en) | 2023-04-18 |
CN115988186B CN115988186B (en) | 2023-06-09 |
Family
ID=85961110
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
CN202310268778.XA Active CN115988186B (en) | 2023-03-20 | 2023-03-20 | Image processing system and method |
Country Status (1)
Country | Link |
---|---|
CN (1) | CN115988186B (en) |
Citations (9)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
JP2006248168A (en) * | 2005-03-14 | 2006-09-21 | Seiko Epson Corp | Color chart, color chart creating device, color chart creating method, and color chart creating program |
DE102006021442A1 (en) * | 2006-05-09 | 2007-11-15 | Thomas Baloui | Color point detecting or emitting and quadratic image grid generating or calculating method, involves aligning color grid and image grid with another color grid and image grid by rotation, shearing and parallel stretching of former grids |
US20080158246A1 (en) * | 2007-01-03 | 2008-07-03 | Tvia, Inc. | Digital color management method and system |
CN102937896A (en) * | 2012-11-05 | 2013-02-20 | 清华大学 | Method for dynamically presenting two-dimensional spatial data by using color mapping technology in scalable vector graphics (SVG) |
CN103440632A (en) * | 2013-09-04 | 2013-12-11 | 中测新图(北京)遥感技术有限责任公司 | Processing method for improving color fidelity of close-shot large-format images |
TW201401229A (en) * | 2012-06-28 | 2014-01-01 | Imec Taiwan Co | Imaging system and method |
US20190189081A1 (en) * | 2017-12-19 | 2019-06-20 | Seiko Epson Corporation | Color conversion table adjustment method |
CN112308773A (en) * | 2020-08-19 | 2021-02-02 | 贵州电网有限责任公司 | Unmanned aerial vehicle aerial image nondestructive amplification and splicing fusion method |
CN115157654A (en) * | 2022-07-28 | 2022-10-11 | 河北工业大学 | Surface color inward diffusion method of color 3D model |
-
2023
- 2023-03-20 CN CN202310268778.XA patent/CN115988186B/en active Active
Patent Citations (9)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
JP2006248168A (en) * | 2005-03-14 | 2006-09-21 | Seiko Epson Corp | Color chart, color chart creating device, color chart creating method, and color chart creating program |
DE102006021442A1 (en) * | 2006-05-09 | 2007-11-15 | Thomas Baloui | Color point detecting or emitting and quadratic image grid generating or calculating method, involves aligning color grid and image grid with another color grid and image grid by rotation, shearing and parallel stretching of former grids |
US20080158246A1 (en) * | 2007-01-03 | 2008-07-03 | Tvia, Inc. | Digital color management method and system |
TW201401229A (en) * | 2012-06-28 | 2014-01-01 | Imec Taiwan Co | Imaging system and method |
CN102937896A (en) * | 2012-11-05 | 2013-02-20 | 清华大学 | Method for dynamically presenting two-dimensional spatial data by using color mapping technology in scalable vector graphics (SVG) |
CN103440632A (en) * | 2013-09-04 | 2013-12-11 | 中测新图(北京)遥感技术有限责任公司 | Processing method for improving color fidelity of close-shot large-format images |
US20190189081A1 (en) * | 2017-12-19 | 2019-06-20 | Seiko Epson Corporation | Color conversion table adjustment method |
CN112308773A (en) * | 2020-08-19 | 2021-02-02 | 贵州电网有限责任公司 | Unmanned aerial vehicle aerial image nondestructive amplification and splicing fusion method |
CN115157654A (en) * | 2022-07-28 | 2022-10-11 | 河北工业大学 | Surface color inward diffusion method of color 3D model |
Non-Patent Citations (2)
Title |
---|
廖桂香;李振辉;: "MAPGIS二次开发平台下GRD网格法实现渐变色填充剖平图", 物探化探计算技术 * |
毕世普,孔祥淮,别君: "一种利用MapGIS绘制海岸带地球化学色斑图的方法", 地理空间信息 * |
Also Published As
Publication number | Publication date |
---|---|
CN115988186B (en) | 2023-06-09 |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
US10157564B2 (en) | Display apparatus with shared sub-pixel and method of driving the same | |
CN103745684B (en) | Pel array, present image method on display and display | |
CN101593349B (en) | Method for converting two-dimensional image into three-dimensional image | |
CN204463787U (en) | LED structure, display unit and display control unit | |
CN103700329B (en) | The display packing of display panel | |
CN104618703B (en) | A kind of white balance adjustment method | |
CN107248389B (en) | Color gamut compensation method and device of display panel | |
CN104461440A (en) | Rendering method, rendering device and display device | |
CN101489143B (en) | Image processing method, image data conversion method and apparatus thereof | |
CN104112763A (en) | Pixel arrangement structure, display device and display method thereof | |
EP3174037A1 (en) | Image display method and display device | |
CN107978289A (en) | The driving method and driving device of a kind of display device | |
US20130265323A1 (en) | Unevenness correction apparatus and method for controlling same | |
CN110415304A (en) | A kind of vision calibration method and system | |
CN104461441A (en) | Rendering method, rendering device and display device | |
CN104933980A (en) | Display driving method and apparatus, and display apparatus | |
CN115988186A (en) | Image processing system and method | |
CN105989799B (en) | Image processing method and image processing apparatus | |
CN108898679A (en) | A kind of method of component serial number automatic marking | |
CN110189667A (en) | A kind of display verification method | |
CN109815896B (en) | Parameter-configurable virtual goods channel dividing method for intelligent sales counter | |
JP2014116706A (en) | Two-dimensional color code display apparatus, display method, reading device, and reading method | |
CN110176207A (en) | Image data determination method and device and electronic equipment | |
CN107919103A (en) | Multiple bases conversion method, driving method, readable storage medium storing program for executing and display device | |
CN105184826A (en) | Method and device for determining image brightness background and display device |
Legal Events
Date | Code | Title | Description |
---|---|---|---|
PB01 | Publication | ||
PB01 | Publication | ||
SE01 | Entry into force of request for substantive examination | ||
SE01 | Entry into force of request for substantive examination | ||
GR01 | Patent grant | ||
GR01 | Patent grant |