CN111815646A - Picture processing method and device - Google Patents

Picture processing method and device Download PDF

Info

Publication number
CN111815646A
CN111815646A CN202010580448.0A CN202010580448A CN111815646A CN 111815646 A CN111815646 A CN 111815646A CN 202010580448 A CN202010580448 A CN 202010580448A CN 111815646 A CN111815646 A CN 111815646A
Authority
CN
China
Prior art keywords
picture
canvas
processed
target object
processing
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.)
Pending
Application number
CN202010580448.0A
Other languages
Chinese (zh)
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.)
Beijing Mininglamp Software System Co ltd
Original Assignee
Beijing Mininglamp Software System 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 Beijing Mininglamp Software System Co ltd filed Critical Beijing Mininglamp Software System Co ltd
Priority to CN202010580448.0A priority Critical patent/CN111815646A/en
Publication of CN111815646A publication Critical patent/CN111815646A/en
Pending legal-status Critical Current

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06TIMAGE DATA PROCESSING OR GENERATION, IN GENERAL
    • G06T7/00Image analysis
    • G06T7/10Segmentation; Edge detection
    • G06T7/11Region-based segmentation
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06TIMAGE DATA PROCESSING OR GENERATION, IN GENERAL
    • G06T7/00Image analysis
    • G06T7/10Segmentation; Edge detection
    • G06T7/136Segmentation; Edge detection involving thresholding
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06TIMAGE DATA PROCESSING OR GENERATION, IN GENERAL
    • G06T2207/00Indexing scheme for image analysis or image enhancement
    • G06T2207/10Image acquisition modality
    • G06T2207/10024Color image
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06TIMAGE DATA PROCESSING OR GENERATION, IN GENERAL
    • G06T2207/00Indexing scheme for image analysis or image enhancement
    • G06T2207/20Special algorithmic details
    • G06T2207/20112Image segmentation details
    • G06T2207/20132Image cropping

Abstract

The application provides a picture processing method, namely a device, wherein the method comprises the following steps: taking a part in a trimming frame arranged on an original picture as a picture to be processed; processing the region except the target object in the picture to be processed to generate a picture to be uploaded; the cutting frame contains the target object, and the target object is a signature or a seal. The technical scheme can generate the electronic signature more simply and conveniently.

Description

