CN109697722A - For generating the method and device of three components - Google Patents

For generating the method and device of three components Download PDF

Info

Publication number
CN109697722A
CN109697722A CN201710994495.8A CN201710994495A CN109697722A CN 109697722 A CN109697722 A CN 109697722A CN 201710994495 A CN201710994495 A CN 201710994495A CN 109697722 A CN109697722 A CN 109697722A
Authority
CN
China
Prior art keywords
image
pixel
components
predetermined
value
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
CN201710994495.8A
Other languages
Chinese (zh)
Other versions
CN109697722B (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.)
Beijing Jingdong Century Trading Co Ltd
Beijing Jingdong Shangke Information Technology Co Ltd
Original Assignee
Beijing Jingdong Century Trading Co Ltd
Beijing Jingdong Shangke Information Technology 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 Jingdong Century Trading Co Ltd, Beijing Jingdong Shangke Information Technology Co Ltd filed Critical Beijing Jingdong Century Trading Co Ltd
Priority to CN201710994495.8A priority Critical patent/CN109697722B/en
Publication of CN109697722A publication Critical patent/CN109697722A/en
Application granted granted Critical
Publication of CN109697722B publication Critical patent/CN109697722B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06TIMAGE DATA PROCESSING OR GENERATION, IN GENERAL
    • G06T7/00Image analysis
    • G06T7/10Segmentation; Edge detection
    • G06T7/12Edge-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
    • G06T7/00Image analysis
    • G06T7/10Segmentation; Edge detection
    • G06T7/187Segmentation; Edge detection involving region growing; involving region merging; involving connected component labelling
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06TIMAGE DATA PROCESSING OR GENERATION, IN GENERAL
    • G06T7/00Image analysis
    • G06T7/10Segmentation; Edge detection
    • G06T7/194Segmentation; Edge detection involving foreground-background segmentation
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06TIMAGE DATA PROCESSING OR GENERATION, IN GENERAL
    • G06T2200/00Indexing scheme for image data processing or generation, in general
    • G06T2200/28Indexing scheme for image data processing or generation, in general involving image processing hardware

Landscapes

  • Engineering & Computer Science (AREA)
  • Computer Vision & Pattern Recognition (AREA)
  • Physics & Mathematics (AREA)
  • General Physics & Mathematics (AREA)
  • Theoretical Computer Science (AREA)
  • Image Processing (AREA)
  • Image Analysis (AREA)

Abstract

The application discloses a kind of for generating the method and device of three components.It is related to digital image processing field, this method comprises: carrying out image procossing to predetermined image generates the first image, the first image is bianry image;According to the pixel in predefined parameter and the first image, pixel location data is generated;All pixels in the first image are subjected to pixel value judgement with surrounding pixel by the pixel location data, the second image is generated according to judging result;And by the first image and second image, generate three components of predetermined image.The method and device disclosed in the present application for being used to generate three components, can generate three components on the basis of only bianry image, and improve the efficiency for generating three components.

Description

