CN108615253A - Image generating method, device and computer readable storage medium - Google Patents
Image generating method, device and computer readable storage medium Download PDFInfo
- Publication number
- CN108615253A CN108615253A CN201810323324.7A CN201810323324A CN108615253A CN 108615253 A CN108615253 A CN 108615253A CN 201810323324 A CN201810323324 A CN 201810323324A CN 108615253 A CN108615253 A CN 108615253A
- Authority
- CN
- China
- Prior art keywords
- image
- template
- pixel
- similarity
- bianry
- Prior art date
- Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
- Granted
Links
Classifications
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06T—IMAGE DATA PROCESSING OR GENERATION, IN GENERAL
- G06T11/00—2D [Two Dimensional] image generation
- G06T11/80—Creating or modifying a manually drawn or painted image using a manual input device, e.g. mouse, light pen, direction keys on keyboard
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06T—IMAGE DATA PROCESSING OR GENERATION, IN GENERAL
- G06T11/00—2D [Two Dimensional] image generation
- G06T11/001—Texturing; Colouring; Generation of texture or colour
Landscapes
- Physics & Mathematics (AREA)
- General Physics & Mathematics (AREA)
- Engineering & Computer Science (AREA)
- Theoretical Computer Science (AREA)
- Image Input (AREA)
- Image Processing (AREA)
Abstract
The present invention provides a kind of image generating method, device and computer readable storage medium, described image generation method includes acquiring the drawing image drawn on terminal device screen;Gray processing calculating is carried out to the drawing image using Weighted Average Algorithm, obtains gray level image;Binary conversion treatment is carried out to the gray level image, obtains bianry image;Calculate separately the bianry image and the similarity for being pre-stored in multiple template image in template image data library;It obtains the template image for corresponding to maximum similarity in the multiple template image and is pushed on the terminal device screen.The difficulty of electronic painting can be effectively reduced by the above method, while image processing process is simple, reduce the image computational throughput of electronic painting product, improve the quality of drawing image.
Description
Technical field
The present invention relates to technical field of image processing, and in particular to a kind of image generating method, device with it is computer-readable
Storage medium.
Background technology
Universal with social electronization, more and more people start to use electronic product, for example, mobile phone, tablet, computer,
Electronic drawing board etc. is painted, and still, existing graphic products or tool on the market at present, operating procedure is complicated, time-consuming, example
Such as:User needs to create blank drawing board on touching screen, selection drawing classification, setting paintbrush parameter (color, thickness, brush shape
Shape and transparency) it finishes, it could paint.Secondly, illustration and having differences property of user's painting, are mainly reflected in:
User's drawing finishes, and touching screen shows similar illustration, but illustration stroke more specification and tool according to painting identification
There is fixed form, is had differences with the stroke of user's drawing, form, on the one hand increase the difficulty of drawing, another aspect image
Complex disposal process increases the image computational throughput that graphic products or tool draw user, while the drafting figure exported
As effect is poor.
Invention content
The object of the present invention is to provide a kind of image generating method, device and computer readable storage mediums, can be effective
The difficulty of electronic painting is reduced, while image processing process is simple, reduce the image computational throughput of electronic painting product, improved
The quality of drawing image.
An embodiment of the present invention provides a kind of image generating methods, including:
Acquire the drawing image drawn on terminal device screen;
Gray processing calculating is carried out to the drawing image using Weighted Average Algorithm, obtains gray level image;
Binary conversion treatment is carried out to the gray level image, obtains bianry image;
Calculate separately the bianry image and the similarity for being pre-stored in multiple template image in template image data library;
It obtains the template image for corresponding to maximum similarity in the multiple template image and is pushed to the terminal device screen
On curtain.
Preferably, described that binary conversion treatment is carried out to the gray level image, bianry image is obtained, is specifically included:
Judge whether the gray value of any one pixel of the gray level image is more than first threshold, if so, will be described
The gray value of any one pixel is updated to the first setting gray value, if it is not, by the gray value of any one pixel
It is updated to the second setting gray value, obtains the bianry image;
Wherein, the first threshold is the average gray of all pixels point in the gray level image.
Preferably, described to calculate separately the bianry image and be pre-stored in multiple template image in template image data library
Similarity specifically includes:
Using Euclidean distance algorithm, each of each pixel of the bianry image and any one of template image is calculated
The distance between pixel;
According to the distance between each pixel of each pixel of the bianry image and any one of template image,
Calculate the similarity of the bianry image and any one of template image.
Preferably, each pixel of each pixel according to the bianry image and any one of template image
The distance between, the bianry image is calculated with after the similarity of any one of template image, further includes:
Obtain the template image that similarity in the multiple template image is more than second threshold, and according to similarity by greatly to
Small sequence is ranked up;
The Prototype drawing of the first setting quantity is obtained from the template image after sequence according to the descending sequence of similarity
Picture generates the first image collection to be screened;
Fragmental image processing is carried out to the bianry image, obtains multiple block images;
Calculate separately the multiple block image and any one template image in the described first image collection to be screened
Similarity;
Any one template image in the described first image collection to be screened is corresponded to according to the multiple block image
Similarity calculates the multiple block image and corresponds to the flat of any one template image in the described first image collection to be screened
Equal similarity, the average similarity are the similarity of the bianry image and any one template image.
Preferably, described image generation method further includes:
The coloured image of acquisition;
The coloured image is input in the grid matrix being sized, adjusts the pixel of the coloured image;
Gray processing processing and binary conversion treatment are carried out to the coloured image, obtain the template image and stored to institute
It states in template image data library.
Preferably, described to use Euclidean distance algorithm, calculate each pixel of the bianry image with it is any one of
The distance between each pixel of template image, specifically includes:
According to formulaCalculate each pixel and any one institute of the bianry image
State the distance between each pixel of template image;
Wherein, x, y are two points of two-dimensional space.
Preferably, each pixel of each pixel according to the bianry image and any one of template image
The distance between, the similarity of the bianry image and any one of template image is calculated, is specifically included:
According to formulaCalculate the bianry image and any one of template image
Similarity.
The embodiment of the present invention additionally provides a kind of video generation device, including:
Image capture module, for acquiring the drawing image drawn on terminal device screen;
Gradation processing module obtains ash for carrying out gray processing calculating to the drawing image using Weighted Average Algorithm
Spend image;
Two-value processing module obtains bianry image for carrying out binary conversion treatment to the gray level image;
Similarity calculation module, for calculating separately the bianry image and being pre-stored in multiple moulds in template image data library
The similarity of plate image;
Image pushing module, for obtaining the template image and the push that correspond to maximum similarity in the multiple template image
Onto the terminal device screen.
The embodiment of the present invention additionally provides a kind of video generation device, including processor, memory and is stored in described
In memory and it is configured as the computer program executed by the processor, when the processor executes the computer program
Realize such as above-mentioned image generating method.
The embodiment of the present invention additionally provides a kind of computer readable storage medium, and the computer readable storage medium includes
The computer program of storage, wherein control when the computer program is run and set where the computer readable storage medium
It is standby to execute such as above-mentioned image generating method.
Compared with the existing technology, a kind of advantageous effect of image generating method provided in an embodiment of the present invention is:It is described
Image generating method includes acquiring the drawing image drawn on terminal device screen;Using Weighted Average Algorithm to the drafting
Image carries out gray processing calculating, obtains gray level image;Binary conversion treatment is carried out to the gray level image, obtains bianry image;Point
The bianry image and the similarity for being pre-stored in multiple template image in template image data library are not calculated;Obtain the multiple mould
The template image of maximum similarity is corresponded in plate image and is pushed on the terminal device screen.Can have by the above method
Effect reduces the difficulty of electronic painting, while image processing process is simple, reduces the image computational throughput of electronic painting product, carries
The quality of high drawing image.The embodiment of the present invention additionally provides a kind of video generation device and computer readable storage medium.
Description of the drawings
Fig. 1 is a kind of flow chart of image generating method provided in an embodiment of the present invention;
Fig. 2 is a kind of schematic diagram of video generation device provided in an embodiment of the present invention.
Specific implementation mode
Following will be combined with the drawings in the embodiments of the present invention, and technical solution in the embodiment of the present invention carries out clear, complete
Site preparation describes, it is clear that described embodiments are only a part of the embodiments of the present invention, instead of all the embodiments.It is based on
Embodiment in the present invention, those of ordinary skill in the art are obtained every other without creative efforts
Embodiment shall fall within the protection scope of the present invention.
Referring to Fig. 1, it is a kind of flow chart of image generating method provided in an embodiment of the present invention, described image generates
Method includes:
S100:Acquire the drawing image drawn on terminal device screen;
S200:Gray processing calculating is carried out to the drawing image using Weighted Average Algorithm, obtains gray level image;
S300:Binary conversion treatment is carried out to the gray level image, obtains bianry image;
S400:It calculates separately the bianry image and is pre-stored in the similar of multiple template image in template image data library
Degree;
S500:It obtains the template image for corresponding to maximum similarity in the multiple template image and is pushed to the terminal and set
On standby screen.
It in the present embodiment, need to be without carrying out the drawing setting such as drawing classification selection, paintbrush parameter setting before drawing
The screen of terminal device is painted, and drawing is easy to operate, reduces the difficulty of drawing, effectively reduces drawing duration;Eventually
The sensor of end equipment receives user in the drawing image of screen drawing and is sent to the processor progress gray processing of terminal device
Processing, binary conversion treatment and with template graphics carry out similarity mode processing, finally the highest template image of similarity is pushed away
It send and realizes that the Automatic Optimal of drawing image generates effect to the screen of terminal device, image processing process is simple, reduces electronics and paints
The image computational throughput for drawing product, improves the quality of drawing image.The terminal device is mobile phone, tablet, drawing boards, touching
The equipment such as screen.
Wherein, using weighted average formula f (i, j)=0.30R (i, j)+0.59G (i, j)+0.11B (i, j), institute is calculated
State the gray value of each pixel of drawing image;I, j are the position of any one pixel, and R (i, j) is the red of the pixel
Component, G (i, j) are the green component of the pixel, and B (i, j) is the blue component of the pixel.According to the drawing image
The gray value of each pixel generates the gray level image.By above-mentioned formula so that the range of the gray value of each pixel 0 to
Between 255, black, white, grey three kinds of color states are presented in the gray level image.After drawing image is carried out gray processing processing, draw
Image only remains next gray value, can greatly improve the treatment effeciency of follow-up drawing image, while not influencing drawing image
Texture feature information.
Specifically, the screen of the terminal device is equipped with the first display window and the second display window, first display
Window shows the corresponding bianry image of the drawing image, the template image of the second display window display push.
For terminal device when showing template image highest with the drawing image similarity of user's drafting, the first display window only retains institute
The textural characteristics of drawing image are stated, i.e., the corresponding bianry image of described drawing image can effectively reduce template image and draw
The otherness of image more clearly guides user's drawing to realize user+system combined effect drawn a picture.
In a kind of optional embodiment, S300:Binary conversion treatment is carried out to the gray level image, obtains bianry image,
It specifically includes:
Judge whether the gray value of any one pixel of the gray level image is more than first threshold, if so, will be described
The gray value of any one pixel is updated to the first setting gray value, if it is not, by the gray value of any one pixel
It is updated to the second setting gray value, obtains the bianry image;
Wherein, the first threshold is the average gray of all pixels point in the gray level image.
In the present embodiment, described first gray value is set as 0 (black), described second to set gray value (white as 255
Color).By the way that gray level image is further carried out binary conversion treatment, the bianry image of greyish white state is obtained, drafting figure can be simplified
Picture reduces the data volume of drawing image, highlights the profile of drawing image, improves and carries out the accurate of similarity mode with template image
Degree.
In other embodiments, the first setting gray value of the pixel of the bianry image is updated to 0, by described two
Second setting gray value of the pixel of value image is updated to 1, obtains updated bianry image and is stored in local data base
In.By the way that the gray value of the bianry image is mapped as 0 or 1,1 is used as bianry image described in coded representation, can be mitigated
The storage pressure of terminal device.
In a kind of optional embodiment, S400:It calculates separately the bianry image and is pre-stored in template image data library
The similarity of middle multiple template image, specifically includes:
Using Euclidean distance algorithm, each of each pixel of the bianry image and any one of template image is calculated
The distance between pixel;
According to the distance between each pixel of each pixel of the bianry image and any one of template image,
Calculate the similarity of the bianry image and any one of template image.
In the present embodiment, it will be understood that when each pixel and any one of template image of the bianry image
The distance between each pixel it is smaller, the similarity of the bianry image and any one of template image is bigger.
In a kind of optional embodiment, each pixel according to the bianry image and any one of template
The distance between each pixel of image, after the similarity for calculating the bianry image and any one of template image,
Further include:
Obtain the template image that similarity in the multiple template image is more than second threshold, and according to similarity by greatly to
Small sequence is ranked up;
The Prototype drawing of the first setting quantity is obtained from the template image after sequence according to the descending sequence of similarity
Picture generates the first image collection to be screened;
Fragmental image processing is carried out to the bianry image, obtains multiple block images;
Calculate separately the multiple block image and any one template image in the described first image collection to be screened
Similarity;
Any one template image in the described first image collection to be screened is corresponded to according to the multiple block image
Similarity calculates the multiple block image and corresponds to the flat of any one template image in the described first image collection to be screened
Equal similarity, the average similarity are the similarity of the bianry image and any one template image.
In a kind of optional embodiment, described image generation method further includes:
The coloured image of acquisition;
The coloured image is input in the grid matrix being sized, adjusts the pixel of the coloured image;
Gray processing processing and binary conversion treatment are carried out to the coloured image, obtain the template image and stored to institute
It states in template image data library.
In the present embodiment, the coloured image is using gray processing identical with above-mentioned drawing image processing and binaryzation
The coloured image is converted to the template image by processing procedure, herein no longer to the processing of the gray processing of the coloured image
And binary conversion treatment process illustrates.
It is described to use Euclidean distance algorithm in a kind of optional embodiment, calculate each pixel of the bianry image
The distance between each pixel of any one of template image, specifically includes:
According to formulaCalculate each pixel and any one institute of the bianry image
State the distance between each pixel of template image;
Wherein, x, y are two points of two-dimensional space.
In a kind of optional embodiment, each pixel according to the bianry image and any one of template
The distance between each pixel of image calculates the similarity of the bianry image and any one of template image, specifically
Including:
According to formulaCalculate the bianry image and any one of template image
Similarity.
Referring to Fig. 2, a kind of schematic diagram of its video generation device that be the embodiment of the present invention also provide, described image life
Include at device:
Image capture module 1, for acquiring the drawing image drawn on terminal device screen;
Gradation processing module 2 obtains ash for carrying out gray processing calculating to the drawing image using Weighted Average Algorithm
Spend image;
Two-value processing module 3 obtains bianry image for carrying out binary conversion treatment to the gray level image;
Similarity calculation module 4, for calculate separately the bianry image be pre-stored in it is multiple in template image data library
The similarity of template image;
Image pushing module 5 corresponds to the template image of maximum similarity and pushes away for obtaining in the multiple template image
It is sent on the terminal device screen.
It in the present embodiment, need to be without carrying out the drawing setting such as drawing classification selection, paintbrush parameter setting before drawing
The screen of terminal device is painted, and drawing is easy to operate, reduces the difficulty of drawing, effectively reduces drawing duration;Eventually
The sensor of end equipment receives user in the drawing image of screen drawing and is sent to the processor progress gray processing of terminal device
Processing, binary conversion treatment and with template graphics carry out similarity mode processing, finally the highest template image of similarity is pushed away
It send and realizes that the Automatic Optimal of drawing image generates effect to the screen of terminal device, image processing process is simple, reduces electronics and paints
The image computational throughput for drawing product, improves the quality of drawing image.The terminal device is mobile phone, tablet, drawing boards, touching
The equipment such as screen.
Wherein, using weighted average formula f (i, j)=0.30R (i, j)+0.59G (i, j)+0.11B (i, j), institute is calculated
State the gray value of each pixel of drawing image;I, j are the position of any one pixel, and R (i, j) is the red of the pixel
Component, G (i, j) are the green component of the pixel, and B (i, j) is the blue component of the pixel.According to the drawing image
The gray value of each pixel generates the gray level image.By above-mentioned formula so that the range of the gray value of each pixel 0 to
Between 255, black, white, grey three kinds of color states are presented in the gray level image.After drawing image is carried out gray processing processing, draw
Image only remains next gray value, can greatly improve the treatment effeciency of follow-up drawing image, while not influencing drawing image
Texture feature information.
Specifically, the screen of the terminal device is equipped with the first display window and the second display window, first display
Window shows the corresponding bianry image of the drawing image, the template image of the second display window display push.
For terminal device when showing template image highest with the drawing image similarity of user's drafting, the first display window only retains institute
The textural characteristics of drawing image are stated, i.e., the corresponding bianry image of described drawing image can effectively reduce template image and draw
The otherness of image more clearly guides user's drawing to realize user+system combined effect drawn a picture.
In a kind of optional embodiment, two-value processing module 3, any one pixel for judging the gray level image
Whether the gray value of point is more than first threshold, if so, the gray value of any one pixel is updated to the first setting ash
Angle value obtains the bianry image if it is not, the gray value of any one pixel is updated to the second setting gray value;
Wherein, the first threshold is the average gray of all pixels point in the gray level image.
In the present embodiment, described first gray value is set as 0 (black), described second to set gray value (white as 255
Color).By the way that gray level image is further carried out binary conversion treatment, the bianry image of greyish white state is obtained, drafting figure can be simplified
Picture reduces the data volume of drawing image, highlights the profile of drawing image, improves and carries out the accurate of similarity mode with template image
Degree.
In other embodiments, the first setting gray value of the pixel of the bianry image is updated to 0, by described two
Second setting gray value of the pixel of value image is updated to 1, obtains updated bianry image and is stored in local data base
In.By the way that the gray value of the bianry image is mapped as 0 or 1,1 is used as bianry image described in coded representation, can be mitigated
The storage pressure of terminal device.
In a kind of optional embodiment, similarity calculation module 4 includes:
Metrics calculation unit, for using Euclidean distance algorithm, calculate each pixel of the bianry image with it is any one
The distance between each pixel of a template image;
First similarity calculated is used for each pixel according to the bianry image and any one of Prototype drawing
The distance between each pixel of picture calculates the similarity of the bianry image and any one of template image.
In the present embodiment, it will be understood that when each pixel and any one of template image of the bianry image
The distance between each pixel it is smaller, the similarity of the bianry image and any one of template image is bigger.
In a kind of optional embodiment, described image generating means further include:
Image sorting module is more than the template image of second threshold for obtaining similarity in the multiple template image,
And it is ranked up according to the descending sequence of similarity;
Image collection generation module, for being obtained from the template image after sequence according to the descending sequence of similarity
The template image of first setting quantity, generates the first image collection to be screened;
Image block module obtains multiple block images for carrying out fragmental image processing to the bianry image;
Second image computing unit, for calculating separately the multiple block image and the described first image collection to be screened
In any one template image similarity;
Any one template image in the described first image collection to be screened is corresponded to according to the multiple block image
Similarity calculates the multiple block image and corresponds to the flat of any one template image in the described first image collection to be screened
Equal similarity, the average similarity are the similarity of the bianry image and any one template image.
In a kind of optional embodiment, described image generating means further include:
Template image acquisition module, the coloured image for acquisition;
Pixel adjustment module adjusts the coloured silk for being input to the coloured image in the grid matrix being sized
The pixel of color image;
Image processing module, for carrying out gray processing processing and binary conversion treatment to the coloured image, described in acquisition
Template image is simultaneously stored into the template image data library.
In the present embodiment, the coloured image is using gray processing identical with above-mentioned drawing image processing and binaryzation
The coloured image is converted to the template image by processing procedure, herein no longer to the processing of the gray processing of the coloured image
And binary conversion treatment process illustrates.
In a kind of optional embodiment, the metrics calculation unit, for according to formula
Calculate the distance between each pixel of the bianry image and each pixel of any one of template image;
Wherein, x, y are two points of two-dimensional space.
In a kind of optional embodiment, first similarity calculated, for according to formula
Calculate the similarity of the bianry image and any one of template image.
The embodiment of the present invention additionally provides a kind of video generation device, including processor, memory and is stored in described
In memory and it is configured as the computer program executed by the processor, when the processor executes the computer program
Realize such as above-mentioned image generating method.
Illustratively, the computer program can be divided into one or more module/units, one or more
A module/unit is stored in the memory, and is executed by the processor, to complete the present invention.It is one or more
A module/unit can be the series of computation machine program instruction section that can complete specific function, and the instruction segment is for describing institute
State implementation procedure of the computer program in described image generating means.For example, the computer program can be divided into as
Image capture module 1 shown in Fig. 2, gradation processing module 2, two-value processing module 3, similarity calculation module 4, image push mould
Block 5, each module concrete function are as follows:Image capture module 1, for acquiring the drawing image drawn on terminal device screen;
Gradation processing module 2 obtains gray level image for carrying out gray processing calculating to the drawing image using Weighted Average Algorithm;
Two-value processing module 3 obtains bianry image for carrying out binary conversion treatment to the gray level image;Similarity calculation module 4,
Similarity for calculating separately the bianry image Yu being pre-stored in multiple template image in template image data library;Image pushes
Module 5 corresponds to the template image of maximum similarity and is pushed to the terminal device for obtaining in the multiple template image
On screen.
Described image generating means can be the calculating such as desktop PC, notebook, palm PC and cloud server
Equipment.Described image generating means may include, but be not limited only to, processor, memory.It will be understood by those skilled in the art that
The schematic diagram is only the example of video generation device, does not constitute the restriction to video generation device, may include than figure
Show more or fewer components, either combine certain components or different components, such as described image generating means can be with
Including input-output equipment, network access equipment, bus etc..
Alleged processor can be central processing unit (Central Processing Unit, CPU), can also be it
His general processor, digital signal processor (Digital Signal Processor, DSP), application-specific integrated circuit
(Application Specific Integrated Circuit, ASIC), ready-made programmable gate array (Field-
Programmable Gate Array, FPGA) either other programmable logic device, discrete gate or transistor logic,
Discrete hardware components etc..General processor can be microprocessor or the processor can also be any conventional processor
Deng the processor is the control centre of described image generating means, and various interfaces and connection whole image is utilized to generate
The various pieces of device.
The memory can be used for storing the computer program and/or module, and the processor is by running or executing
Computer program in the memory and/or module are stored, and calls the data being stored in memory, described in realization
The various functions of video generation device.The memory can include mainly storing program area and storage data field, wherein storage journey
It sequence area can storage program area, application program (such as sound-playing function, image player function needed at least one function
Deng) etc.;Storage data field can be stored uses created data (such as audio data, phone directory etc.) etc. according to mobile phone.This
Outside, memory may include high-speed random access memory, can also include nonvolatile memory, such as hard disk, memory, insert
Connect formula hard disk, intelligent memory card (Smart Media Card, SMC), secure digital (Secure Digital, SD) card, flash memory
Block (Flash Card), at least one disk memory, flush memory device or other volatile solid-state parts.
Wherein, if module/unit that described image generating means integrate is realized in the form of SFU software functional unit and makees
It is independent product sale or in use, can be stored in a computer read/write memory medium.Based on this understanding,
The present invention realizes all or part of flow in above-described embodiment method, can also be instructed by computer program relevant hard
Part is completed, and the computer program can be stored in a computer readable storage medium, which is being handled
When device executes, it can be achieved that the step of above-mentioned each embodiment of the method.Wherein, the computer program includes computer program generation
Code, the computer program code can be source code form, object identification code form, executable file or certain intermediate forms
Deng.The computer-readable medium may include:Any entity or device, record of the computer program code can be carried
Medium, USB flash disk, mobile hard disk, magnetic disc, CD, computer storage, read-only memory (ROM, Read-Only Memory), with
Machine accesses memory (RAM, Random Access Memory), electric carrier signal, telecommunication signal and software distribution medium etc..
It should be noted that the content that the computer-readable medium includes can be according to legislation and patent practice in jurisdiction
It is required that carrying out increase and decrease appropriate, such as in certain jurisdictions, do not wrapped according to legislation and patent practice, computer-readable medium
Include electric carrier signal and telecommunication signal.
It should be noted that the apparatus embodiments described above are merely exemplary, wherein described be used as separating component
The unit of explanation may or may not be physically separated, and the component shown as unit can be or can also
It is not physical unit, you can be located at a place, or may be distributed over multiple network units.It can be according to actual
It needs that some or all of module therein is selected to achieve the purpose of the solution of this embodiment.In addition, device provided by the invention
In embodiment attached drawing, the connection relation between module indicates there is communication connection between them, specifically can be implemented as one or
A plurality of communication bus or signal wire.Those of ordinary skill in the art are without creative efforts, you can to understand
And implement.
The embodiment of the present invention additionally provides a kind of computer readable storage medium, and the computer readable storage medium includes
The computer program of storage, wherein control when the computer program is run and set where the computer readable storage medium
It is standby to execute such as above-mentioned image generating method.
Compared with the existing technology, a kind of advantageous effect of image generating method provided in an embodiment of the present invention is:It is described
Image generating method includes acquiring the drawing image drawn on terminal device screen;Using Weighted Average Algorithm to the drafting
Image carries out gray processing calculating, obtains gray level image;Binary conversion treatment is carried out to the gray level image, obtains bianry image;Point
The bianry image and the similarity for being pre-stored in multiple template image in template image data library are not calculated;Obtain the multiple mould
The template image of maximum similarity is corresponded in plate image and is pushed on the terminal device screen.Can have by the above method
Effect reduces the difficulty of electronic painting, while image processing process is simple, reduces the image computational throughput of electronic painting product, carries
The quality of high drawing image.The embodiment of the present invention additionally provides a kind of video generation device and computer readable storage medium.
The above is the preferred embodiment of the present invention, it is noted that for those skilled in the art
For, various improvements and modifications may be made without departing from the principle of the present invention, these improvements and modifications are also considered as
Protection scope of the present invention.
Claims (10)
1. a kind of image generating method, which is characterized in that including:
Acquire the drawing image drawn on terminal device screen;
Gray processing calculating is carried out to the drawing image using Weighted Average Algorithm, obtains gray level image;
Binary conversion treatment is carried out to the gray level image, obtains bianry image;
Calculate separately the bianry image and the similarity for being pre-stored in multiple template image in template image data library;
It obtains the template image for corresponding to maximum similarity in the multiple template image and is pushed on the terminal device screen.
2. image generating method as described in claim 1, which is characterized in that described to be carried out at binaryzation to the gray level image
Reason obtains bianry image, specifically includes:
Judge whether the gray value of any one pixel of the gray level image is more than first threshold, if so, by described arbitrary
The gray value of one pixel is updated to the first setting gray value, if it is not, the gray value of any one pixel is updated
For the second setting gray value, the bianry image is obtained;
Wherein, the first threshold is the average gray of all pixels point in the gray level image.
3. image generating method as described in claim 1, which is characterized in that described to calculate separately the bianry image and prestore
The similarity of multiple template image, specifically includes in template image data library:
Using Euclidean distance algorithm, each pixel of the bianry image and each pixel of any one of template image are calculated
The distance between point;
According to the distance between each pixel of each pixel of the bianry image and any one of template image, calculate
The similarity of the bianry image and any one of template image.
4. image generating method as claimed in claim 3, which is characterized in that each pixel according to the bianry image
The distance between each pixel of any one of template image, calculates the bianry image and any one of template
After the similarity of image, further include:
The template image that similarity in the multiple template image is more than second threshold is obtained, and descending according to similarity
Sequence is ranked up;
The template image of the first setting quantity is obtained from the template image after sequence according to the descending sequence of similarity, it is raw
At the first image collection to be screened;
Fragmental image processing is carried out to the bianry image, obtains multiple block images;
Calculate separately the phase of the multiple block image and any one template image in the described first image collection to be screened
Like degree;
The similar of any one template image in the described first image collection to be screened is corresponded to according to the multiple block image
Degree, calculates the average phase for any one template image that the multiple block image corresponds in the described first image collection to be screened
Like degree, the average similarity is the similarity of the bianry image and any one template image.
5. image generating method as described in claim 1, which is characterized in that described image generation method further includes:
The coloured image of acquisition;
The coloured image is input in the grid matrix being sized, adjusts the pixel of the coloured image;
Gray processing processing and binary conversion treatment are carried out to the coloured image, the template image is obtained and stores and arrive the mould
In plate image data base.
6. image generating method as claimed in claim 3, which is characterized in that it is described to use Euclidean distance algorithm, described in calculating
The distance between each pixel of bianry image and each pixel of any one of template image, specifically include:
According to formulaCalculate each pixel of the bianry image and any one of mould
The distance between each pixel of plate image;
Wherein, x, y are two points of two-dimensional space.
7. image generating method as claimed in claim 6, which is characterized in that each pixel according to the bianry image
The distance between each pixel of any one of template image, calculates the bianry image and any one of template
The similarity of image, specifically includes:
According to formulaIt is similar to any one of template image to calculate the bianry image
Degree.
8. a kind of video generation device, which is characterized in that including:
Image capture module, for acquiring the drawing image drawn on terminal device screen;
Gradation processing module obtains gray-scale map for carrying out gray processing calculating to the drawing image using Weighted Average Algorithm
Picture;
Two-value processing module obtains bianry image for carrying out binary conversion treatment to the gray level image;
Similarity calculation module, for calculating separately the bianry image and being pre-stored in multiple template figure in template image data library
The similarity of picture;
Image pushing module corresponds to the template image of maximum similarity and is pushed to institute for obtaining in the multiple template image
It states on terminal device screen.
9. a kind of video generation device, which is characterized in that including processor, memory and be stored in the memory and by
It is configured to the computer program executed by the processor, is realized when the processor executes the computer program as right is wanted
Seek the image generating method described in any one of 1 to 7.
10. a kind of computer readable storage medium, which is characterized in that the computer readable storage medium includes the calculating of storage
Machine program, wherein equipment where controlling the computer readable storage medium when the computer program is run is executed as weighed
Profit requires the image generating method described in any one of 1 to 7.
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN201810323324.7A CN108615253B (en) | 2018-04-12 | 2018-04-12 | Image generation method, device and computer readable storage medium |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN201810323324.7A CN108615253B (en) | 2018-04-12 | 2018-04-12 | Image generation method, device and computer readable storage medium |
Publications (2)
Publication Number | Publication Date |
---|---|
CN108615253A true CN108615253A (en) | 2018-10-02 |
CN108615253B CN108615253B (en) | 2022-09-13 |
Family
ID=63659778
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
CN201810323324.7A Active CN108615253B (en) | 2018-04-12 | 2018-04-12 | Image generation method, device and computer readable storage medium |
Country Status (1)
Country | Link |
---|---|
CN (1) | CN108615253B (en) |
Cited By (9)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN109727299A (en) * | 2018-11-20 | 2019-05-07 | 广东智媒云图科技股份有限公司 | A kind of control mechanical arm combines the method drawn a picture, electronic equipment and storage medium |
CN109741418A (en) * | 2018-11-20 | 2019-05-10 | 广东智媒云图科技股份有限公司 | A kind of low polygon style drawing acquisition methods and device |
CN109886781A (en) * | 2019-01-31 | 2019-06-14 | 广东智媒云图科技股份有限公司 | Products Show method, apparatus, equipment and storage medium based on drawing behavior |
CN109948653A (en) * | 2019-02-15 | 2019-06-28 | 广东智媒云图科技股份有限公司 | A kind of image similarity judgment method, electronic equipment and storage medium |
CN109993202A (en) * | 2019-02-15 | 2019-07-09 | 广东智媒云图科技股份有限公司 | A kind of line chirotype shape similarity judgment method, electronic equipment and storage medium |
CN110175257A (en) * | 2019-04-15 | 2019-08-27 | 广东智媒云图科技股份有限公司 | A kind of line original text image matching method, electronic equipment, storage medium |
CN110390668A (en) * | 2019-06-26 | 2019-10-29 | 石家庄铁道大学 | Bolt looseness detection method, terminal device and storage medium |
CN110569907A (en) * | 2019-09-10 | 2019-12-13 | 网易(杭州)网络有限公司 | method and device for identifying splicing pattern, computer storage medium and electronic equipment |
CN112001430A (en) * | 2020-08-07 | 2020-11-27 | 海尔优家智能科技(北京)有限公司 | Refrigerator food material detection method and device, storage medium and electronic device |
Citations (18)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
US20100104158A1 (en) * | 2006-12-21 | 2010-04-29 | Eli Shechtman | Method and apparatus for matching local self-similarities |
CN101706873A (en) * | 2009-11-27 | 2010-05-12 | 东软集团股份有限公司 | Identification method and device of digital-class limitation marking |
CN102147911A (en) * | 2010-02-04 | 2011-08-10 | 卡西欧计算机株式会社 | Image processing device |
CN102231093A (en) * | 2011-06-14 | 2011-11-02 | 伍斌 | Screen locating control method and device |
CN102354402A (en) * | 2011-09-21 | 2012-02-15 | 西安交通大学 | Drawing rendering method based on style learning |
CN102473318A (en) * | 2009-07-30 | 2012-05-23 | 伊斯曼柯达公司 | Processing digital templates for image display |
CN102663782A (en) * | 2012-03-02 | 2012-09-12 | 西安交通大学 | Painting rendering method based on stroke texture analysis |
CN102810160A (en) * | 2012-06-06 | 2012-12-05 | 北京京东世纪贸易有限公司 | Method and device for searching images |
CN102938077A (en) * | 2012-10-25 | 2013-02-20 | 渭南师范学院 | Online AOI (Automatic Optical Inspection) image retrieval method based on double-threshold binaryzation |
CN103150557A (en) * | 2013-02-26 | 2013-06-12 | 北京航空航天大学 | Machine vision-based display terminal operation response matching detection device |
CN103902988A (en) * | 2014-04-21 | 2014-07-02 | 梁爽 | Method for rough draft shape matching based on Modular product graph and maximum clique |
CN104574389A (en) * | 2014-12-26 | 2015-04-29 | 康奋威科技(杭州)有限公司 | Battery piece chromatism selection control method based on color machine vision |
US20150379340A1 (en) * | 2014-06-27 | 2015-12-31 | Kyocera Document Solutions Inc. | Image processing device |
CN105426825A (en) * | 2015-11-09 | 2016-03-23 | 国网山东省电力公司烟台供电公司 | Aerial image identification based power grid geographical wiring diagram drawing method |
CN105956579A (en) * | 2016-05-27 | 2016-09-21 | 国创科视科技股份有限公司 | Rapid finger vein identification method integrating fuzzy template and point characteristics |
CN106530317A (en) * | 2016-09-23 | 2017-03-22 | 南京凡豆信息科技有限公司 | Stick figure computer scoring and auxiliary coloring method |
CN106952257A (en) * | 2017-03-21 | 2017-07-14 | 南京大学 | A kind of curved surface label open defect detection method based on template matches and Similarity Measure |
CN107092430A (en) * | 2016-02-18 | 2017-08-25 | 纬创资通(中山)有限公司 | Space drawing point system, the apparatus and system for carrying out space drawing score |
-
2018
- 2018-04-12 CN CN201810323324.7A patent/CN108615253B/en active Active
Patent Citations (18)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
US20100104158A1 (en) * | 2006-12-21 | 2010-04-29 | Eli Shechtman | Method and apparatus for matching local self-similarities |
CN102473318A (en) * | 2009-07-30 | 2012-05-23 | 伊斯曼柯达公司 | Processing digital templates for image display |
CN101706873A (en) * | 2009-11-27 | 2010-05-12 | 东软集团股份有限公司 | Identification method and device of digital-class limitation marking |
CN102147911A (en) * | 2010-02-04 | 2011-08-10 | 卡西欧计算机株式会社 | Image processing device |
CN102231093A (en) * | 2011-06-14 | 2011-11-02 | 伍斌 | Screen locating control method and device |
CN102354402A (en) * | 2011-09-21 | 2012-02-15 | 西安交通大学 | Drawing rendering method based on style learning |
CN102663782A (en) * | 2012-03-02 | 2012-09-12 | 西安交通大学 | Painting rendering method based on stroke texture analysis |
CN102810160A (en) * | 2012-06-06 | 2012-12-05 | 北京京东世纪贸易有限公司 | Method and device for searching images |
CN102938077A (en) * | 2012-10-25 | 2013-02-20 | 渭南师范学院 | Online AOI (Automatic Optical Inspection) image retrieval method based on double-threshold binaryzation |
CN103150557A (en) * | 2013-02-26 | 2013-06-12 | 北京航空航天大学 | Machine vision-based display terminal operation response matching detection device |
CN103902988A (en) * | 2014-04-21 | 2014-07-02 | 梁爽 | Method for rough draft shape matching based on Modular product graph and maximum clique |
US20150379340A1 (en) * | 2014-06-27 | 2015-12-31 | Kyocera Document Solutions Inc. | Image processing device |
CN104574389A (en) * | 2014-12-26 | 2015-04-29 | 康奋威科技(杭州)有限公司 | Battery piece chromatism selection control method based on color machine vision |
CN105426825A (en) * | 2015-11-09 | 2016-03-23 | 国网山东省电力公司烟台供电公司 | Aerial image identification based power grid geographical wiring diagram drawing method |
CN107092430A (en) * | 2016-02-18 | 2017-08-25 | 纬创资通(中山)有限公司 | Space drawing point system, the apparatus and system for carrying out space drawing score |
CN105956579A (en) * | 2016-05-27 | 2016-09-21 | 国创科视科技股份有限公司 | Rapid finger vein identification method integrating fuzzy template and point characteristics |
CN106530317A (en) * | 2016-09-23 | 2017-03-22 | 南京凡豆信息科技有限公司 | Stick figure computer scoring and auxiliary coloring method |
CN106952257A (en) * | 2017-03-21 | 2017-07-14 | 南京大学 | A kind of curved surface label open defect detection method based on template matches and Similarity Measure |
Non-Patent Citations (3)
Title |
---|
叶佩: "基于手绘草图的服装图像检索技术及系统实现", 《中国优秀硕士学位论文全文数据库 工程科技辑》 * |
郭天航: "面向手机应用的图像色彩风格迁移技术研究", 《中国优秀硕士学位论文全文数据库 信息科技辑》 * |
闫小超 等: "基于序贯相似度的AGV图像配准方法", 《科学技术工程》 * |
Cited By (15)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN109741418A (en) * | 2018-11-20 | 2019-05-10 | 广东智媒云图科技股份有限公司 | A kind of low polygon style drawing acquisition methods and device |
CN109727299A (en) * | 2018-11-20 | 2019-05-07 | 广东智媒云图科技股份有限公司 | A kind of control mechanical arm combines the method drawn a picture, electronic equipment and storage medium |
CN109741418B (en) * | 2018-11-20 | 2023-08-04 | 广东智媒云图科技股份有限公司 | Low polygon style drawing acquisition method and device |
CN109886781B (en) * | 2019-01-31 | 2023-05-09 | 广东智媒云图科技股份有限公司 | Product recommendation method, device, equipment and storage medium based on painting behaviors |
CN109886781A (en) * | 2019-01-31 | 2019-06-14 | 广东智媒云图科技股份有限公司 | Products Show method, apparatus, equipment and storage medium based on drawing behavior |
CN109948653A (en) * | 2019-02-15 | 2019-06-28 | 广东智媒云图科技股份有限公司 | A kind of image similarity judgment method, electronic equipment and storage medium |
CN109993202A (en) * | 2019-02-15 | 2019-07-09 | 广东智媒云图科技股份有限公司 | A kind of line chirotype shape similarity judgment method, electronic equipment and storage medium |
CN109948653B (en) * | 2019-02-15 | 2023-08-25 | 广东智媒云图科技股份有限公司 | Image similarity judging method, electronic equipment and storage medium |
CN109993202B (en) * | 2019-02-15 | 2023-08-22 | 广东智媒云图科技股份有限公司 | Line manuscript type graph similarity judging method, electronic equipment and storage medium |
CN110175257A (en) * | 2019-04-15 | 2019-08-27 | 广东智媒云图科技股份有限公司 | A kind of line original text image matching method, electronic equipment, storage medium |
CN110390668A (en) * | 2019-06-26 | 2019-10-29 | 石家庄铁道大学 | Bolt looseness detection method, terminal device and storage medium |
CN110390668B (en) * | 2019-06-26 | 2022-02-01 | 石家庄铁道大学 | Bolt looseness detection method, terminal device and storage medium |
CN110569907B (en) * | 2019-09-10 | 2022-03-04 | 网易(杭州)网络有限公司 | Method and device for identifying splicing pattern, computer storage medium and electronic equipment |
CN110569907A (en) * | 2019-09-10 | 2019-12-13 | 网易(杭州)网络有限公司 | method and device for identifying splicing pattern, computer storage medium and electronic equipment |
CN112001430A (en) * | 2020-08-07 | 2020-11-27 | 海尔优家智能科技(北京)有限公司 | Refrigerator food material detection method and device, storage medium and electronic device |
Also Published As
Publication number | Publication date |
---|---|
CN108615253B (en) | 2022-09-13 |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
CN108615253A (en) | Image generating method, device and computer readable storage medium | |
CN108898643B (en) | Image generation method, device and computer readable storage medium | |
CN108876871B (en) | Image processing method and device based on circle fitting and computer readable storage medium | |
CN110717953B (en) | Coloring method and system for black-and-white pictures based on CNN-LSTM (computer-aided three-dimensional network-link) combination model | |
CN110751620B (en) | Method for estimating volume and weight, electronic device, and computer-readable storage medium | |
CN106204690B (en) | Image processing method and device | |
CN109472832B (en) | Color scheme generation method and device and intelligent robot | |
CN108305256B (en) | Video keying processing method, processing unit and computer readable storage medium | |
CN110097616B (en) | Combined drawing method and device, terminal equipment and readable storage medium | |
CN110399487B (en) | Text classification method and device, electronic equipment and storage medium | |
CN110675334A (en) | Image enhancement method and device | |
CN110648284B (en) | Image processing method and device with uneven illumination | |
CN116188808B (en) | Image feature extraction method and system, storage medium and electronic device | |
WO2018227737A1 (en) | Multi-angle scanning method, terminal device and computer readable storage medium | |
CN108701355A (en) | GPU optimizes and the skin possibility predication based on single Gauss online | |
CN108986181B (en) | Dot-based image processing method, device and computer readable storage medium | |
CN111080665A (en) | Image frame identification method, device and equipment and computer storage medium | |
CN112489144A (en) | Image processing method, image processing apparatus, terminal device, and storage medium | |
CN108805095A (en) | image processing method, device, mobile terminal and computer readable storage medium | |
CN109191539B (en) | Oil painting generation method and device based on image and computer readable storage medium | |
CN103685972A (en) | Image optimizing method and system employing same | |
CN110969678B (en) | Drawing method, device, terminal equipment and storage medium for tiled circles | |
CN108492347A (en) | Image generating method, device and computer readable storage medium | |
CN112989924B (en) | Target detection method, target detection device and terminal equipment | |
CN112070096B (en) | Color recognition method, device, terminal equipment and storage medium |
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 |