Picture processing method and device
Technical Field
The present invention relates to the field of computers, and in particular, to a method and an apparatus for processing pictures.
Background
With the internet and industries and the increasingly tight integration, documents are becoming more electronic, and a trend is being followed, where official documents and contracts are also in place. The stamping and signing are an essential part of official documents and contracts.
In the prior art, for stamping, original stamping images need to be collected firstly, and are uploaded to a management system after being processed by a picture processing tool; for signing, the user signature needs to be collected by a dedicated signing device.
Disclosure of Invention
The technology to be solved by the application is to provide a picture processing method and device, which can generate an electronic signature more simply and conveniently.
In order to solve the above technical problem, the present application provides an image processing method, including:
taking a part in a trimming frame arranged on an original picture as a picture to be processed;
processing the region except the target object in the picture to be processed to generate a picture to be uploaded;
the cutting frame contains the target object, and the target object is a signature or a seal.
In an exemplary example, the number of the trimming frames is one or more;
the number of the pictures to be processed is one or more.
In an exemplary embodiment, the trimming frame includes a first trimming frame corresponding to the signature and/or a second trimming frame corresponding to the stamp.
In an exemplary instance, the processing the region of the to-be-processed picture other than the target object, and generating the to-be-uploaded picture includes:
removing the background color of the region except the target object in the picture to be processed;
and taking the picture subjected to the background color removal processing as a picture to be uploaded.
In an exemplary instance, the removing the background color of the region of the to-be-processed picture outside the target object includes:
taking the picture to be processed as a base map of the newly created canvas;
removing color values of all points meeting a removal condition in the canvas according to the color values of the selected points on the canvas;
wherein the removal conditions include: the absolute value of the difference value of the color value of the selected point is less than or equal to a set threshold value; the selected point is located in the target object.
In an exemplary instance, the removing color values of all points in the canvas that satisfy a removal condition according to the color values of the selected points on the canvas comprises:
determining an RGBA value of the selected point according to the offset of the selected point;
modifying RGBA values of all points meeting the removal condition into zero in a Unit8Array of the canvas, wherein the Unit8Array contains the RGBA value of each point of the canvas;
and updating the canvas according to the updated Unit8 Array.
In an exemplary example, the taking the picture subjected to the under color removal processing as the picture to be uploaded includes:
and saving the updated canvas as a picture to be uploaded.
In an exemplary example, before the step of using a portion of a trimming frame provided on an original picture as a picture to be processed, the method further includes:
setting a size parameter of the first cutting frame corresponding to the signature;
and setting the size parameter of the second cutting frame corresponding to the type of seal according to the physical size corresponding to the preset type of seal.
The present application further provides an image processing apparatus, including: a memory and a processor;
the memory is used for storing a program for picture processing;
the processor is configured to read the program for processing pictures and execute any one of the methods described above.
The present embodiment also provides a computer storage medium having a computer program stored thereon, wherein the computer program is configured to perform any of the methods described above when executed.
The application provides a picture processing method, which comprises the following steps: taking a part in a trimming frame arranged on an original picture as a picture to be processed; processing the region except the target object in the picture to be processed to generate a picture to be uploaded; the cutting frame contains the target object, and the target object is a signature or a seal. The technical scheme can generate the electronic signature more simply and conveniently.
Drawings
The accompanying drawings are included to provide an understanding of the present disclosure and are incorporated in and constitute a part of this specification, illustrate embodiments of the disclosure and together with the examples serve to explain the principles of the disclosure and not to limit the disclosure.
Fig. 1 is a flowchart of a picture processing method according to a first embodiment of the present application;
fig. 2 is a schematic diagram of a picture processing apparatus according to a first embodiment of the present application.
Detailed Description
The present application describes embodiments, but the description is illustrative rather than limiting and it will be apparent to those of ordinary skill in the art that many more embodiments and implementations are possible within the scope of the embodiments described herein. Although many possible combinations of features are shown in the drawings and discussed in the detailed description, many other combinations of the disclosed features are possible. Any feature or element of any embodiment may be used in combination with or instead of any other feature or element in any other embodiment, unless expressly limited otherwise.
The present application includes and contemplates combinations of features and elements known to those of ordinary skill in the art. The embodiments, features and elements disclosed in this application may also be combined with any conventional features or elements to form a unique inventive concept as defined by the claims. Any feature or element of any embodiment may also be combined with features or elements from other inventive aspects to form yet another unique inventive aspect, as defined by the claims. Thus, it should be understood that any of the features shown and/or discussed in this application may be implemented alone or in any suitable combination. Accordingly, the embodiments are not limited except as by the appended claims and their equivalents. Furthermore, various modifications and changes may be made within the scope of the appended claims.
Further, in describing representative embodiments, the specification may have presented the method and/or process as a particular sequence of steps. However, to the extent that the method or process does not rely on the particular order of steps set forth herein, the method or process should not be limited to the particular sequence of steps described. Other orders of steps are possible as will be understood by those of ordinary skill in the art. Therefore, the particular order of the steps set forth in the specification should not be construed as limitations on the claims. Further, the claims directed to the method and/or process should not be limited to the performance of their steps in the order written, and one skilled in the art can readily appreciate that the sequences may be varied and still remain within the spirit and scope of the embodiments of the present application.
Example one
As shown in fig. 1, the present embodiment provides an image processing method, including:
step S101, taking a part in a trimming frame arranged on an original picture as a picture to be processed;
step S102, processing the area except the target object in the picture to be processed to generate a picture to be uploaded;
the cutting frame contains the target object, and the target object is a signature or a seal.
In this embodiment, a user can sign and/or stamp on a paper document, and then generate an electronic picture of the paper document by taking a picture or scanning, and use the electronic picture as an original picture.
In this embodiment, a picture containing a target object may be selected as a to-be-processed picture through the trimming frame, the to-be-processed picture contains a signature or a seal, and an electronic signature is generated by processing a region other than the signature or the seal in the to-be-processed picture. According to the technical scheme, the corresponding electronic signature can be generated through the electronic picture containing the signature and/or the seal, so that the electronic signature can be generated more simply and conveniently.
In an exemplary example, the number of the trimming frames is one or more;
the number of the pictures to be processed is one or more.
In this embodiment, the original image may have a plurality of signatures or a plurality of stamps. Each signature can correspond to a cutting frame, and each seal can also correspond to a cutting frame. The part in each cropping frame can generate a picture to be processed.
According to the technical scheme, a user can add a signature and/or a plurality of stamps on a paper document, so that a plurality of electronic signatures can be generated through one paper document.
In an exemplary embodiment, the trimming frame includes a first trimming frame corresponding to the signature and/or a second trimming frame corresponding to the stamp.
In this embodiment, the size parameter of the first trimming frame and the size parameter of the second trimming frame may be the same or may not be the same.
In an exemplary instance, the processing the region of the to-be-processed picture other than the target object, and generating the to-be-uploaded picture includes:
removing the background color of the region except the target object in the picture to be processed;
and taking the picture subjected to the background color removal processing as a picture to be uploaded.
In an exemplary instance, the removing the background color of the region of the to-be-processed picture outside the target object includes:
taking the picture to be processed as a base map of the newly created canvas;
removing color values of all points meeting a removal condition in the canvas according to the color values of the selected points on the canvas;
wherein the removal conditions include: the absolute value of the difference value of the color value of the selected point is less than or equal to a set threshold value; the selected point is located in the target object.
For example, the threshold may be set to 20. In other embodiments, the threshold may be set to other values.
In an exemplary instance, the removing color values of all points in the canvas that satisfy a removal condition according to the color values of the selected points on the canvas comprises:
determining RGBA (color space representing Red (Red) Green (Green) Blue (Blue) and Alpha) values of the selected point according to the offset of the selected point;
modifying the RGBA values of all points meeting the removal condition to be zero in a Unit8Array (8-bit unsigned integer Array) of the canvas, wherein the Unit8Array contains the RGBA value of each point of the canvas;
and updating the canvas according to the updated Unit8 Array.
In this embodiment, the Unit8Array is an 8-bit unsigned integer Array, which is an Array of RGBA values corresponding to the canvas.
In an exemplary example, the taking the picture subjected to the under color removal processing as the picture to be uploaded includes:
and saving the updated canvas as a picture to be uploaded.
By the technical scheme, the colors of the areas except the target object can be removed, so that the picture can be displayed only by the target object, and the signature is electronized.
In an exemplary example, before the step of using a portion of a trimming frame provided on an original picture as a picture to be processed, the method further includes:
setting a size parameter of the first cutting frame corresponding to the signature;
and setting the size parameter of the second cutting frame corresponding to the type of seal according to the physical size corresponding to the preset type of seal.
In this embodiment, the size parameters of the first cutting frame and the second cutting frame may be preset. The size parameters of the first cutting frame and the second cutting frame which are set before can be updated. The size parameters of the first and second cutting frames may include the length and width of the cutting frame, the length-width ratio, and the like.
In this embodiment, the physical dimensions corresponding to different types of seals are different, and the number of the size parameters of the second cutting frame may be multiple, for example, the diameter of a work meeting seal, a national corporate seal, and the like is 4.2cm, and the diameter of a special seal is 4.0cm, so that the size parameters of the second cutting frame can be set for each type of seal. For example, the PX (Pixel) value may be converted from the DPI (Dots Per Inch) of the stamp according to the physical size of the stamp, and then the size parameter of the second trimming frame may be set according to the PX value.
As shown in fig. 2, the present embodiment further provides an image processing apparatus, including: a memory 10 and a processor 11;
the memory 10 is used for storing programs for picture processing;
the processor 11 is configured to read the program for processing pictures, and execute the following operations:
taking a part in a trimming frame arranged on an original picture as a picture to be processed;
processing the region except the target object in the picture to be processed to generate a picture to be uploaded;
the cutting frame contains the target object, and the target object is a signature or a seal.
In an exemplary example, the number of the trimming frames is one or more;
the number of the pictures to be processed is one or more.
In an exemplary embodiment, the trimming frame includes a first trimming frame corresponding to the signature and/or a second trimming frame corresponding to the stamp.
In an exemplary instance, the processing the region of the to-be-processed picture other than the target object, and generating the to-be-uploaded picture includes:
removing the background color of the region except the target object in the picture to be processed;
and taking the picture subjected to the background color removal processing as a picture to be uploaded.
In an exemplary instance, the removing the background color of the region of the to-be-processed picture outside the target object includes:
taking the picture to be processed as a base map of the newly created canvas;
removing color values of all points meeting a removal condition in the canvas according to the color values of the selected points on the canvas;
wherein the removal conditions include: the absolute value of the difference value of the color value of the selected point is less than or equal to a set threshold value; the selected point is located in the target object.
In an exemplary instance, the removing color values of all points in the canvas that satisfy a removal condition according to the color values of the selected points on the canvas comprises:
determining an RGBA value of the selected point according to the offset of the selected point;
modifying RGBA values of all points meeting the removal condition into zero in a Unit8Array of the canvas, wherein the Unit8Array contains the RGBA value of each point of the canvas;
and updating the canvas according to the updated Unit8 Array.
In an exemplary example, the taking the picture subjected to the under color removal processing as the picture to be uploaded includes:
and saving the updated canvas as a picture to be uploaded.
In an exemplary embodiment, the processor 11, configured to read the program for picture processing, further performs the following operations:
before the part of the cutting frame arranged on the original picture is used as the picture to be processed, setting a size parameter of a first cutting frame corresponding to the signature;
and setting the size parameter of the second cutting frame corresponding to the type of seal according to the physical size corresponding to the preset type of seal.
According to the technical scheme, the corresponding electronic signature can be generated through the electronic picture containing the signature and/or the seal, so that the electronic signature can be generated more simply and conveniently.
The present embodiment also provides a computer storage medium having a computer program stored thereon, wherein the computer program is configured to perform any of the methods described above when executed.
It will be understood by those of ordinary skill in the art that all or some of the steps of the methods, systems, functional modules/units in the devices disclosed above may be implemented as software, firmware, hardware, and suitable combinations thereof. In a hardware implementation, the division between functional modules/units mentioned in the above description does not necessarily correspond to the division of physical components; for example, one physical component may have multiple functions, or one function or step may be performed by several physical components in cooperation. Some or all of the components may be implemented as software executed by a processor, such as a digital signal processor or microprocessor, or as hardware, or as an integrated circuit, such as an application specific integrated circuit. Such software may be distributed on computer readable media, which may include computer storage media (or non-transitory media) and communication media (or transitory media). The term computer storage media includes volatile and nonvolatile, removable and non-removable media implemented in any method or technology for storage of information such as computer readable instructions, data structures, program modules or other data, as is well known to those of ordinary skill in the art. Computer storage media includes, but is not limited to, RAM, ROM, EEPROM, flash memory or other memory technology, CD-ROM, Digital Versatile Disks (DVD) or other optical disk storage, magnetic cassettes, magnetic tape, magnetic disk storage or other magnetic storage devices, or any other medium which can be used to store the desired information and which can accessed by a computer. In addition, communication media typically embodies computer readable instructions, data structures, program modules or other data in a modulated data signal such as a carrier wave or other transport mechanism and includes any information delivery media as known to those skilled in the art.