For generating the method and device of three components
Technical field
The present invention relates to digital image processing fields, in particular to a kind of for generating the method and dress of three components It sets.
Background technique
Scratching figure (image matting) is a kind of special image Segmentation Technology, it is therefore an objective to divide the image into several spies Fixed, with unique properties region and the technology and process for proposing interesting target, it is by image procossing to image analysis Committed step.In scratching diagram technology, during carrying out Video Composition, through further being located frequently with bianry image Reason.Bianry image is that the image obtained by image segmentation only exists object prospect and object background in bianry image, is schemed Each pixel as in either belongs to prospect or belongs to background.Wherein, in bianry image, the attribute value of image is divided into prospect And background, the pixel number of object foreground part are arranged to 0, object background is arranged to 255.Since bianry image is single-pass Road image, and in the processing of stingy diagram technology, it carries out needing to calculate the transparency at object edge when image synthesis, so scratching figure In technology, the input picture needed is three components.In three components, there are foreground part, background parts and uncertain region, three The different pixel number of kind.Wherein foreground part pixel placement is 255, and background parts pixel placement is 0, uncertain region pixel Value is set as 128.
In the prior art, there is following mode to handle bianry image and generate three components.Application number: Patent in CN201710115845.9 discloses a kind of quick stingy drawing method of uniform background image.By being adopted to image boundary The background colour of sample automatic identification image, and RGB color model is converted into HSI color model, the influence of illumination is reduced, thus real The automatic segmentation of existing foreground and background;Secondly, by obtaining three components to the corrosion of foreground and background respectively.Application number: The patent of CN201510260422.7.It discloses a kind of based on super-pixel and the display foreground extracting method of quick three component.It adopts Super-pixel pretreatment is carried out with algorithm;According to extracted super-pixel block, average color feature and position of centre of gravity coordinate etc. are extracted Super-pixel feature;Then preliminary hard segmenting edge is smoothed to obtain, extracts foreground image output.Above various sides In method, three components are produced, but is required to comprehensively consider full graphics image and then extracts three components, efficiency of actual all compares It is low.
Therefore, it is necessary to a kind of new method and devices for being used to generate three components.
Above- mentioned information are only used for reinforcing the understanding to background of the invention, therefore it disclosed in the background technology part It may include the information not constituted to the prior art known to persons of ordinary skill in the art.
Summary of the invention
In view of this, the present invention provide it is a kind of for generating the method and device of three components, can be in only bianry image On the basis of generate three components, and improve generate three components efficiency.
Other characteristics and advantages of the invention will be apparent from by the following detailed description, or partially by the present invention Practice and acquistion.
According to an aspect of the invention, it is proposed that a kind of method for generating three components, this method comprises: to predetermined image Carry out image procossing generate the first image, the first image is bianry image;According to predefined parameter and the first image In pixel, generate pixel location data;By the pixel location data by all pixels in the first image Point carries out pixel value judgement with surrounding pixel, generates the second image according to judging result;And pass through first figure Picture and second image, generate three components of predetermined image.
In a kind of exemplary embodiment of the disclosure, further includes: carry out the predetermined image by three component FIG pull handle.
In a kind of exemplary embodiment of the disclosure, the carry out image procossing to predetermined image generates the first figure Picture, comprising: image dividing processing is carried out to the predetermined image, obtains segmentation data;And it is generated by the segmentation data First image.
In a kind of exemplary embodiment of the disclosure, the pixel according in predefined parameter and the first image Point generates pixel location data, comprising: determine parameter preset numerical value;Around each pixel in the first image, lead to It crosses the parameter preset and generates predetermined pixel location data;And the pixel location data is marked by default value.
It is described that predetermined location of pixels number is generated by the parameter preset in a kind of exemplary embodiment of the disclosure According to, comprising: N=(2 × M+1)2-1;Wherein, N is predetermined pixel quantity, and M is parameter preset, and is positive integer.
In a kind of exemplary embodiment of the disclosure, it is described will be in the first image by the pixel location data All pixels and surrounding pixel carry out pixel value judgement, according to judging result generate the second image, comprising: obtain Take the pixel i in the first imagen;Pixel i is obtained according to the pixel location datanThe N number of pixel of surrounding;By pixel inPixel value be compared respectively with the pixel value of pixel N number of around it;And work as pixel inPixel value and its week When enclosing the pixel value difference of N number of pixel, by the pixel inIt is set as predetermined value.
In a kind of exemplary embodiment of the disclosure, further includes: the pixel being successively read in the first image, and Pixel value comparison is carried out, until pixel all in traversal the first image.
In a kind of exemplary embodiment of the disclosure, further includes: by pixel value comparison result, generate second figure Picture.
It is described by the first image and second image in a kind of exemplary embodiment of the disclosure, it generates Three components of predetermined image, comprising: generate third image identical with the first image size, all pictures of third image Element value is 255;The 4th image identical with the first image size is generated, the 4th image all pixels value is 128;With And by second image, the third image generates three components of the predetermined image with the 4th image.
It is described by second image in a kind of exemplary embodiment of the disclosure, the third image with it is described 4th image generates three components of the predetermined image, comprising: described by second image by three component calculation formula Third image and the 4th image carry out three components that image superposition generates the predetermined image;
Wherein three component calculation formula are as follows:
Itrimap=Ibinary-Itemp1+Itemp2
Wherein ItrimapFor three components, IbinaryFor second image, Itemp1For the third image, Itemp2It is described 4th image.
According to an aspect of the invention, it is proposed that a kind of method for generating three components, this method comprises: the first module, The first image is generated for the carry out image procossing to predetermined image, the first image is bianry image;Position module is used for According to the pixel in predefined parameter and the first image, pixel location data is generated;Judgment module, for passing through the picture Plain position data by the first image all pixels and surrounding pixel carry out pixel value judgement, according to sentencing Disconnected result generates the second image;And three component modules, for generating predetermined by the first image and second image Three components of image.
In a kind of exemplary embodiment of the disclosure, further includes: module is scratched, for carrying out institute by three component State the FIG pull handle of predetermined image.
The method and device according to the present invention for being used to generate three components, can generate on the basis of only bianry image Three components, and improve the efficiency for generating three components.
It should be understood that the above general description and the following detailed description are merely exemplary, this can not be limited Invention.
Detailed description of the invention
Its example embodiment is described in detail by referring to accompanying drawing, above and other target of the invention, feature and advantage will It becomes more fully apparent.Drawings discussed below is only some embodiments of the present invention, for the ordinary skill of this field For personnel, without creative efforts, it is also possible to obtain other drawings based on these drawings.
Fig. 1 is shown according to an exemplary embodiment a kind of for generating the system architecture of the method for three components.
Fig. 2 is shown according to an exemplary embodiment a kind of for generating the flow chart of the method for three components.
Fig. 3 is schematic diagram in a kind of method for generating three components shown according to another exemplary embodiment.
Fig. 4 be show according to another exemplary embodiment it is a kind of for generating the flow chart of the method for three components.
Fig. 5 is that image procossing is illustrated in a kind of method for generating three components shown according to an exemplary embodiment Figure.
Fig. 6 is that image procossing is illustrated in a kind of method for generating three components shown according to an exemplary embodiment Figure.
Fig. 7 is that image procossing is illustrated in a kind of method for generating three components shown according to an exemplary embodiment Figure.
Fig. 8 is shown according to an exemplary embodiment a kind of for generating the block diagram of the device of three components.
Fig. 9 is the block diagram of a kind of electronic equipment shown according to an exemplary embodiment.
Figure 10 is a kind of computer-readable medium schematic diagram shown according to an exemplary embodiment.
Specific embodiment
Example embodiment is described more fully with reference to the drawings.However, example embodiment can be real in a variety of forms It applies, and is not understood as limited to embodiment set forth herein;On the contrary, thesing embodiments are provided so that the present invention will be comprehensively and complete It is whole, and the design of example embodiment is comprehensively communicated to those skilled in the art.Identical appended drawing reference indicates in figure Same or similar part, thus repetition thereof will be omitted.
In addition, described feature, structure or characteristic can be incorporated in one or more implementations in any suitable manner In example.In the following description, many details are provided to provide and fully understand to the embodiment of the present invention.However, It will be appreciated by persons skilled in the art that technical solution of the present invention can be practiced without one or more in specific detail, Or it can be using other methods, constituent element, device, step etc..In other cases, it is not shown in detail or describes known side Method, device, realization or operation are to avoid fuzzy each aspect of the present invention.
Block diagram shown in the drawings is only functional entity, not necessarily must be corresponding with physically separate entity. I.e., it is possible to realize these functional entitys using software form, or realized in one or more hardware modules or integrated circuit These functional entitys, or these functional entitys are realized in heterogeneous networks and/or processor device and/or microcontroller device.
Flow chart shown in the drawings is merely illustrative, it is not necessary to including all content and operation/step, It is not required to execute by described sequence.For example, some operation/steps can also decompose, and some operation/steps can close And or part merge, therefore the sequence actually executed is possible to change according to the actual situation.
It should be understood that although herein various assemblies may be described using term first, second, third, etc., these groups Part should not be limited by these terms.These terms are to distinguish a component and another component.Therefore, first group be discussed herein below Part can be described as the second component without departing from the teaching of disclosure concept.As used herein, term " and/or " include associated All combinations for listing any of project and one or more.
It will be understood by those skilled in the art that attached drawing is the schematic diagram of example embodiment, module or process in attached drawing Necessary to not necessarily implementing the present invention, therefore it cannot be used for limiting the scope of the invention.
Disclosure example embodiment is described in detail with reference to the accompanying drawing.
Fig. 1 is shown according to an exemplary embodiment a kind of for generating the system architecture of the method for three components.
As shown in Figure 1, system architecture 100 may include terminal device 101,102,103, network 104 and server 105. Network 104 between terminal device 101,102,103 and server 105 to provide the medium of communication link.Network 104 can be with Including various connection types, such as wired, wireless communication link or fiber optic cables etc..
User can be used terminal device 101,102,103 and be interacted by network 104 with server 105, to receive or send out Send message etc..Various telecommunication customer end applications, such as the application of shopping class, net can be installed on terminal device 101,102,103 The application of page browsing device, searching class application, instant messaging tools, mailbox client, social platform software etc..
Terminal device 101,102,103 can be the various electronic equipments with display screen and supported web page browsing, packet Include but be not limited to smart phone, tablet computer, pocket computer on knee and desktop computer etc..
Server 105 can be to provide the server of various services, such as utilize terminal device 101,102,103 to user The image processing requests submitted are handled.Back-stage management server the data such as the request received such as can analyze Processing, and processing result (such as processing result image, FIG pull handle result etc.) is fed back into terminal device.
It should be understood that the number of terminal device, network and server in Fig. 1 is only schematical.According to realization need It wants, can have any number of terminal device, network and server.
Fig. 2 is shown according to an exemplary embodiment a kind of for generating the flow chart of the method for three components.
As shown in Fig. 2, carrying out image procossing in S202 to predetermined image and generating the first image, the first image is Bianry image.It can for example, image dividing processing is carried out to the predetermined image, obtains segmentation data;And by described Divide data and generates the first image.As described above, in the first image, the pixel number of object foreground part is arranged to 0, Object background is arranged to 255.Image segmentation is commonly used in the object and boundary (line, curve etc.) in positioning image.Image point Cutting is the tagged process of each pixel in image, this process makes the pixel with same label have certain Common visual characteristic.Image segmentation the result is that the set of image sub-zones, or the collection of contour line extracted from image It closes.In one sub-regions each pixel is under the measurement of certain characteristic or the characteristic by being calculated is similar, example Such as color, brightness, texture.Neighboring region is very different under the measurement of certain characteristic.Common image segmentation algorithm packet Include: the method based on edge detection, threshold segmentation method, region growing, regional split merging etc., the application is not limited.
In S204, according to the pixel in predefined parameter and the first image, pixel location data is generated.It can be such as Comprise determining that parameter preset numerical value;Around each pixel in the first image, generated by the parameter preset pre- Fixed pixel location data;And the pixel location data is marked by default value.Wherein, described by described default Parameter generates predetermined pixel location data, comprising: N=(2 × M+1)2-1;Wherein, N is predetermined pixel quantity, and M is default Parameter, and be positive integer.
In one embodiment, a series of pixel location data is generated by the following method.If the picture of segmenting edge Element outwardly and inwardly extends 1 pixel simultaneously, can for example be denoted as M=1, and the location of pixels of generation is that-M arrives M, do not include origin (0, 0).The number for generating pixel is N=(2 × M+1)2- 1, wherein M is parameter preset, and is positive integer.It can refer to the example of Fig. 3, As M=1, the pixel location data of some pixel to be calculated is 8, as M=2, some pixel to be calculated Pixel location data is 25.It also may be, for example, these location of pixels assignment, to distinguish, pixel value can for example such as Shown in Fig. 3.
In another embodiment, the pixel of segmenting edge outwardly and inwardly extends 2 pixels simultaneously, is denoted as M=2.It can join The example for examining Fig. 3, as M=2, the pixel location data of some pixel to be calculated is 25.It also may be, for example, these pictures Plain position assignment, to distinguish, the value of location of pixels can for example as shown in Figure 3.
In S206, by the pixel location data by the first image all pixels with it is surrounding Pixel carries out pixel value judgement, generates the second image according to judging result.It can be for example, for each of the first image picture Element, compared with carrying out the numerical value of pixel value with other surrounding N number of pixels.Compared according to numerical value as a result, to pixel is represented The attribute value in the region carries out assignment (setting it to uncertain region) again, to generate the second image.
In S208, by the first image and second image, three components of predetermined image are generated.Generation and institute The identical third image of the first picture size is stated, the third image all pixels value is 255;It generates and the first image ruler Very little identical 4th image, the 4th image all pixels value are 128;And by second image, the third image Image superposition is carried out with the 4th image to generate three components of predetermined image.
Method according to the present invention for generating three components, by being compared to each pixel in bianry image It calculates, obtains uncertain region, and then generate the mode of three components, three points can be generated on the basis of only bianry image Figure, and improve the efficiency for generating three components.
In a kind of exemplary embodiment of the disclosure, further includes: carry out the predetermined image by three component FIG pull handle.Figure can be scratched for example including Bayes in image FIG pull handle field, kNN scratches figure and Poisson scratches figure (Poisson ) etc. Matting Processing Algorithm, will for example can be inputted in above-mentioned stingy nomography by the present processes, be handled.
It will be clearly understood that the present disclosure describe how being formed and using particular example, but the principle of the present invention is not limited to These exemplary any details.On the contrary, the introduction based on present disclosure, these principles can be applied to many other Embodiment.
Fig. 4 be show according to another exemplary embodiment it is a kind of for generating the flow chart of the method for three components.
Wherein, in S402, the pixel i in the first image is obtainedn
In S404, pixel i is obtained according to the pixel location datanThe N number of pixel of surrounding.It can be for example, working as M= When 2,25 other pixels in pixel peripheral location to be calculated are obtained.
In S406, by pixel inPixel value be compared respectively with the pixel value of pixel N number of around it.Wherein It can be for example, reading the pixel value of 25 other pixels.Since the first pixel map is bianry image, so pixel value may be 255, it is also possible to be 0.
In S408, when by pixel inPixel value and around it when the pixel value difference of N number of pixel, by the picture Vegetarian refreshments inAttribute value be set as predetermined value.It can be for example, working as pixel inPixel value and around it N number of pixel pixel value When different, by pixel inIt is considered as uncertain region, and then by pixel inPixel value be assigned a value of 128.As pixel inWith week Enclose 25 pixels numerical value it is all right identical when, keep pixel inRaw value it is constant.
In S410, judges whether to have stepped through pixel all in the first image, if not traversing completion, continue Pixel is read to be handled.If having stepped through completion, enter S412.
In S412, the second image is generated.It can be for example, the first image after pixel value again assignment processing be made For the second image.
It is described by the first image and second image in a kind of exemplary embodiment of the disclosure, it generates Three components of predetermined image, comprising: generate third image identical with the first image size, all pictures of third image Element value is 255;The 4th image identical with the first image size is generated, the 4th image all pixels value is 128;With And by second image, the third image generates three components of the predetermined image with the 4th image.
It is described by second image in a kind of exemplary embodiment of the disclosure, the third image with it is described 4th image generates three components of the predetermined image, comprising: described by second image by three component calculation formula Third image and the 4th image carry out three components that image superposition generates the predetermined image;
Wherein three component calculation formula are as follows:
Itrimap=Ibinary-Itemp1+Itemp2
Wherein ItrimapFor three components, IbinaryFor second image, Itemp1For the third image, Itemp2It is described 4th image.
Fig. 5,6,7 be that image procossing shows in a kind of method for generating three components shown according to an exemplary embodiment It is intended to.Wherein, Fig. 5 is the predetermined input picture shown according to an exemplary embodiment, and Fig. 6 is to be shown according to an exemplary embodiment The first image by image dividing processing out, Fig. 6 is bianry image, as only two kinds of pixels of black and white.Fig. 7 is according to one The three component effects after processes pixel in the present invention shown in exemplary embodiment.
It will be appreciated by those skilled in the art that realizing that all or part of the steps of above-described embodiment is implemented as being executed by CPU Computer program.When the computer program is executed by CPU, above-mentioned function defined by the above method provided by the invention is executed Energy.The program can store in a kind of computer readable storage medium, which can be read-only memory, magnetic Disk or CD etc..
Further, it should be noted that above-mentioned attached drawing is only place included by method according to an exemplary embodiment of the present invention Reason schematically illustrates, rather than limits purpose.It can be readily appreciated that above-mentioned processing shown in the drawings is not indicated or is limited at these The time sequencing of reason.In addition, be also easy to understand, these processing, which can be, for example either synchronously or asynchronously to be executed in multiple modules.
Following is apparatus of the present invention embodiment, can be used for executing embodiment of the present invention method.For apparatus of the present invention reality Undisclosed details in example is applied, embodiment of the present invention method is please referred to.
Fig. 8 is shown according to an exemplary embodiment a kind of for generating the block diagram of the device of three components.
First module 802 is used to generate the first image, the first image two to the carry out image procossing of predetermined image It is worth image.
Position module 804 is used to generate pixel location data according to the pixel in predefined parameter and the first image.
Judgment module 806 be used for by the pixel location data by the first image all pixels and its The pixel of surrounding carries out pixel value judgement, generates the second image according to judging result.
Three component modules 808 are used to generate three components of predetermined image by the first image and second image.
In a kind of exemplary embodiment of the disclosure, further includes: module (not shown) is scratched, for by described Three components carry out the FIG pull handle of the predetermined image.
The device according to the present invention for being used to generate three components, by being compared to each pixel in bianry image It calculates, obtains uncertain region, and then generate the mode of three components, three points can be generated on the basis of only bianry image Figure, and improve the efficiency for generating three components.
Fig. 9 is the block diagram of a kind of electronic equipment shown according to an exemplary embodiment.
The electronic equipment 200 of this embodiment according to the present invention is described referring to Fig. 9.The electronics that Fig. 9 is shown Equipment 200 is only an example, should not function to the embodiment of the present invention and use scope bring any restrictions.
As shown in figure 9, electronic equipment 200 is showed in the form of universal computing device.The component of electronic equipment 200 can wrap It includes but is not limited to: at least one processing unit 210, at least one storage unit 220, (including the storage of the different system components of connection Unit 220 and processing unit 210) bus 230, display unit 240 etc..
Wherein, the storage unit is stored with program code, and said program code can be held by the processing unit 210 Row, so that the processing unit 210 executes described in this specification above-mentioned electronic prescription circulation processing method part according to this The step of inventing various illustrative embodiments.For example, the processing unit 210 can execute the step as shown in Fig. 2 and Fig. 3 Suddenly.
The storage unit 220 may include the readable medium of volatile memory cell form, such as random access memory Unit (RAM) 2201 and/or cache memory unit 2202 can further include read-only memory unit (ROM) 2203.
The storage unit 220 can also include program/practical work with one group of (at least one) program module 2205 Tool 2204, such program module 2205 includes but is not limited to: operating system, one or more application program, other programs It may include the realization of network environment in module and program data, each of these examples or certain combination.
Bus 230 can be to indicate one of a few class bus structures or a variety of, including storage unit bus or storage Cell controller, peripheral bus, graphics acceleration port, processing unit use any bus structures in a variety of bus structures Local bus.
Electronic equipment 200 can also be with one or more external equipments 300 (such as keyboard, sensing equipment, bluetooth equipment Deng) communication, can also be enabled a user to one or more equipment interact with the electronic equipment 200 communicate, and/or with make Any equipment (such as the router, modulation /demodulation that the electronic equipment 200 can be communicated with one or more of the other calculating equipment Device etc.) communication.This communication can be carried out by input/output (I/O) interface 250.Also, electronic equipment 200 can be with By network adapter 260 and one or more network (such as local area network (LAN), wide area network (WAN) and/or public network, Such as internet) communication.Network adapter 260 can be communicated by bus 230 with other modules of electronic equipment 200.It should Understand, although not shown in the drawings, other hardware and/or software module can be used in conjunction with electronic equipment 200, including but unlimited In: microcode, device driver, redundant processing unit, external disk drive array, RAID system, tape drive and number According to backup storage system etc..
Through the above description of the embodiments, those skilled in the art is it can be readily appreciated that example described herein is implemented Mode can also be realized by software realization in such a way that software is in conjunction with necessary hardware.Therefore, according to the disclosure The technical solution of embodiment can be embodied in the form of software products, which can store non-volatile at one Property storage medium (can be CD-ROM, USB flash disk, mobile hard disk etc.) in or network on, including some instructions are so that a calculating Equipment (can be personal computer, server or network equipment etc.) executes the above-mentioned electronics according to disclosure embodiment Prescription circulation processing method.
Figure 10 is a kind of computer-readable medium schematic diagram shown according to an exemplary embodiment.
Refering to what is shown in Fig. 10, describing the program product for realizing the above method of embodiment according to the present invention 400, can using portable compact disc read only memory (CD-ROM) and including program code, and can in terminal device, Such as it is run on PC.However, program product of the invention is without being limited thereto, in this document, readable storage medium storing program for executing can be with To be any include or the tangible medium of storage program, the program can be commanded execution system, device or device use or It is in connection.
Described program product can be using any combination of one or more readable mediums.Readable medium can be readable letter Number medium or readable storage medium storing program for executing.Readable storage medium storing program for executing for example can be but be not limited to electricity, magnetic, optical, electromagnetic, infrared ray or System, device or the device of semiconductor, or any above combination.The more specific example of readable storage medium storing program for executing is (non exhaustive List) include: electrical connection with one or more conducting wires, portable disc, hard disk, random access memory (RAM), read-only Memory (ROM), erasable programmable read only memory (EPROM or flash memory), optical fiber, portable compact disc read only memory (CD-ROM), light storage device, magnetic memory device or above-mentioned any appropriate combination.
The computer readable storage medium may include in a base band or the data as the propagation of carrier wave a part are believed Number, wherein carrying readable program code.The data-signal of this propagation can take various forms, including but not limited to electromagnetism Signal, optical signal or above-mentioned any appropriate combination.Readable storage medium storing program for executing can also be any other than readable storage medium storing program for executing Readable medium, the readable medium can send, propagate or transmit for by instruction execution system, device or device use or Person's program in connection.The program code for including on readable storage medium storing program for executing can transmit with any suitable medium, packet Include but be not limited to wireless, wired, optical cable, RF etc. or above-mentioned any appropriate combination.
The program for executing operation of the present invention can be write with any combination of one or more programming languages Code, described program design language include object oriented program language-Java, C++ etc., further include conventional Procedural programming language-such as " C " language or similar programming language.Program code can be fully in user It calculates and executes in equipment, partly executes on a user device, being executed as an independent software package, partially in user's calculating Upper side point is executed on a remote computing or is executed in remote computing device or server completely.It is being related to far Journey calculates in the situation of equipment, and remote computing device can pass through the network of any kind, including local area network (LAN) or wide area network (WAN), it is connected to user calculating equipment, or, it may be connected to external computing device (such as utilize ISP To be connected by internet).
Above-mentioned computer-readable medium carries one or more program, when said one or multiple programs are by one When the equipment executes, so that the computer-readable medium implements function such as: generating the to the carry out image procossing of predetermined image One image, the first image are bianry image;According to the pixel in predefined parameter and the first image, pixel position is generated Set data;All pixels in the first image are carried out with surrounding pixel by the pixel location data Pixel value judgement generates the second image according to judging result;And it by the first image and second image, generates pre- Determine three components of image.
It will be appreciated by those skilled in the art that above-mentioned each module can be distributed in device according to the description of embodiment, it can also Uniquely it is different from one or more devices of the present embodiment with carrying out corresponding change.The module of above-described embodiment can be merged into One module, can also be further split into multiple submodule.
By the description of above embodiment, those skilled in the art is it can be readily appreciated that example embodiment described herein It can also be realized in such a way that software is in conjunction with necessary hardware by software realization.Therefore, implement according to the present invention The technical solution of example can be embodied in the form of software products, which can store in a non-volatile memories In medium (can be CD-ROM, USB flash disk, mobile hard disk etc.) or on network, including some instructions are so that a calculating equipment (can To be personal computer, server, mobile terminal or network equipment etc.) it executes according to the method for the embodiment of the present invention.
It is particularly shown and described exemplary embodiment of the present invention above.It should be appreciated that the present invention is not limited to Detailed construction, set-up mode or implementation method described herein;On the contrary, it is intended to cover included in appended claims Various modifications and equivalence setting in spirit and scope.
In addition, structure shown by this specification Figure of description, ratio, size etc., only to cooperate specification institute Disclosure, for skilled in the art realises that be not limited to the enforceable qualifications of the disclosure with reading, therefore Do not have technical essential meaning, the modification of any structure, the change of proportionate relationship or the adjustment of size are not influencing the disclosure Under the technical effect and achieved purpose that can be generated, it should all still fall in technology contents disclosed in the disclosure and obtain and can cover In the range of.Meanwhile cited such as "upper" in this specification, " first ", " second " and " one " term, be also only and be convenient for Narration is illustrated, rather than to limit the enforceable range of the disclosure, relativeness is altered or modified, without substantive change Under technology contents, when being also considered as the enforceable scope of the present invention.

