CN111200694A - Image processing method and device - Google Patents

Image processing method and device Download PDF

Info

Publication number
CN111200694A
CN111200694A CN201811381837.XA CN201811381837A CN111200694A CN 111200694 A CN111200694 A CN 111200694A CN 201811381837 A CN201811381837 A CN 201811381837A CN 111200694 A CN111200694 A CN 111200694A
Authority
CN
China
Prior art keywords
image
template
image block
images
unit
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
Application number
CN201811381837.XA
Other languages
Chinese (zh)
Other versions
CN111200694B (en
Inventor
李敏
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Ricoh Co Ltd
Original Assignee
Ricoh Co Ltd
Priority date (The priority date 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 date listed.)
Filing date
Publication date
Application filed by Ricoh Co Ltd filed Critical Ricoh Co Ltd
Priority to CN201811381837.XA priority Critical patent/CN111200694B/en
Publication of CN111200694A publication Critical patent/CN111200694A/en
Application granted granted Critical
Publication of CN111200694B publication Critical patent/CN111200694B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Classifications

    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04NPICTORIAL COMMUNICATION, e.g. TELEVISION
    • H04N1/00Scanning, transmission or reproduction of documents or the like, e.g. facsimile transmission; Details thereof
    • H04N1/00681Detecting the presence, position or size of a sheet or correcting its position before scanning
    • H04N1/00684Object of the detection
    • H04N1/00708Size or dimensions

Landscapes

  • Engineering & Computer Science (AREA)
  • Multimedia (AREA)
  • Signal Processing (AREA)
  • Editing Of Facsimile Originals (AREA)

Abstract

The invention provides an image processing method and device, wherein the method comprises the following steps: the method comprises the steps of importing a first format image, and converting the first format image into a second format image, wherein the first format image comprises direction parameters; a parameter configuration step, namely setting the direction of the template according to the direction parameters, and setting template image blocks of the template, wherein the template image blocks comprise template elements; a rotation angle setting step of setting rotation angles for one or more images in the second format image according to the direction of the template and the template image block, and an output step of rotating the one or more images according to the respective rotation angles and outputting the rotated one or more images, wherein each image in the one or more images comprises a feature element, and the feature element is matched with the template element.

Description

Image processing method and device
Technical Field
The invention relates to an image processing method and device.
Background
At present, wide printers are widely used in design industries such as water and electricity engineering, building engineering, interior decoration and the like, and are generally used for printing large-batch and large-format electronic format engineering design drawings. For the convenience of daily use such as examination, reference, storage, filing and the like, for the large-format electronic format engineering design drawing, a paper folding machine is usually required for paper folding treatment after printing, so that the original large-size drawing is folded into a small-size drawing. The folding process is only folded according to a certain rule, so that marks such as marks, page numbers, signatures and the like on the folded drawing can be found quickly and conveniently, and the rough content of the drawing can be known conveniently.
Because the folder must perform folding processing according to the fixed direction of the drawing, when a wide-format printer is used for printing and processing images in different directions in large batches, the current common practice in the industry is as follows:
1. when an upstream drawing designer and a drawing scanning responsible person are required to output drawings, the drawings are uniformly output according to a fixed direction, and then the printing responsible person is printed by the text printing center to print and output in batches. If the printing directions of some drawings are inconsistent, the directions are readjusted and then the printing is carried out again.
2. Reading in original engineering drawings by using a program, manually judging the direction of each page of image of the original engineering drawings, adjusting the drawings with different directions to the same direction one by one through the rotation function of the program, and then reprinting.
However, both of the above approaches have two problems:
1) the efficiency of manual operation is extremely low in large batches; 2) the error rate of large-batch manual operation is extremely high.
In addition, if the drawing designed by the upstream drawing designer is slightly smaller or larger than the standard size, the drawing is printed by using a mainstream wide-format printer in the current industry, and an expected result cannot be obtained. For example, if a designer desires to design a drawing with a standard size a1(594 mm 841 mm), and the actual design drawing size is 600mm 845mm, which is slightly wider than a1 for some special reasons, the actual design drawing will be printed with a0 wide size as a default, that is, the actual printed paper size is 841mm 845mm, and then at least 203,645mm more drawings will be added to the actual printed paper than the actual design drawing2Is empty. There is also a method of re-editing the original image data to perform a morphing process using a zoom function of the program, and printing the data to a desired standard size.
However, such a process causes two problems: 1) the drawing obtained by the user is not the expected A1 drawing, so that the waste of paper is serious; 2) the definition of the drawing obtained by the user is reduced, and the printing quality is influenced.
Disclosure of Invention
In order to solve the above-mentioned existing problems, the present invention provides an image processing method and apparatus. The image processing method comprises the following steps:
the method comprises the steps of importing a first format image, and converting the first format image into a second format image, wherein the first format image comprises direction parameters;
a parameter configuration step, namely setting the direction of the template according to the direction parameters, and setting template image blocks of the template, wherein the template image blocks comprise template elements;
a rotation angle setting step of setting rotation angles for one or more images of the second format images respectively according to the direction of the template and the template image block,
an output step of rotating the one or more images according to the respective rotation angles and outputting the rotated one or more images,
wherein each of the one or more images contains a feature element that matches the template element.
Wherein the rotation angle setting step includes:
a first reading step of reading a current image of the one or more images and converting the current image into a third format current image;
an initial position setting step, namely determining an initial position according to the direction of the template;
an image block determining step, in which the third format current image is rotated by a first angle, a second angle, a third angle and a fourth angle respectively, and image blocks corresponding to the positions of the template elements in the rotated third format current image are used as a first image block, a second image block, a third image block and a fourth image block corresponding to the first angle, the second angle, the third angle and the fourth angle respectively;
a matching degree calculation step of reading respective multiple pixel values from the respective initial positions of the first image block, the second image block, the third image block and the fourth image block, and calculating the multiple pixel values of each image block and the multiple pixel values in the template image block by using a predetermined image matching algorithm to obtain a first matching degree of the first image block and the template image block, a second matching degree of the second image block and the template image block, a third matching degree of the third image block and the template image block, and a fourth matching degree of the fourth image block and the template image block;
setting, namely taking the maximum value of the first matching degree, the second matching degree, the third matching degree and the fourth matching degree as a reference matching degree, and setting an angle corresponding to the image block with the reference matching degree as a rotation angle of the current image;
a first judgment step of judging whether the current image is the last image of the one or more images, if not, taking the next image as the current image, and returning to the first reading step; if yes, entering the output step.
Wherein the feature elements are in image blocks having the reference matching degrees.
Wherein the parameter configuration step further comprises: and setting fault-tolerant parameters according to the first format image.
Wherein the method further comprises a paper determining step before or after the rotation angle setting step, in which the output paper size of each of the one or more images in the second format image is determined according to the fault-tolerant parameter.
Wherein the paper determining step further comprises:
a second reading step of reading a current image of the one or more images to acquire an image size of the current image and reading a predetermined plurality of paper sizes, the current image having a default paper size corresponding to the image size;
a difference value calculating step of calculating differences between the plurality of paper sizes and the image size to obtain a plurality of difference values, and taking the smallest of the plurality of difference values as a reference difference value;
comparing, namely comparing the reference difference with the fault-tolerant parameter, if the reference difference is less than or equal to the fault-tolerant parameter, taking the paper size corresponding to the reference difference as the output paper size of the current image, and if the reference difference is greater than the fault-tolerant parameter, taking the default paper size as the output paper size of the current image;
a second judgment step of judging whether the current image is the last image of the one or more images, if not, taking the next image as the current image, and returning to the second reading step; and if so, entering the rotation angle setting step or the output step.
Wherein the outputting step further comprises: outputting the one or more images according to their respective output paper sizes.
The present invention also provides an image processing apparatus, including:
the image processing device comprises an importing unit, a processing unit and a display unit, wherein the importing unit imports a first format image and converts the first format image into a second format image, and the first format image comprises a direction parameter;
the parameter configuration unit is used for setting the direction of the template according to the direction parameters and setting a template image block of the template, wherein the template image block comprises template elements;
a rotation angle setting unit that sets a rotation angle for each of one or more of the second format images according to a direction of the template and a position of the template element,
an output unit that rotates the one or more images according to the respective rotation angles and outputs the rotated one or more images,
wherein each of the one or more images contains a feature element that matches the template element.
Wherein the rotation angle setting unit includes:
a first reading unit that reads a current image among the one or more images and converts the current image into a third format current image;
the initial position setting unit is used for determining an initial position according to the direction of the template;
an image block determining unit, configured to rotate the third format current image by a first angle, a second angle, a third angle, and a fourth angle, respectively, and use image blocks corresponding to the positions of the template elements in the rotated third format current image as a first image block, a second image block, a third image block, and a fourth image block corresponding to the first angle, the second angle, the third angle, and the fourth angle, respectively;
a matching degree calculation unit, configured to read respective multiple pixel values from the respective initial positions of the first image block, the second image block, the third image block, and the fourth image block, and calculate the multiple pixel values of each image block and the multiple pixel values in the template image block by using a predetermined image matching algorithm, so as to obtain a first matching degree between the first image block and the template image block, a second matching degree between the second image block and the template image block, a third matching degree between the third image block and the template image block, and a fourth matching degree between the fourth image block and the template image block;
the setting unit is used for taking the maximum value of the first matching degree, the second matching degree, the third matching degree and the fourth matching degree as a reference matching degree, and setting the angle corresponding to the image block with the reference matching degree as the rotation angle of the current image;
a first judging unit which judges whether the current image is the last image in the one or more images, if not, the next image is taken as the current image, and the current image is returned to the first reading unit; and if so, entering the output unit.
Wherein the feature elements are in image blocks having the reference matching degrees.
The parameter configuration unit also sets fault-tolerant parameters according to the first format image.
The device further comprises a paper determining unit, and the paper determining unit determines the output paper size of each of the one or more images in the second format image according to the fault-tolerant parameter.
Wherein the paper determination unit further includes:
a second reading unit that reads a current image of the one or more images to acquire an image size of the current image, the current image having a default paper size corresponding to the image size, and reads a predetermined plurality of paper sizes;
a difference value calculating unit that calculates differences between the plurality of paper sizes and the image size, respectively, to obtain a plurality of difference values, and takes a smallest one of the plurality of difference values as a reference difference value;
a comparing unit, configured to compare the reference difference with the fault-tolerant parameter, if the reference difference is smaller than or equal to the fault-tolerant parameter, use a paper size corresponding to the reference difference as an output paper size of the current image, and if the reference difference is larger than the fault-tolerant parameter, use the default paper size as the output paper size of the current image;
a second judging unit that judges whether the current image is a last image among the one or more images, and if not, takes a next image as the current image and returns the current image to the second reading unit; and if so, entering the rotation angle setting unit or the output unit.
Wherein the output unit further outputs the one or more images according to respective output paper sizes of the one or more images.
By the invention, the printing efficiency is improved, the error rate is reduced, and meanwhile, the image can be printed by using proper paper, thereby further avoiding serious waste of the paper. In addition, the image is printed by using proper and smaller paper, so that the definition of the drawing can be improved, and the printing quality can be improved.
Drawings
Fig. 1 is a structural diagram of an image processing apparatus according to a first embodiment of the present invention;
fig. 2 is a structural diagram of a rotation angle setting unit in the image processing apparatus according to the first embodiment of the present invention;
fig. 3 is a structural diagram of an image processing apparatus according to a second embodiment of the present invention;
fig. 4 is a structural diagram of a paper determination unit in an image processing apparatus according to a second embodiment of the present invention;
fig. 5 is a flowchart of an image processing method according to a first embodiment of the present invention;
fig. 6 is a flowchart of a rotation angle setting step in the image processing method according to the first embodiment of the present invention;
fig. 7 is a flowchart of an image processing method according to a second embodiment of the present invention;
fig. 8 is a flowchart of an image processing method according to a third embodiment of the present invention;
fig. 9 is a flowchart of a paper determination step in an image processing method according to a second embodiment of the present invention;
fig. 10 is a flowchart of a paper determination step in an image processing method according to a third embodiment of the present invention;
FIG. 11 is a schematic illustration of a template in a first embodiment according to the present invention;
FIG. 12 is a schematic diagram of a current image in a first embodiment in accordance with the invention;
fig. 13(a) is a schematic diagram of a current image rotated by a first angle in a first embodiment according to the present invention, fig. 13(b) is a schematic diagram of a current image rotated by a second angle in a first embodiment according to the present invention, fig. 13(c) is a schematic diagram of a current image rotated by a third angle in a first embodiment according to the present invention, and fig. 13(d) is a schematic diagram of a current image rotated by a fourth angle in a first embodiment according to the present invention;
FIG. 14 is a schematic illustration of a current image according to a second embodiment of the invention;
FIG. 15 is a schematic illustration of a default sheet size for a current image in a second embodiment according to the present invention;
fig. 16 is a schematic diagram of an output sheet size of a current image in the second embodiment according to the present invention.
Detailed Description
Embodiments of the present invention will be described in detail below with reference to the accompanying drawings.
< first embodiment >
Fig. 1 is a structural diagram of an image processing apparatus 10 according to a first embodiment of the present invention. As shown in fig. 1, the image processing apparatus 10 includes an importing unit 11, a parameter configuring unit 12, a rotation angle setting unit 13, and an outputting unit 14. Fig. 2 is a configuration diagram of the rotation angle setting unit 13 in the image processing apparatus 10 according to the first embodiment of the present invention, and as shown in fig. 2, the rotation angle setting unit 13 includes a first reading unit 131, a start position setting unit 132, an image block determining unit 133, a matching degree calculating unit 134, a setting unit 135, and a first judging unit 136.
Fig. 5 is a flowchart of an image processing method according to a first embodiment of the present invention. As shown in fig. 5, in the importing step S50, the importing unit 11 imports a first format image (i.e., an original image) and converts the first format image into a second format image, the first format image containing the direction parameter.
The first format image is, for example, an engineering design drawing made by designers in a design house through different approaches, and may be a DWF/DWFx or PLT print format file directly generated by AutoCAD, or an image in other formats such as JPG or DOC, which is scanned into a portable PDF or TIFF format file by an existing design drawing.
The importing unit 11 converts the imported first format image into a second format image, which is, for example, an image in PDF format. In this example, the second format image is a PDF formatted image, and the PDF formatted image may include one or more images. The one or more images are, for example, one or more pages of a PDF document.
The first format image contains a direction parameter, and the direction parameter can be vertical or horizontal and represents the direction of the first format image. In this example, the orientation parameter of the first format image is the portrait orientation, for example.
In the parameter configuration step S52, the parameter configuration unit 12 sets the orientation of the template according to the orientation parameter, and sets a template image block of the template, the template image block including template elements.
In this example, the direction parameter is a vertical direction, and the parameter configuration unit 12 sets the direction of the template to the vertical direction. Fig. 11 is a schematic view of the template M of the present invention, and the direction of the template M is a longitudinal direction.
The parameter configuration unit 12 also sets a template image block D of the template M, and the template image block D includes template elements. The template elements can be various pictures such as identification, watermark, signature, table and the like which can identify all the design drawings, and can be all picture formats supported by the invention. The position of the template element may be upper left, upper right, lower left, lower right, which position represents the relative position of the template element in the template M. The template image block D contains a template element L, i.e. the position of the template image block D is the same as the position of the template element L.
As shown in fig. 11, in this example, the template element L is, for example, a logo representing one company, and the position of the template element L is set at the upper right position in the template M, that is, the position of the template image block D is at the upper right position in the template M. Here, the position of the template element L may be arbitrarily set or set according to the user's request.
In the rotation angle setting step S54, the rotation angle setting unit 13 sets rotation angles for one or more images of the second format images, respectively, according to the direction of the template M, the template image block.
Fig. 6 is a flowchart of the rotation angle setting step S54 in the image processing method according to the first embodiment of the present invention. As shown in fig. 6, in the first reading step S541, the first reading unit 131 reads a current image of the one or more images of the second format image and converts the current image into a third format current image.
FIG. 12 is a schematic diagram of a current image C of the present invention, i.e., a current page PDF document C. The first reading unit 131 converts the read current page PDF document C into a third format current image. The third format current image is, for example, a binary bitmap format, that is, an image in which the current page PDF document C shown in fig. 12 is converted into a binary bitmap format.
Next, in the start position setting step S542, the start position setting unit 132 determines a start position according to the direction of the template M. The start position indicates a position at which reading of pixel values in the image block starts, and may be, for example, an upper left vertex, an upper right vertex, a lower left vertex, and a lower right vertex. In this example, where the orientation of the template M is vertical, the start position is determined as the top left vertex. In addition, if the direction of the template M is the lateral direction, the start position is determined as the upper right vertex.
In the image block determining step S543, the image block determining unit 133 rotates the third format current image by the first angle, the second angle, the third angle, and the fourth angle, respectively, and uses the image blocks corresponding to the position of the template image block D in the rotated third format current image as the first image block, the second image block, the third image block, and the fourth image block corresponding to the first angle, the second angle, the third angle, and the fourth angle, respectively.
Fig. 13(a) is a schematic diagram of a current image C rotated by a first angle in the first embodiment according to the present invention, fig. 13(b) is a schematic diagram of a current image C rotated by a second angle in the first embodiment according to the present invention, fig. 13(C) is a schematic diagram of a current image C rotated by a third angle in the first embodiment according to the present invention, and fig. 13(d) is a schematic diagram of a current image C rotated by a fourth angle in the first embodiment according to the present invention.
Here, for clarity of display, fig. 13(a) -13(d) are used to show schematic diagrams in which the third-format current image (i.e., the binary bitmap format image) is rotated by a first angle, a second angle, a third angle, and a fourth angle, respectively. In this example, the first angle is 0 degrees, the second angle is 90 degrees, the third angle is 180 degrees, and the fourth angle is 270 degrees. That is, fig. 13(a) shows that the third-format current image is rotated by 0 degree, fig. 13(b) shows that the third-format current image is rotated by 90 degrees, fig. 13(c) shows that the third-format current image is rotated by 180 degrees, and fig. 13(d) shows that the third-format current image is rotated by 270 degrees.
In this example, the position of the template image block D is upper right, and as shown in fig. 13(a), the position of the image block B1 is upper right, corresponding to the position of the template image block D, and then the image block B1 is taken as the first image block B1 corresponding to 0 degrees. Similarly, image block B2 in fig. 13(B) is taken as the second image block B2 corresponding to 90 degrees, image block B3 in fig. 13(c) is taken as the third image block B3 corresponding to 180 degrees, and image block B4 in fig. 13(d) is taken as the fourth image block B4 corresponding to 270 degrees.
Next, in a matching degree calculating step S544, the matching degree calculating unit 134 reads respective multiple pixel values from respective starting positions of the first image block B1, the second image block B2, the third image block B3, and the fourth image block B4, and calculates the multiple pixel values of each image block and the multiple pixel values of the template image block D using a predetermined image matching algorithm, so as to obtain a first matching degree between the first image block B1 and the template image block D, a second matching degree between the second image block B2 and the template image block D, a third matching degree between the third image block B3 and the template image block D, and a fourth matching degree between the fourth image block B4 and the template image block D.
Specifically, as set in step S542 above, the start position is determined as the upper left vertex. Referring to fig. 13(a), the matching degree calculating unit 134 reads a plurality of pixel values of the first image block B1 starting from the upper left vertex P1 of the first image block B1. For example, the pixel values of all the pixels of the first image block B1 are read sequentially from left to right, from top to bottom, starting from the top left vertex P1.
Similarly, referring to fig. 13(B), the matching degree calculating unit 134 reads a plurality of pixel values of the second image block B2 starting from the upper left vertex P2 of the second image block B2. For example, the pixel values of all the pixels of the second image block B2 are read sequentially from left to right, from top to bottom, starting from the top left vertex P2.
Similarly, referring to fig. 13(c), the matching degree calculating unit 134 reads a plurality of pixel values of the third image block B3 starting from the upper left vertex P3 of the third image block B3. For example, the pixel values of all the pixels of the third image block B3 are read sequentially from left to right, from top to bottom, starting from the top left vertex P3.
Similarly, referring to fig. 13(d), matching degree calculating unit 134 reads a plurality of pixel values of fourth image block B4 starting from the upper left vertex P4 of fourth image block B4. For example, the pixel values of all the pixels of the fourth image block B4 are read sequentially from left to right, from top to bottom, starting from the top left vertex P4.
The plurality of pixel values of the template image block D may be read by the first reading unit 131 and may be read before step S544 without limitation. For example, the first reading unit 131 may read a plurality of pixel values in the stencil image block D, i.e., read pixel values of all pixels of the stencil image block D, before step S541.
The matching degree calculation unit 134 calculates a plurality of pixel values of the first image block B1 and a plurality of pixel values of the template image block D using a predetermined image matching algorithm, resulting in a first matching degree N1 of the first image block B1 and the template image block D.
Similarly, the matching degree calculating unit 134 calculates a plurality of pixel values of the second image block B2 and a plurality of pixel values of the template image block D using a predetermined image matching algorithm, resulting in a second matching degree N2 of the second image block B2 and the template image block D.
Similarly, the matching degree calculation unit 134 calculates a plurality of pixel values of the third image block B3 and a plurality of pixel values of the template image block D using a predetermined image matching algorithm, resulting in a third matching degree N3 of the third image block B3 and the template image block D.
Similarly, the matching degree calculation unit 134 calculates a plurality of pixel values of the fourth image block B4 and a plurality of pixel values of the template image block D using a predetermined image matching algorithm, resulting in a fourth matching degree N4 of the fourth image block B4 and the template image block D.
The predetermined image matching algorithm is, for example, Normalized Cross Correlation (NCC) algorithm, or other existing image matching algorithms, but is not limited thereto.
In the setting step S545, the setting unit 135 takes the maximum value of the first, second, third, and fourth degrees of matching N1, N2, N3, and N4 as the reference degree of matching, and sets the angle corresponding to the image block having the reference degree of matching as the rotation angle of the current image C.
In this example, the first matching degree N1 calculated as described above is 5, the second matching degree N2 is 20, the third matching degree N3 is 5, and the fourth matching degree N4 is 95. Thus, the setting unit 135 takes the fourth matching degree N4 as the reference matching degree. The tile having the fourth matching degree N4 is the fourth tile B4, and the fourth tile B4 corresponds to 270 degrees, and thus the setting unit 135 sets 270 degrees as the rotation angle of the current image C.
Wherein each of the one or more images contains a feature element, the feature element is in an image block having a reference matching degree, and the feature element matches with the template element L.
As shown in fig. 12, the current image C of the one or more images contains a feature element R, which is in the fourth image block B4 having a reference matching degree N4 in this example, and the feature element R matches the template element L. Since the feature element R matches the template element L, the fourth image block B4 matching the template M is determined in the above manner, thereby setting 270 degrees corresponding to the fourth image block B4 as the rotation angle at which the current image C should be correctly rotated.
In the first judgment step S546, the first judgment unit 136 judges whether the current image C is the last image of the one or more images, and if not, takes the next image as the current image, and returns to the first reading step S541; if so, the flow proceeds to step S56.
Specifically, when the first judgment unit 136 judges that the current image C is not the last image of the one or more images, the next image of the one or more images is taken as the current image, and returns to the first reading step S541 until the current image is judged to be the last image, and thus, the rotation angles that should be correctly rotated can be set for all the images of the one or more images, respectively.
In the output step S56, the output unit 14 rotates one or more images according to the respective rotation angles, and outputs the rotated one or more images.
As described above, the output unit 14 rotates the current image C by 270 degrees, and similarly, the output unit 14 rotates one or more images in the PDF format according to the respective rotation angles, and outputs (e.g., prints) the rotated one or more images.
According to the invention, the imported original image can be normalized through the set template, and the rotation angle of each page of image in the imported original image can be automatically adjusted, so that the direction of the printed and output images is consistent. Because large-batch manual adjustment is not needed, the printing efficiency can be greatly improved, and the error rate is reduced. The printed drawings are uniformly folded through a paper folder, so that the printed drawings are convenient to look up.
< second embodiment >
Fig. 3 is a structural diagram of an image processing apparatus 10' according to a second embodiment of the present invention. As shown in fig. 3, the image processing apparatus 10' includes a lead-in unit 11, a parameter configuration unit 12, a rotation angle setting unit 13, a sheet determination unit 15, and an output unit 14. The introduction unit 11 and the rotation angle setting unit 13 are the same as those in the first embodiment, and therefore, detailed description thereof is omitted.
Fig. 4 is a configuration diagram of the paper determination unit 15 in the image processing apparatus 10' according to the second embodiment of the present invention. As shown in fig. 4, the sheet determining unit 15 includes a second reading unit 151, a difference value calculating unit 152, a comparing unit 153, and a second judging unit 154.
Fig. 7 is a flowchart of an image processing method according to a second embodiment of the present invention. Here, the steps S50 and S54 are the same as those in the flowchart of the method of the first embodiment shown in fig. 5, and therefore, they will not be described in detail here. And only the steps different from the first embodiment will be described here.
In step S52, the parameter configuration unit 12 also sets the fault-tolerant parameter according to the first format image. In this example, the fault tolerance parameter may be set to 10 millimeters based on the imported first format image (i.e., the original image). The fault tolerance parameter may also be set to other values according to the first format image without limitation.
In the sheet determining step S53, the sheet determining unit 15 determines the output sheet size of each of one or more images in the second-format image, based on the fault-tolerant parameter.
Fig. 9 is a flowchart of the paper determining step S53 in the image processing method according to the second embodiment of the present invention. In the second reading step S531, the second reading unit 151 reads a current image of the one or more images in the PDF format to acquire an image size of the current image, and reads a predetermined plurality of paper sizes, the current image having a default paper size corresponding to the image size thereof.
Fig. 14 is a schematic diagram of a current image C ' according to a second embodiment of the present invention, and the second reading unit 151 reads the current image C ' of one or more images and acquires an image size of the current image C '. Here, the image size of the current image C 'refers to the width (i.e., the length in the left-right direction) of the current image C'. As shown in fig. 14, the width of the current image C' is 600 mm.
The second reading unit 151 also reads a predetermined plurality of sheet sizes, for example, the respective widths of four standard sheets a0, a1, A3, a4, for example, the width of the standard sheet a0 is 841mm, the width of the standard sheet a1 is 594mm, the width of the standard sheet A3 is 297mm, and the width of the standard sheet a4 is 210 mm. Where the current image C ' has a default sheet size corresponding to its width, e.g., the width of the current image C ' is 600mm, the current image C ' is automatically assigned the default sheet size, e.g., a 0. Fig. 15 is a schematic diagram of a default sheet size a0 of a current image C' in the second embodiment of the present invention, the default sheet size a0 being 841mm in width and 845mm in length.
The method of automatically assigning the default paper size to the current image C' is any method that is available, and is not limited.
In the difference calculation step S552, the difference calculation unit 152 calculates differences between the plurality of sheet sizes and the image sizes, respectively, to obtain a plurality of difference values, and takes the smallest of the plurality of difference values as a reference difference value.
Specifically, the difference value calculating unit 152 calculates differences between the respective widths of the four standard sheet sizes a0, a1, A3, a4 and the width of the current image C', and takes the absolute values of these differences as the corresponding four difference values E1, E2, E3, E4. In this example, the difference calculating unit 152 calculates that E1 is 241mm, E2 is 6mm, E3 is 303mm, and E4 is 359 mm.
The difference calculation unit 152 takes the smallest E2 of the four differences E1, E2, E3, E4 as the reference difference E, i.e., the reference difference E is 6 mm.
In the comparing step S553, the comparing unit 153 compares the reference difference E with the fault-tolerant parameter, and if the reference difference E is less than or equal to the fault-tolerant parameter, takes the sheet size corresponding to the reference difference as the output sheet size of the current image C ', and if the reference difference E is greater than the fault-tolerant parameter, takes the default sheet size as the output sheet size of the current image C'.
In this example, the reference difference E is 6mm, which is smaller than the above-described fault-tolerant parameter by 10mm, and the sheet size corresponding to the reference difference E is a1, the comparing unit 153 takes the sheet size a1 as the output sheet size of the current image C'. Fig. 16 is a schematic diagram of an output sheet size a1 of a current image C' in the second embodiment of the present invention, and as shown in fig. 16, the output sheet size a1 is 594mm wide, which is smaller than the default sheet size a 0.
In the second judgment step S534, the second judgment unit 154 judges whether the current image C' is the last image among the one or more images, and if not, takes the next image as the current image, and returns to step S531; if so, the flow proceeds to step S54.
Here, when the second judging unit 154 judges that the current image C' is not the last image of the one or more images, the next image of the one or more images is taken as the current image, and returns to step S531 until the current image is judged to be the last image, and thus, the output paper size can be set for all the images of the one or more images, respectively.
After the output paper sizes are set for all the images in the one or more images, respectively, i.e., when the determination of step S534 is yes, the flow proceeds to step S54. Step S54 is the same as step S54 in the first embodiment, and is not described in detail here.
Next, in step S56, the output unit 14 further outputs one or more images according to their respective output sheet sizes.
Here, the output unit 14 rotates one or more images in the PDF format (each page image in the PDF format) according to the respective rotation angles as described in the first embodiment, and outputs (prints) with corresponding paper in accordance with the output paper size of each image.
In the present embodiment, as shown in fig. 15, in the dotted line box is a range of the current image that the designer desires to design, the width of which is 594mm, but for some special reasons, the width of the current image C 'is 600mm as shown in fig. 14, so the current image C' is normally printed using the default paper size a0 of 841mm in width as shown in fig. 15. It can be seen that in the actually printed a0 paper, there will be more blank areas, so that the paper will be wasted seriously. Whereas with the present embodiment, it is possible to change the default sheet size a0 of the current image C 'to the sheet size a1 smaller than the width of a0 and output (print) the current image C' with the sheet size a1, so it is possible to avoid the waste of sheets from being serious.
That is, with the present invention, while improving printing efficiency and reducing error rate, it is also possible to print an image using an appropriate sheet (i.e., using a sheet size a1 smaller than the default sheet size a 0), thereby further avoiding waste of sheets from being serious. In addition, the image is printed by using proper and smaller paper, so that the definition of the drawing can be improved, and the printing quality can be improved.
< third embodiment >
Fig. 8 is a flowchart of an image processing method according to a third embodiment of the present invention. The flowchart of fig. 8 differs from the flowchart of fig. 7 in the second embodiment in that the sheet determining step S55 follows step S54 and precedes step S56.
Fig. 10 is a flowchart of the paper determining step S55 in the image processing method according to the third embodiment of the present invention. Steps S551, S552, and S553 in the flowchart of fig. 10 are the same as steps S531, S532, and S533 in the flowchart of fig. 9, respectively, and are not described in detail here. Step S551 is performed after step S54. In addition, in step S554, when the second judgment unit 154 judges that the current image C' is the last image among the one or more images, it proceeds to step S56.
With the present invention, it is possible to print an image using an appropriate sheet (i.e., using a sheet size a1 smaller than the default sheet size a 0) while improving printing efficiency and reducing error rate, thereby further avoiding waste of sheets from being serious. In addition, the image is printed by using proper and smaller paper, so that the definition of the drawing can be improved, and the printing quality can be improved.
While the present invention has been described in conjunction with specific embodiments, it is evident that many alternatives, modifications, and variations will be apparent to those skilled in the art in light of the foregoing description. Accordingly, it is intended that such alternatives, modifications, and variations be included within the spirit and scope of the appended claims.