Claims (10)

1. A picture processing method comprises the following steps:
taking a part in a trimming frame arranged on an original picture as a picture to be processed;
processing the region except the target object in the picture to be processed to generate a picture to be uploaded;
the cutting frame contains the target object, and the target object is a signature or a seal.
2. The method of claim 1, wherein:
the number of the cutting frames is one or more;
the number of the pictures to be processed is one or more.
3. The method of claim 1, wherein:
the cutting frame comprises a first cutting frame corresponding to the signature and/or a second cutting frame corresponding to the seal.
4. The method of claim 1, wherein the processing the region of the to-be-processed picture other than the target object to generate the to-be-uploaded picture comprises:
removing the background color of the region except the target object in the picture to be processed;
and taking the picture subjected to the background color removal processing as a picture to be uploaded.
5. The method as claimed in claim 4, wherein said removing the background color of the region of the picture to be processed other than the target object comprises:
taking the picture to be processed as a base map of the newly created canvas;
removing color values of all points meeting a removal condition in the canvas according to the color values of the selected points on the canvas;
wherein the removal conditions include: the absolute value of the difference value of the color value of the selected point is less than or equal to a set threshold value; the selected point is located in the target object.
6. The method of claim 5, wherein the removing color values of all points in the canvas that satisfy a removal condition according to the color values of the selected points on the canvas comprises:
determining a color space RGBA value of the selected point according to the offset of the selected point;
modifying RGBA values of all points meeting the removal condition into zero in a Unit8Array of the canvas, wherein the Unit8Array contains the RGBA value of each point of the canvas;
and updating the canvas according to the updated Unit8 Array.
7. The method according to claim 6, wherein the step of taking the picture subjected to the background color removal processing as the picture to be uploaded comprises the following steps:
and saving the updated canvas as a picture to be uploaded.
8. The method of claim 3, wherein before the portion of the cropping frame provided on the original picture is taken as the picture to be processed, the method further comprises:
setting a size parameter of the first cutting frame corresponding to the signature;
and setting the size parameter of the second cutting frame corresponding to the type of seal according to the physical size corresponding to the preset type of seal.
9. A picture processing apparatus comprising: a memory and a processor; the method is characterized in that:
the memory is used for storing a program for picture processing;
the processor, configured to read the program for picture processing, and execute the method according to any one of claims 1 to 8.
10. A computer storage medium, in which a computer program is stored, wherein the computer program is arranged to perform the method of any of claims 1 to 8 when executed.
CN202010580448.0A 2020-06-23 2020-06-23 Picture processing method and device Pending CN111815646A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202010580448.0A CN111815646A (en) 2020-06-23 2020-06-23 Picture processing method and device

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202010580448.0A CN111815646A (en) 2020-06-23 2020-06-23 Picture processing method and device