Claims (14)

1. a kind of method for generating three components characterized by comprising
Image procossing is carried out to predetermined image and generates the first image, the first image is bianry image;
According to the pixel in predefined parameter and the first image, pixel location data is generated;
All pixels in the first image are subjected to picture with surrounding pixel by the pixel location data Element value judgement, generates the second image according to judging result;And
By the first image and second image, three components of predetermined image are generated.
2. the method as described in claim 1, which is characterized in that further include:
The FIG pull handle of the predetermined image is carried out by three component.
3. the method as described in claim 1, which is characterized in that the carry out image procossing to predetermined image generates the first figure Picture, comprising:
Image dividing processing is carried out to the predetermined image, obtains segmentation data;And
The first image is generated by the segmentation data.
4. the method as described in claim 1, which is characterized in that the pixel according in predefined parameter and the first image Point generates pixel location data, comprising:
Determine parameter preset numerical value;
Around each pixel in the first image, predetermined pixel location data is generated by the parameter preset; And
The pixel location data is marked by default value.
5. method as claimed in claim 4, which is characterized in that described to generate predetermined location of pixels by the parameter preset Data, comprising:
N=(2 × M+1)2-1;
Wherein, N is predetermined pixel quantity, and M is parameter preset, and is positive integer.
6. method as claimed in claim 5, which is characterized in that it is described by the pixel location data by the first image In all pixels and surrounding pixel carry out pixel value judgement, according to judging result generate the second image, comprising:
Obtain the pixel i in the first imagen
Pixel i is obtained according to the pixel location datanThe N number of pixel of surrounding;
By pixel inPixel value be compared respectively with the pixel value of pixel N number of around it;And
When by pixel inPixel value and around it when the pixel value difference of N number of pixel, by the pixel inAttribute value It is set as predetermined value.
7. method as claimed in claim 6, which is characterized in that further include:
The pixel being successively read in the first image, row pixel value of going forward side by side compare, until institute in traversal the first image Some pixels.
8. the method for claim 7, which is characterized in that further include:
By the pixel value comparison result of each pixel, second image is generated.
9. the method as described in claim 1, which is characterized in that it is described by the first image and second image, it is raw At three components of predetermined image, comprising:
Third image identical with the first image size is generated, the third image all pixels value is 255;
The 4th image identical with the first image size is generated, the 4th image all pixels value is 128;And
By second image, the third image generates three components of the predetermined image with the 4th image.
10. method as claimed in claim 9, which is characterized in that described to pass through second image, the third image and institute State three components that the 4th image generates the predetermined image, comprising:
By three component calculation formula, by second image, the third image and the 4th image carry out image superposition Generate three components of the predetermined image;
Wherein three component calculation formula are as follows:
Itrimap=Ibinary-Itemp1+Itemp2
Wherein ItrimapFor three components, IbinaryFor second image, Itemp1For the third image, Itemp2For the 4th figure Picture.
11. a kind of for generating the device of three components characterized by comprising
First module generates the first image for carrying out image procossing to predetermined image, and the first image is bianry image;
Position module, for generating pixel location data according to the pixel in predefined parameter and the first image;
Judgment module, for by the pixel location data by the first image all pixels with it is surrounding Pixel carries out pixel value judgement, generates the second image according to judging result;And
Three component modules, for generating three components of predetermined image by the first image and second image.
12. device as claimed in claim 11, which is characterized in that further include:
Module is scratched, for carrying out the FIG pull handle of the predetermined image by three component.
13. a kind of electronic equipment characterized by comprising
One or more processors;
Storage device, for storing one or more programs;
When one or more of programs are executed by one or more of processors, so that one or more of processors are real The now method as described in any in claim 1-10.
14. a kind of computer-readable medium, is stored thereon with computer program, which is characterized in that described program is held by processor The method as described in any in claim 1-10 is realized when row.
CN201710994495.8A 2017-10-23 2017-10-23 Method and device for generating trisection graph Active CN109697722B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201710994495.8A CN109697722B (en) 2017-10-23 2017-10-23 Method and device for generating trisection graph

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201710994495.8A CN109697722B (en) 2017-10-23 2017-10-23 Method and device for generating trisection graph