Claims (14)

1. An image processing method, characterized in that the method comprises:
the method comprises the steps of importing a first format image, and converting the first format image into a second format image, wherein the first format image comprises direction parameters;
a parameter configuration step, namely setting the direction of the template according to the direction parameters, and setting template image blocks of the template, wherein the template image blocks comprise template elements;
a rotation angle setting step of setting rotation angles for one or more images of the second format images respectively according to the direction of the template and the template image block,
an output step of rotating the one or more images according to the respective rotation angles and outputting the rotated one or more images,
wherein each of the one or more images contains a feature element that matches the template element.
2. The method of claim 1, wherein the rotation angle setting step comprises:
a first reading step of reading a current image of the one or more images and converting the current image into a third format current image;
an initial position setting step, namely determining an initial position according to the direction of the template;
an image block determining step, in which the third format current image is rotated by a first angle, a second angle, a third angle and a fourth angle respectively, and image blocks corresponding to the positions of the template elements in the rotated third format current image are used as a first image block, a second image block, a third image block and a fourth image block corresponding to the first angle, the second angle, the third angle and the fourth angle respectively;
a matching degree calculation step of reading respective multiple pixel values from the respective initial positions of the first image block, the second image block, the third image block and the fourth image block, and calculating the multiple pixel values of each image block and the multiple pixel values in the template image block by using a predetermined image matching algorithm to obtain a first matching degree of the first image block and the template image block, a second matching degree of the second image block and the template image block, a third matching degree of the third image block and the template image block, and a fourth matching degree of the fourth image block and the template image block;
setting, namely taking the maximum value of the first matching degree, the second matching degree, the third matching degree and the fourth matching degree as a reference matching degree, and setting an angle corresponding to the image block with the reference matching degree as a rotation angle of the current image;
a first judgment step of judging whether the current image is the last image of the one or more images, if not, taking the next image as the current image, and returning to the first reading step; if yes, entering the output step.
3. The method according to claim 2, wherein the feature element is in an image block having the reference matching degree.
4. The method of any of claims 1-3, wherein the parameter configuration step further comprises: and setting fault-tolerant parameters according to the first format image.
5. The method according to claim 4, further comprising a paper determination step before or after the rotation angle setting step, in which the output paper size of each of the one or more images in the second format image is determined in accordance with the fault tolerance parameter.
6. The method of claim 5, wherein the paper determination step further comprises:
a second reading step of reading a current image of the one or more images to acquire an image size of the current image and reading a predetermined plurality of paper sizes, the current image having a default paper size corresponding to the image size;
a difference value calculating step of calculating differences between the plurality of paper sizes and the image size to obtain a plurality of difference values, and taking the smallest of the plurality of difference values as a reference difference value;
comparing, namely comparing the reference difference with the fault-tolerant parameter, if the reference difference is less than or equal to the fault-tolerant parameter, taking the paper size corresponding to the reference difference as the output paper size of the current image, and if the reference difference is greater than the fault-tolerant parameter, taking the default paper size as the output paper size of the current image;
a second judgment step of judging whether the current image is the last image of the one or more images, if not, taking the next image as the current image, and returning to the second reading step; and if so, entering the rotation angle setting step or the output step.
7. The method of claim 5 or 6, wherein the outputting step further comprises: outputting the one or more images according to their respective output paper sizes.
8. An image processing apparatus, characterized in that the apparatus comprises:
the image processing device comprises an importing unit, a processing unit and a display unit, wherein the importing unit imports a first format image and converts the first format image into a second format image, and the first format image comprises a direction parameter;
the parameter configuration unit is used for setting the direction of the template according to the direction parameters and setting a template image block of the template, wherein the template image block comprises template elements;
a rotation angle setting unit that sets a rotation angle for each of one or more of the second format images according to a direction of the template and a position of the template element,
an output unit that rotates the one or more images according to the respective rotation angles and outputs the rotated one or more images,
wherein each of the one or more images contains a feature element that matches the template element.
9. The apparatus of claim 8, wherein the rotation angle setting unit comprises:
a first reading unit that reads a current image among the one or more images and converts the current image into a third format current image;
the initial position setting unit is used for determining an initial position according to the direction of the template;
an image block determining unit, configured to rotate the third format current image by a first angle, a second angle, a third angle, and a fourth angle, respectively, and use image blocks corresponding to the positions of the template elements in the rotated third format current image as a first image block, a second image block, a third image block, and a fourth image block corresponding to the first angle, the second angle, the third angle, and the fourth angle, respectively;
a matching degree calculation unit, configured to read respective multiple pixel values from the respective initial positions of the first image block, the second image block, the third image block, and the fourth image block, and calculate the multiple pixel values of each image block and the multiple pixel values in the template image block by using a predetermined image matching algorithm, so as to obtain a first matching degree between the first image block and the template image block, a second matching degree between the second image block and the template image block, a third matching degree between the third image block and the template image block, and a fourth matching degree between the fourth image block and the template image block;
the setting unit is used for taking the maximum value of the first matching degree, the second matching degree, the third matching degree and the fourth matching degree as a reference matching degree, and setting the angle corresponding to the image block with the reference matching degree as the rotation angle of the current image;
a first judging unit which judges whether the current image is the last image in the one or more images, if not, the next image is taken as the current image, and the current image is returned to the first reading unit; and if so, entering the output unit.
10. The apparatus of claim 9, wherein the feature element is in an image block having the reference matching degree.
11. The apparatus according to any one of claims 8 to 10, wherein the parameter configuration unit further sets a fault tolerance parameter according to the first format image.
12. The apparatus of claim 11, further comprising a sheet determination unit that determines an output sheet size of each of the one or more images in the second format image based on the fault tolerance parameter.
13. The apparatus of claim 12, wherein the paper determination unit further comprises:
a second reading unit that reads a current image of the one or more images to acquire an image size of the current image, the current image having a default paper size corresponding to the image size, and reads a predetermined plurality of paper sizes;
a difference value calculating unit that calculates differences between the plurality of paper sizes and the image size, respectively, to obtain a plurality of difference values, and takes a smallest one of the plurality of difference values as a reference difference value;
a comparing unit, configured to compare the reference difference with the fault-tolerant parameter, if the reference difference is smaller than or equal to the fault-tolerant parameter, use a paper size corresponding to the reference difference as an output paper size of the current image, and if the reference difference is larger than the fault-tolerant parameter, use the default paper size as the output paper size of the current image;
a second judging unit that judges whether the current image is a last image among the one or more images, and if not, takes a next image as the current image and returns the current image to the second reading unit; and if so, entering the rotation angle setting unit or the output unit.
14. The apparatus according to claim 12 or 13, wherein the output unit further outputs the one or more images according to respective output paper sizes of the one or more images.
CN201811381837.XA 2018-11-20 2018-11-20 Image processing method and device Active CN111200694B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201811381837.XA CN111200694B (en) 2018-11-20 2018-11-20 Image processing method and device

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201811381837.XA CN111200694B (en) 2018-11-20 2018-11-20 Image processing method and device