Publications (1)

Publication Number Publication Date
CN111815646A true CN111815646A (en) 2020-10-23

Family

ID=72846455

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202010580448.0A Pending CN111815646A (en) 2020-06-23 2020-06-23 Picture processing method and device

Country Status (1)

Country Link
CN (1) CN111815646A (en)

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN114302226A (en) * 2021-12-28 2022-04-08 北京中科大洋信息技术有限公司 Intelligent cutting method for video picture

Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
EP0643513A2 (en) * 1993-09-15 1995-03-15 Gemplus Developpement Method for verifying signatures in a communication system
CN110599394A (en) * 2019-09-12 2019-12-20 北京字节跳动网络技术有限公司 Method and device for processing pictures in online presentation, storage medium and equipment
CN111127580A (en) * 2019-12-30 2020-05-08 北京天威诚信电子商务服务有限公司 User-defined signature generation method, computer tool, subscription method and system
CN111145307A (en) * 2019-11-27 2020-05-12 河北省电子认证有限公司 Method for automatically making electronic signature

Patent Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
EP0643513A2 (en) * 1993-09-15 1995-03-15 Gemplus Developpement Method for verifying signatures in a communication system
CN110599394A (en) * 2019-09-12 2019-12-20 北京字节跳动网络技术有限公司 Method and device for processing pictures in online presentation, storage medium and equipment
CN111145307A (en) * 2019-11-27 2020-05-12 河北省电子认证有限公司 Method for automatically making electronic signature
CN111127580A (en) * 2019-12-30 2020-05-08 北京天威诚信电子商务服务有限公司 User-defined signature generation method, computer tool, subscription method and system

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN114302226A (en) * 2021-12-28 2022-04-08 北京中科大洋信息技术有限公司 Intelligent cutting method for video picture