Publications (2)

Publication Number Publication Date
CN109697722A true CN109697722A (en) 2019-04-30
CN109697722B CN109697722B (en) 2021-10-15

Family

ID=66225853

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201710994495.8A Active CN109697722B (en) 2017-10-23 2017-10-23 Method and device for generating trisection graph

Country Status (1)

Country Link
CN (1) CN109697722B (en)

Cited By (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN110400323A (en) * 2019-07-30 2019-11-01 上海艾麒信息科技有限公司 It is a kind of to scratch drawing system, method and device automatically
CN112070708A (en) * 2020-08-21 2020-12-11 杭州睿琪软件有限公司 Image processing method, image processing apparatus, electronic device, and storage medium
CN112634314A (en) * 2021-01-19 2021-04-09 深圳市英威诺科技有限公司 Target image acquisition method and device, electronic equipment and storage medium

Citations (8)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101673400A (en) * 2008-09-08 2010-03-17 索尼株式会社 Image processing apparatus, method, and program
EP2461290A1 (en) * 2009-07-30 2012-06-06 Sony Corporation Image processing device, image processing method, and program
CN102999897A (en) * 2011-09-19 2013-03-27 香港中文大学 Method and device for sea surface oil spillage detection based on SAR (synthetic aperture radar) image
CN104036517A (en) * 2014-07-01 2014-09-10 成都品果科技有限公司 Image matting method based on gradient sampling
US20150213611A1 (en) * 2014-01-29 2015-07-30 Canon Kabushiki Kaisha Image processing apparatus that identifies image area, and image processing method
US20160110876A1 (en) * 2014-10-15 2016-04-21 Postech Academy-Industry Foundation Matting method for extracting foreground object and apparatus for performing the matting method
CN107123088A (en) * 2017-04-21 2017-09-01 山东大学 A kind of method of automatic replacing photo background color
CN107730528A (en) * 2017-10-28 2018-02-23 天津大学 A kind of interactive image segmentation and fusion method based on grabcut algorithms

Patent Citations (8)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101673400A (en) * 2008-09-08 2010-03-17 索尼株式会社 Image processing apparatus, method, and program
EP2461290A1 (en) * 2009-07-30 2012-06-06 Sony Corporation Image processing device, image processing method, and program
CN102999897A (en) * 2011-09-19 2013-03-27 香港中文大学 Method and device for sea surface oil spillage detection based on SAR (synthetic aperture radar) image
US20150213611A1 (en) * 2014-01-29 2015-07-30 Canon Kabushiki Kaisha Image processing apparatus that identifies image area, and image processing method
CN104036517A (en) * 2014-07-01 2014-09-10 成都品果科技有限公司 Image matting method based on gradient sampling
US20160110876A1 (en) * 2014-10-15 2016-04-21 Postech Academy-Industry Foundation Matting method for extracting foreground object and apparatus for performing the matting method
CN107123088A (en) * 2017-04-21 2017-09-01 山东大学 A kind of method of automatic replacing photo background color
CN107730528A (en) * 2017-10-28 2018-02-23 天津大学 A kind of interactive image segmentation and fusion method based on grabcut algorithms

Non-Patent Citations (2)

* Cited by examiner, † Cited by third party
Title
VIKAS GUPTA 等: "Automatic Trimap Generation for Image Matting", 《2016 INTERNATIONAL CONFERENCE ON SIGNAL AND INFORMATION PROCESSING (ICONSIP)》 *
郑加明 等: "抠图技术中三分图生成算法的研究", 《信息***工程》 *

Cited By (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN110400323A (en) * 2019-07-30 2019-11-01 上海艾麒信息科技有限公司 It is a kind of to scratch drawing system, method and device automatically
CN112070708A (en) * 2020-08-21 2020-12-11 杭州睿琪软件有限公司 Image processing method, image processing apparatus, electronic device, and storage medium
CN112070708B (en) * 2020-08-21 2024-03-08 杭州睿琪软件有限公司 Image processing method, image processing apparatus, electronic device, and storage medium
US11985287B2 (en) 2020-08-21 2024-05-14 Hangzhou Glority Software Limited Image processing method, image processing device, electronic apparatus and storage medium
CN112634314A (en) * 2021-01-19 2021-04-09 深圳市英威诺科技有限公司 Target image acquisition method and device, electronic equipment and storage medium

Also Published As

Publication number Publication date
CN109697722B (en) 2021-10-15

Similar Documents

Publication Publication Date Title
CN109344762B (en) Image processing method and device
CN114187633B (en) Image processing method and device, and training method and device for image generation model
CN107766349B (en) Method, device, equipment and client for generating text
CN110490959B (en) Three-dimensional image processing method and device, virtual image generating method and electronic equipment
US20230222618A1 (en) Object detection method and device
CN110378432B (en) Picture generation method, device, medium and electronic equipment
CN110414502A (en) Image processing method and device, electronic equipment and computer-readable medium
CN109697722A (en) For generating the method and device of three components
CN108597034B (en) Method and apparatus for generating information
CN114792355B (en) Virtual image generation method and device, electronic equipment and storage medium
CN111815738A (en) Map construction method and device
CN112258619A (en) Image processing method and device
CN113870439A (en) Method, apparatus, device and storage medium for processing image
CN115578486A (en) Image generation method and device, electronic equipment and storage medium
CN113837194B (en) Image processing method, image processing apparatus, electronic device, and storage medium
CN113657396B (en) Training method, translation display method, device, electronic equipment and storage medium
CN114266937A (en) Model training method, image processing method, device, equipment and storage medium
CN111815683B (en) Target positioning method and device, electronic equipment and computer readable medium
CN108446693B (en) Marking method, system, equipment and storage medium of target to be identified
CN110377776B (en) Method and device for generating point cloud data
CN112256254A (en) Method and device for generating layout code
CN113592981B (en) Picture labeling method and device, electronic equipment and storage medium
WO2022105120A1 (en) Text detection method and apparatus from image, computer device and storage medium
CN113947146A (en) Sample data generation method, model training method, image detection method and device
CN113298747A (en) Picture and video detection method and 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