Publications (2)

Publication Number Publication Date
CN111200694A true CN111200694A (en) 2020-05-26
CN111200694B CN111200694B (en) 2021-11-05

Family

ID=70746161

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201811381837.XA Active CN111200694B (en) 2018-11-20 2018-11-20 Image processing method and device

Country Status (1)

Country Link
CN (1) CN111200694B (en)

Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN1906637A (en) * 2004-01-06 2007-01-31 汤姆森许可贸易公司 Image orientation detection method and equipment
JP2007166203A (en) * 2005-12-13 2007-06-28 Fuji Xerox Co Ltd Image processor and image processing method
CN101527764A (en) * 2008-03-05 2009-09-09 鸿富锦精密工业(深圳)有限公司 Print setting system and print setting method
CN101616226A (en) * 2008-06-23 2009-12-30 夏普株式会社 Image processing apparatus, image processing system, image processing method
JP2010260301A (en) * 2009-05-11 2010-11-18 Riso Kagaku Corp Image forming apparatus

Patent Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN1906637A (en) * 2004-01-06 2007-01-31 汤姆森许可贸易公司 Image orientation detection method and equipment
JP2007166203A (en) * 2005-12-13 2007-06-28 Fuji Xerox Co Ltd Image processor and image processing method
CN101527764A (en) * 2008-03-05 2009-09-09 鸿富锦精密工业(深圳)有限公司 Print setting system and print setting method
CN101616226A (en) * 2008-06-23 2009-12-30 夏普株式会社 Image processing apparatus, image processing system, image processing method
JP2010260301A (en) * 2009-05-11 2010-11-18 Riso Kagaku Corp Image forming apparatus