Similar Documents

Publication Publication Date Title
CN111312141B (en) Color gamut adjusting method and device
US8121436B2 (en) Methods and systems for image scaling
US20140185104A1 (en) Image processing device and computer-readable storage medium storing computer-readable instructions
CN112767312A (en) Image processing method and device, storage medium and processor
JP2007241356A (en) Image processor and image processing program
CN111815646A (en) Picture processing method and device
KR102315471B1 (en) Image processing method and device
CN108230487A (en) The method and apparatus of shared camera resource
US7599552B2 (en) Image processing apparatus, and color correction method and lookup table
JP2010010976A (en) Photographic image processing method, photographic image processing program, and photographic image processing device
EP1538822A1 (en) Image control apparatus, image control method and program
US10079959B2 (en) Creating image data for a tile on an image
CN113011432A (en) Two-dimensional code layered display and identification method and device
CN105825476B (en) A kind of quick Overlap-scanning mode of image applied to DSP
US6707998B2 (en) Method and system for correcting non-symmetric distortion in an image
JP2006229280A (en) Image processing apparatus and method, and program and recording medium
CN111028135B (en) Image file repairing method
CN108200433B (en) Image compression and decompression method
CN113194317A (en) Image processing method and device
JP2010033527A (en) Method, program, and apparatus for processing photographic image
CN108053459B (en) Signature file synthesis method, application server and computer readable storage medium
CN109064543A (en) A kind of graphical textures load rendering method
CN102724425A (en) Television image and text template broadcasting method
US8406550B2 (en) Electronic device and method for filtering noise in an image
EP2851847A1 (en) Method and apparatus for storing data

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