Also Published As

Publication number Publication date
CN111200694B (en) 2021-11-05

Similar Documents

Publication Publication Date Title
US20080043283A1 (en) Image forming apparatus, image forming method, and computer program product
US10757290B2 (en) Image processing apparatus being able to simultaneously read and extract image data
JP2003174532A (en) Semi-automatic image registration control for digital copier
WO2010150363A1 (en) Image readout device, method for controlling image readout device and program
WO2016101804A1 (en) Double-sided file copying method and device
CN111107234A (en) Multifunction peripheral and system and method for aligning scanned documents
US8675245B2 (en) Apparatus with capability of detecting two-dimensional code
US8437576B2 (en) Method of correcting orientation of an image in automatic printing, and an image forming method and image forming apparatus thereof
CN111200694B (en) Image processing method and device
US9578203B2 (en) Document production system having automatic adjustment of content to fit the page margin of a pre-printed media
US8269997B2 (en) Document processing apparatus, printing system, document processing method, computer-readable medium and computer data signal
US8891133B2 (en) Image processing device and method of processing image
TWI536799B (en) Smart copy apparatus
JP7033033B2 (en) Image processing equipment
US20160275662A1 (en) Image processing device selecting arrangement method for generating arranged image data
JP5667135B2 (en) Image forming apparatus
US9769351B2 (en) Method for reproducing images and image-processing apparatus using the method
CN111666049A (en) Printing apparatus and printing method
JP7298363B2 (en) Image processing device
JP2005231154A (en) Printing control system
JP6604314B2 (en) Image reading apparatus, image forming apparatus, and image reading method
US20200356039A1 (en) Image Forming Apparatus, Image Forming Method, and Program
JP7061267B2 (en) Image processing equipment
CN114827374A (en) Image output device capable of correcting arrangement direction of scanned image and method thereof
JP2005244899A (en) Copying apparatus and summarized copying method

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