CN108491847A - Method for expanding image and device - Google Patents

Method for expanding image and device Download PDF

Info

Publication number
CN108491847A
CN108491847A CN201810104571.8A CN201810104571A CN108491847A CN 108491847 A CN108491847 A CN 108491847A CN 201810104571 A CN201810104571 A CN 201810104571A CN 108491847 A CN108491847 A CN 108491847A
Authority
CN
China
Prior art keywords
image
pixel
pending image
benchmark
extended area
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Pending
Application number
CN201810104571.8A
Other languages
Chinese (zh)
Inventor
张春妮
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Koubei Shanghai Information Technology Co Ltd
Original Assignee
Koubei Shanghai 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 Koubei Shanghai Information Technology Co Ltd filed Critical Koubei Shanghai Information Technology Co Ltd
Priority to CN201810104571.8A priority Critical patent/CN108491847A/en
Publication of CN108491847A publication Critical patent/CN108491847A/en
Pending legal-status Critical Current

Links

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06VIMAGE OR VIDEO RECOGNITION OR UNDERSTANDING
    • G06V10/00Arrangements for image or video recognition or understanding
    • G06V10/40Extraction of image or video features
    • G06V10/44Local feature extraction by analysis of parts of the pattern, e.g. by detecting edges, contours, loops, corners, strokes or intersections; Connectivity analysis, e.g. of connected components
    • G06V10/443Local feature extraction by analysis of parts of the pattern, e.g. by detecting edges, contours, loops, corners, strokes or intersections; Connectivity analysis, e.g. of connected components by matching or filtering
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06VIMAGE OR VIDEO RECOGNITION OR UNDERSTANDING
    • G06V10/00Arrangements for image or video recognition or understanding
    • G06V10/40Extraction of image or video features
    • G06V10/56Extraction of image or video features relating to colour

Landscapes

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

Abstract

This application discloses a kind of methods for expanding image, including:Obtain the background pixel feature of the borderline region of pending image;Determine that the borderline region of the pending image expands outward so that it matches the extended area of characteristics of image benchmark;The pixel characteristic of the extended area is configured according to the background pixel feature, obtains target image.The method for expanding image realizes the seamless connection of the borderline region and extended area of pending image, avoids the problem that the error and inefficiency that artificially participate in generating, improves treatment effeciency.

Description

Method for expanding image and device
Technical field
This application involves digital image processing techniques fields, and in particular to a method of for expanding image.The application It is related to a kind of device and a kind of electronic equipment for expanding image simultaneously.
Background technology
With the rapid development of computer network and software development technique, the emerging technology generated therewith is applied to respectively Related field carries out pattern-recognition also more and more especially in digital image processing techniques field based on Digital Image Processing It is taken seriously, for example in transaction platform processing is identified to the associated picture of commodity on line, includes the back of the body to commodity image Scape color is identified, and processing etc. is identified to the image of the discount coupon of commodity.
Background color identification refers to that analysis is identified to the background information of image, obtains image background information in some dimension The description of degree, for example the color of image background is identified and is exported.But grinding in terms of background color identifying processing at present Practice is studied carefully there is also more blank, and the technology being applicable in practice is seldom.The back ofs the body main or by manual identified commodity Scape color, but on the one hand there are subjectivities for artificial identification color, are influenced by identification individual, the recognition result of difference identification individual There may be large errors, and image may be caused to have apparent seam or color to be discord;On the other hand, the efficiency artificially identified Lowly, lack of wisdom.
Invention content
The application provides a kind of method for expanding image, to solve the problems, such as inefficiency of the existing technology. The application is related to a kind of device and a kind of electronic equipment for expanding image simultaneously.
The application provides a kind of method for expanding image, including:
Obtain the background pixel feature of the borderline region of pending image;
Determine that the borderline region of the pending image expands outward so that it matches the extended area of characteristics of image benchmark;
The pixel characteristic of the extended area is configured according to the background pixel feature, obtains target image.
Optionally, after the background pixel characterization step of the borderline region for obtaining pending image executes, and it is described true The borderline region of the fixed pending image expands outward so that it is matched before the extended area step of characteristics of image benchmark executes, Execute following operation:
Determine the characteristic similarity of background pixel feature between each borderline region of pending image;
The characteristic similarity is judged whether in characteristic similarity threshold interval, if so, executing described in the determination The borderline region of pending image expands outward so that it matches the extended area step of characteristics of image benchmark.
Optionally, if the judgement knot for judging the characteristic similarity and whether being in step in feature similar threshold value section Fruit is no, executes following operation:
Establish the correspondence between the borderline region and the extended area;
According to the background pixel feature of the borderline region, to the borderline region correspond to the pixel characteristic of extended area into Row configuration, obtains the second target image;
Wherein, the corresponding extended area of the borderline region, refer in the extended area with the borderline region phase The maximum extended area in neighbouring region.
Optionally, the shape of the pending image includes at least one of following:Triangle, quadrangle and circle.
Optionally, if the shape of the pending image is quadrangle, the pending image and described image feature The matching of benchmark is determined based on the image feature information of the pending image;
Wherein, described image characteristic information, including it is at least one of following:Horizontal pixel and longitudinal pixel, lateral physics are long Degree and longitudinal physical length;
Correspondingly, described image character references, including it is at least one of following:Pixel ratio benchmark laterally and longitudinally, it is horizontal To the physical length scale base with longitudinal direction, horizontal pixel benchmark and longitudinal pixel benchmark, lateral physics length standard and longitudinal direction Physical length benchmark.
Optionally, it before the background pixel characterization step of the borderline region for obtaining pending image executes, executes as follows Operation:
According to the horizontal pixel of the pending image and longitudinal pixel, calculate the horizontal pixel of the pending image with The ratio between longitudinal pixel;
Judge whether the ratio between the horizontal pixel of the pending image and longitudinal pixel are adapted to the pixel ratio benchmark, if It is to show the pending image according to the pixel ratio benchmark;If it is not, executing the frontier district for obtaining pending image The background pixel characterization step in domain.
Optionally, it before the background pixel characterization step of the borderline region for obtaining pending image executes, executes as follows Operation:
It detects the pending image and whether there is borderline region, if so, executing the boundary for obtaining pending image The background pixel characterization step in region;
Wherein, the difference of the pixel value comprising pixel is in pre-set pixel value threshold value model in the borderline region In enclosing.
Optionally, it if it is no that the detection pending image, which whether there is the judging result of borderline region step, holds The following operation of row:
Edge detection is carried out to the pending image, obtains the pictorial element for including in the pending image;
Extract the described image element for including in the pending image;
According to the initial pictures of the horizontal pixel benchmark and longitudinal pixel benchmark composition, determine described image member Element is as the extended area formed after the initial pictures;
The pixel characteristic of the extended area is configured according to presetted pixel feature, and/or, according to from described image The pixel characteristic information extracted in element configures the pixel characteristic of the extended area, obtains third target image.
Optionally, the borderline region of the determination pending image expands outward so that it matches characteristics of image benchmark Extended area, realize in the following way:
According to the horizontal pixel of the pending image and longitudinal pixel, calculate the horizontal pixel of the pending image with The ratio between longitudinal pixel;
Judge whether the ratio between the horizontal pixel and longitudinal pixel are more than the pixel ratio benchmark, if more than institute is judged Whether the horizontal pixel for stating pending image is more than or less than the horizontal pixel benchmark, if so, executing following operation:
It calculates the pending image down or diminution ratio when being amplified to consistent with the horizontal pixel benchmark Or magnification ratio;
According to the diminution ratio, either the magnification ratio is reduced or is amplified to the pending image;
Determine the pending image and the horizontal pixel benchmark and longitudinal pixel benchmark after reducing or amplifying Both initial pictures of composition are in lateral gap, as the extended area.
Optionally, if described judge whether the ratio between the horizontal pixel and longitudinal pixel are more than pixel ratio benchmark The judging result of step is no, executes following operation:
Judge whether the ratio between the horizontal pixel and longitudinal pixel less than the pixel ratio benchmark judge institute if being less than Whether the longitudinal pixel for stating pending image is more than or less than longitudinal pixel benchmark, if so, executing following operation:
It calculates the pending image down or diminution ratio when being amplified to consistent with the longitudinal pixel benchmark Or magnification ratio;
According to the diminution ratio, either the magnification ratio is reduced or is amplified to the pending image;
Determine the pending image and the horizontal pixel benchmark and longitudinal pixel benchmark after reducing or amplifying Both initial pictures of composition are in longitudinal gap, as the extended area.
Optionally, the borderline region of the determination pending image expands outward so that it matches characteristics of image benchmark Extended area, realize in the following way:
According to the lateral physical length of the pending image and longitudinal physical length, the cross of the pending image is calculated To the ratio between physical length and longitudinal physical length;
Judge whether the ratio between the lateral physical length and longitudinal physical length are more than the physical length scale base, if It is more than, judges whether the lateral physical length of the pending image is more than or less than the lateral physics length standard, if It is to execute following operation:
It calculates the pending image down or is amplified to its lateral physical length and the lateral physical length base Diminution ratio when accurate consistent or magnification ratio;
According to the diminution ratio, either the magnification ratio is reduced or is amplified to the pending image;
Determine the pending image and the lateral physics length standard and longitudinal physics after reducing or amplifying Both initial pictures of length standard composition are in lateral gap, as the extended area.
Optionally, if described judge whether the ratio between the lateral physical length and longitudinal physical length are long more than the physics The judging result of degree scale base sub-step is no, executes following operation:
Judge whether the ratio between the lateral physical length and longitudinal physical length are less than the physical length scale base, if It is less than, judges whether longitudinal physical length of the pending image is more than or less than longitudinal physical length benchmark, if It is to execute following operation:
It calculates the pending image down or is amplified to its longitudinal physical length and longitudinal physical length base Diminution ratio when accurate consistent or magnification ratio;
According to the diminution ratio, either the magnification ratio is reduced or is amplified to the pending image;
Determine the pending image and the lateral physics length standard and longitudinal physics after reducing or amplifying Both initial pictures of length standard composition are in longitudinal gap, as the extended area.
The application also provides a kind of device for expanding image, including:
Background pixel feature acquiring unit, the background pixel feature of the borderline region for obtaining pending image;
Extended area determination unit, for determining that the borderline region of the pending image expands so that its matching figure outward As the extended area of character references;
Extended area dispensing unit, for being carried out to the pixel characteristic of the extended area according to the background pixel feature Configuration obtains target image.
Optionally, the device for expanding image, including:
Characteristic similarity determination unit, for determining background pixel feature between each borderline region of pending image Characteristic similarity;
Characteristic similarity judging unit, for judging whether the characteristic similarity is in characteristic similarity threshold interval It is interior, if so, running the extended area determination unit.
The application also provides a kind of electronic equipment, including:
Memory and processor;
For the memory for storing computer executable instructions, the processor is executable for executing the computer Instruction:
Obtain the background pixel feature of the borderline region of pending image;
Determine that the borderline region of the pending image expands outward so that it matches the extended area of characteristics of image benchmark;
The pixel characteristic of the extended area is configured according to the background pixel feature, obtains target image.
The herein described method for expanding image, including:Obtain the background pixel of the borderline region of pending image Feature;Determine that the borderline region of the pending image expands outward so that it matches the extended area of characteristics of image benchmark;It presses The pixel characteristic of the extended area is configured according to the background pixel feature, obtains target image.
The method for expanding image is detected identification, according to knowledge by the borderline region to pending image Other result obtains the background pixel feature of borderline region, and determines pending image according to described image character references displaying when institute The extended area needed carries out pixel characteristic configuration, to make the side of pending image using background pixel feature to extended area Battery limit (BL) domain carries out seamless connection with extended area, avoids artificial the problem of participating in the error and inefficiency that generate, is promoted Treatment effeciency.
Description of the drawings
Attached drawing 1 is a kind of process chart for expanding the embodiment of the method for image provided by the present application;
Attached drawing 2 is the schematic diagram of the first discount coupon provided by the present application;
Attached drawing 3 is the schematic diagram that a kind of image provided by the present application expands;
Attached drawing 4 is the schematic diagram of second of discount coupon provided by the present application;
Attached drawing 5 is a kind of schematic diagram expanding image flow provided by the present application;
Attached drawing 6 is a kind of schematic diagram for expanding the device embodiment of image provided by the present application;
Attached drawing 7 is the schematic diagram of a kind of electronic equipment provided by the present application.
Specific implementation mode
Many details are elaborated in the following description in order to fully understand the application.But the application can be with Much implement different from other modes described here, those skilled in the art can be without prejudice to the application intension the case where Under do similar popularization, therefore the application is not limited by following public specific implementation.
The application provides a kind of method for expanding image, and the application also provides a kind of device for expanding image, And a kind of electronic equipment.It is described in detail one by one below in conjunction with the attached drawing of embodiment provided by the present application, and right Each step of method illustrates.
A kind of embodiment of the method for expanding image provided by the present application is as follows:
With reference to attached drawing 1, it illustrates a kind of process flows for expanding the embodiment of the method for image provided by the present application Figure, with reference to attached drawing 2, it illustrates the schematic diagrames of the first discount coupon provided by the present application, and with reference to attached drawing 3, it illustrates this Shens The schematic diagram that a kind of image that please be provided expands, with reference to attached drawing 4, it illustrates the signals of second of discount coupon provided by the present application Figure, with reference to attached drawing 5, it illustrates a kind of schematic diagrames expanding image flow provided by the present application.
Step S101 obtains the background pixel feature of the borderline region of pending image.
In general, commodity shown in online trading platform in process of exchange, be usually associated with to user provide it is excellent The marketing methods such as favour certificate, to improve the trading volume of commodity.The discount coupon provided at present to user, as shown in Fig. 2, wherein not Only include the title of commodity, price, preferential amount, get condition and got the information such as number, is additionally provided in discount coupon Image shows regions shows commodity image.In practical applications, commodity image shown in discount coupon is uploaded by businessman, And online trading platform often makes limitation to the format and size that upload image, it is desirable that businessman is according to specific format, size And/or ratio uploads the commodity image shown in discount coupon.But it is limited by various influence factors, what many businessmans uploaded Commodity image is undesirable, to ensure the integrality of commodity image, will not cut to the image of upload, is adapted to long side The mode of display area is shown, this commodity image that this may result in uploading is shown in the image shows region of discount coupon When image on the outside of might have and be left white.As shown in Fig. 2, width-high proportion of the first commodity image is too small, leads to commodity figure It has and is left white at left and right sides of when picture is shown in discount coupon;Width-high proportion of second of commodity image is too big, leads to commodity image Both sides, which have, above and below when being shown in discount coupon is left white;It has and is left white at left and right sides of when the third commodity is shown in discount coupon.
It should be noted that commodity image is after being uploaded to online trading platform, can also transaction platform on line commodity Displaying list in be shown, and the commodity image shown in items list may be one or multiple;Meanwhile excellent The image shows region of commodity image displaying, the list being shown in merchandise display list with commodity image are carried out in favour certificate Display area is adapted to, i.e.,:The image shows region of discount coupon and the list display area of displaying list are in the same size, therefore, The commodity image of the image shows region displaying of discount coupon, is included in one or multiple commodity images of items list displaying In, for example the first commodity image that items list is shown is shown as the commodity in the image shows region of discount coupon Commodity image.
In face of this technical problem, the method for expanding image provided by the present application, by image recognition processing skill Art is applied in online trading platform, and processing is identified to the commodity image (pending image) in online trading platform, It is detected identification especially by the borderline region to commodity image, the back of the body to match with commodity image is obtained according to recognition result Scape pixel characteristic (for example, color), and stayed existing when being shown according to the size in image shows region in discount coupon Extended area of the white region as pending image carries out pixel characteristic to extended area using the background pixel feature of acquisition and matches (such as color matching) is set, to make the borderline region of pending image carry out seamless connection with extended area, i.e.,:Allow commodity image with It is left white region to be shown in discount coupon as a complete image, when showing in discount coupon to eliminate commodity image It is existing to be left white region;Artificial the problem of participating in the error and inefficiency that generate is avoided simultaneously, improves treatment effeciency.
In the embodiment of the present application, the pending image it is preferably rectangular in shape, the present embodiment is said as example Bright, three kinds of commodity images that discount coupon as shown in Fig. 2 provides are rectangle.But in practical applications, the pending figure The shape of picture carries out personalized configuration also according to application scenarios, for example commodity image shape can also be circle, diamond shape, triangle The shapes such as shape are not construed as limiting this.
In the specific implementation, during carrying out expansion processing to the pending image, described wait for need to be detected first Whether processing image needs to carry out expansion processing, i.e.,:Detect the image shows region of commodity image and discount coupon that businessman uploads Whether it is adapted to.It specifically can be by the way that the image feature information of the pending image be compared with described image character references (described image character references are format, size and/or the ratio for referring to online trading platform restriction businessman's upload image, can be managed Solution is to be shown and can be adapted to the format in image shows region, size and/or ratio in the image shows region of discount coupon Example), to determine whether the commodity image that businessman uploads be adapted to the image shows region of discount coupon.Preferably, the figure As characteristic information includes:Horizontal pixel and longitudinal pixel, and/or, lateral physical length and longitudinal physical length.Correspondingly, institute Stating characteristics of image benchmark includes:Pixel ratio benchmark laterally and longitudinally, physical length scale base laterally and longitudinally, laterally Pixel benchmark and longitudinal pixel benchmark, and/or, lateral physics length standard and longitudinal physical length benchmark.
In a kind of preferred embodiment provided by the embodiments of the present application, the above-mentioned detection pending image whether need into Row expansion is handled, i.e.,:Whether the commodity image that detection businessman uploads is adapted to the image shows region of discount coupon, using such as lower section Formula is realized:
1) according to the horizontal pixel of the pending image and longitudinal pixel, the horizontal pixel of the pending image is calculated The ratio between with longitudinal pixel;
2) judge whether the ratio between the horizontal pixel of the pending image and longitudinal pixel are adapted to the pixel ratio benchmark, If so, show the pending image can just be adapted to described image character references, i.e., the commodity image that businessman uploads with The image shows region of discount coupon is adapted to, then shows the pending image according to the pixel ratio benchmark;If it is not, table The commodity image that bright businessman uploads can not be adapted to the image shows region of discount coupon, and sign need to expand the pending image Processing is filled, the image (i.e. target image) obtained after making expansion handle can be adapted to described image character references, i.e.,:Make at expansion Commodity image after reason can be adapted to the image shows region of discount coupon, execute this step herein and obtain the pending image The background pixel feature of borderline region.
For example, as shown in Fig. 2, the image shows region of discount coupon it is wide-at high proportion be 4:3, then according to the image exhibition Show that the characteristics of image benchmark that region determines is:Pixel ratio benchmark laterally and longitudinally is 4:3, or physics laterally and longitudinally Length ratio benchmark is 4:3.It follows that the ratio between the horizontal pixel of commodity image and longitudinal pixel meet 4:3, or laterally with The ratio between longitudinal physical length meets 4:3 can be adapted to the image shows region of discount coupon, and on this basis, commodity image exists It will not just be formed when being shown in the image shows region of discount coupon and be left white region.If the horizontal pixel of commodity image and longitudinal picture The ratio between element is unsatisfactory for 4:3, and the ratio between physical length laterally and longitudinally is unsatisfactory for 4:3, then it needs to expand commodity image Processing, the ratio between the horizontal pixel of commodity image and longitudinal pixel meet 4 after so that expansion is handled:3 or expansion processing after commodity figure The ratio between physical length laterally and longitudinally of picture meets 4:3, image of the commodity image that treated to making expansion in discount coupon It will not just be formed when being shown in display area and be left white region.
Further, to ensure pictorial element included in the pending image (for example, the pictorial element or text of commodity Word description information) integrality, the extended area of the pending image is the back of the body according to the pending image boundary region Scape pixel characteristic (for example, background color) configures the pixel characteristic of extended area, and not according to the pending figure As the pixel characteristic of included pictorial element configures the pixel characteristic of extended area.Based on this, to described pending Before image carries out expansion processing, also need to detect the pending image with the presence or absence of borderline region, for example, by image one side edge 5 pixels (pix) are wide and extend to the region of adjacent both sides as a borderline region, borderline region as shown in Fig. 3.This Apply in another preferred embodiment that embodiment provides, specifically realizes in the following way:Detect the pending image With the presence or absence of borderline region, if so, carrying out expansion processing to the pending image, executes and wait locating described in obtaining described in this step Manage the background pixel feature of the borderline region of image;If it is not, show that borderline region is not present in the pending image, Possible situation is that the pending image covers its whole region or most of region comprising pictorial element, is caused each A boundary direction can not all form a complete borderline region.
In this case, the pictorial element for including in the pending image can be extracted by way of " scratching figure " Come, and the pictorial element extracted dosed in new background, and if this background size just with discount coupon The size of image display area is identical, then the new images generated can just be adapted to the image display area of discount coupon, this mistake Cheng Youxuan is realized in the following way:Edge detection is carried out to the pending image, includes in the acquisition pending image Pictorial element;Extract the described image element for including in the pending image;According to the horizontal pixel benchmark and described The initial pictures of longitudinal pixel benchmark composition, determine described image element as the extended area formed after the initial pictures Domain;The pixel characteristic of the extended area is configured according to presetted pixel feature, and/or, according to from described image element The pixel characteristic information of middle extraction configures the pixel characteristic of the extended area, obtains third target image.
It should be noted that it is above-mentioned during detecting the pending image boundary region, it can be combined with reality Application scenarios are defined borderline region, for example borderline region is limited to wherein to include at the difference of pixel value of pixel It is limited in pre-set pixel value threshold range, such as by the pixel value for the pixel for including in same borderline region Between 100-150, i.e.,:The pixel value of wherein pixel is limited to 50 within the scope of this.In addition to this, it is being embodied When, if the difference of the pixel value for the pixel for including in the borderline region be more than it is excessive, can also be according to the picture of pixel The borderline region is divided into one or more boundary subregion by plain value, and different boundary subregion corresponds to different pixels respectively Extended area is also divided into one or more by value section correspondingly, according to the correspondence of borderline region and extended area Expand subregion, and on this basis, according to the pixel characteristic information of boundary subregion to expand the pixel characteristic of subregion into Row configuration, for example the pixel characteristic for expanding subregion is carried out according to the mean value for the pixel value in the subregion of boundary including pixel Configuration.
In this step, the background pixel feature of the borderline region of the pending image is obtained.For example, attached shown in Fig. 3 Three kinds of commodity images, wherein when the image shows region of discount coupon is shown, the left and right sides forms and is left white the first commodity image Region, and it is exactly that the commodity image needs to expand to be adapted to the extended area in the image shows region of discount coupon to be left white region Domain, the regions 5pix wide which is left white edges of regions close to the left and right sides are borderline region, and due to the commodity figure The background color (i.e. background pixel feature) of two borderline regions of picture is identical, after the background color conduct that can extract either boundary region Continue the color for filling extended area.Second of commodity image is when the image shows region of discount coupon is shown, upper and lower both sides Formation is left white region, and it is exactly that the commodity image needs to expand to be adapted to the image shows region of discount coupon to be left white region Extended area, the regions 5pix wide which is left white edges of regions close to upper and lower both sides are borderline region, and due to this The background color (i.e. background pixel feature) of two borderline region of commodity image is identical, can extract the background color in either boundary region As the color for being subsequently used for filling extended area.The third commodity image is left when the image shows region of discount coupon is shown Right both sides form and are left white region, and it is exactly that the commodity image needs to expand to be adapted to the image shows of discount coupon to be left white region The extended area in region, the regions 5pix wide which is left white edges of regions close to the left and right sides are borderline region, and Since the background color (i.e. background pixel feature) of two borderline region of commodity image is different, two borderline regions need to be extracted respectively Background color, as the foundation subsequently matched colors to extended area.
Step S102 determines that the borderline region of the pending image expands outward so that it matches characteristics of image benchmark Extended area.
In the specific implementation, this step determines that the borderline region of the pending image expands outward so that described in its matching Before the extended area of characteristics of image benchmark, it preferably is carried out following borderline region characteristic similarity and judges operation, specific implementation is such as Under:It determines the characteristic similarity of background pixel feature between each borderline region of pending image, and judges the feature phase Like degree whether in characteristic similarity threshold interval, if so, showing background picture between each borderline region of pending image Plain feature is identical (such as attached the first commodity shown in Fig. 3 and second of commodity), then execute this step determine it is described pending The borderline region of image expands outward so that it matches the extended area of described image character references.If it is not, showing described Background pixel feature differs (such as attached the third commodity shown in Fig. 3) between pending each borderline region of image, preferably holds The following operation of row:Establish the correspondence between the borderline region and the extended area;According to the back of the body of the borderline region Scape pixel characteristic, the pixel characteristic that extended area is corresponded to the borderline region configure, and obtain the second target image;Its In, the corresponding extended area of the borderline region, refer in the extended area with borderline region adjacent area maximum Extended area.
For example, attached the third commodity shown in Fig. 3, the commodity image are shown in the image shows region of discount coupon When, which is borderline region close to the left and right regions 5pix for being left white region most edge, due to two frontier district of commodity image The background color in domain is different, therefore, using left side extended area as the corresponding extended area of left boundary area, right side extended area The background color of left boundary area is extracted to left side extended area as the corresponding extended area in right side boundary region in domain Color is configured, and, the background color in extraction right side boundary region configures the color of right side extended area, configures The target image for obtaining display area in adaptation discount coupon after the completion, when practical business demand is reached in the show area of discount coupon The domain views target image.
In practical applications, businessman be uploaded to online trading platform commodity image size it is generally bigger, and discount coupon Size it is smaller, it is therefore desirable to could be carried out in the display area of discount coupon after carrying out certain diminution processing to pending image Displaying.Based on this, this step expands outward in the borderline region for determining the pending image so that it matches characteristics of image base When the extended area of standard, it is preferred to use as under type is realized:
1) according to the horizontal pixel of the pending image and longitudinal pixel, the horizontal pixel of the pending image is calculated The ratio between with longitudinal pixel;
2) judge whether the ratio between the horizontal pixel and longitudinal pixel are more than the pixel ratio benchmark, if more than the picture Plain scale base, judges whether the horizontal pixel of the pending image is more than or less than the horizontal pixel benchmark, if greatly In or less than the horizontal pixel benchmark, following operation is executed:
(a) diminution ratio when extremely consistent with the horizontal pixel benchmark by the pending image down is calculated;
(b) the pending image is reduced according to the diminution ratio;
(c) the pending image and the horizontal pixel benchmark and longitudinal pixel benchmark composition after reducing are determined Both initial pictures are in lateral gap, as the extended area.
If being not more than the pixel ratio benchmark, that is, it is less than or equal to the pixel ratio benchmark, executes following operation:
(d) judge whether the ratio between the horizontal pixel and longitudinal pixel are less than the pixel ratio benchmark, if being less than, judge Whether longitudinal pixel of the pending image is more than or less than longitudinal pixel benchmark, if so, executing following operation:
(e) diminution ratio when extremely consistent with the longitudinal direction pixel benchmark by the pending image down is calculated;
(f) the pending image is reduced according to the diminution ratio;
(g) the pending image and the horizontal pixel benchmark and longitudinal pixel benchmark composition after reducing are determined Both initial pictures are in longitudinal gap, as the extended area.
It is similar therewith, if the commodity image that businessman is uploaded to online trading platform is undersized, that is, it is less than discount coupon Display area size, then need to pending image be amplified processing after could be opened up in the display area of discount coupon Show, it is preferred to use as under type is realized:According to the horizontal pixel of the pending image and longitudinal pixel, calculate described pending The ratio between the horizontal pixel of image and longitudinal pixel;Judge whether the ratio between the horizontal pixel and longitudinal pixel are more than the pixel ratio Example benchmark judges whether the horizontal pixel of the pending image is more than or less than institute if more than the pixel ratio benchmark Horizontal pixel benchmark is stated, if more than or less than the horizontal pixel benchmark, executes following operation:It calculates the pending figure As magnification ratio when being amplified to consistent with the horizontal pixel benchmark;According to the magnification ratio to the pending image into Row amplification;Determine that the pending image forms initial with the horizontal pixel benchmark and longitudinal pixel benchmark after amplifying Both images are in lateral gap, as the extended area.
If being less than or equal to the pixel ratio benchmark, following operation is executed:Judge the horizontal pixel and longitudinal picture The ratio between element whether be less than the pixel ratio benchmark, if being less than, judge longitudinal pixel of the pending image whether be more than or Person is less than longitudinal pixel benchmark, if so, executing following operation:Calculate will the pending image magnification extremely with the longitudinal direction Magnification ratio when pixel benchmark is consistent;The pending image is amplified according to the magnification ratio;After determining amplification Both the pending image and the initial pictures of the horizontal pixel benchmark and longitudinal pixel benchmark composition are in longitudinal direction Gap, as the extended area.
The embodiment of the present application is provided in another preferred embodiment, this step determines the frontier district of the pending image The extended area so that its matching characteristics of image benchmark is expanded in domain outward, realizes in the following way:According to the pending figure The lateral physical length of picture and longitudinal physical length calculate the lateral physical length of the pending image and longitudinal physical length The ratio between, judge whether the ratio between the lateral physical length and longitudinal physical length are more than the physical length scale base, if greatly In judging whether the lateral physical length of the pending image is more than or less than the lateral physics length standard, if greatly In the physical length scale base, following operation is executed:It calculates the pending image down or is amplified to its transverse direction Diminution ratio when physical length and the consistent lateral physics length standard or magnification ratio, according to the diminution ratio or Magnification ratio described in person, which reduces the pending image, either amplifies the pending figure after determination is reduced or amplified As and both initial pictures of the lateral physics length standard and longitudinal physical length benchmark composition in lateral gap, As the extended area.
If being less than or equal to the physical length scale base, following operation is executed:Judge the lateral physical length Whether it is less than the physical length scale base with the ratio between longitudinal physical length, if being less than, judges indulging for the pending image Whether it is more than or less than longitudinal physical length benchmark to physical length, if so, executing following operation:Calculating is waited for described Processing image down or be amplified to its longitudinal physical length it is consistent with the longitudinal direction physical length benchmark when diminution ratio or Person's magnification ratio, according to the diminution ratio, either the magnification ratio is reduced or is amplified to the pending image, Determine the pending image and the lateral physics length standard and longitudinal physical length benchmark after reducing or amplifying Both initial pictures of composition are in longitudinal gap, as the extended area.
Step S103 configures the pixel characteristic of the extended area according to the background pixel feature, obtains mesh Logo image.
Above-mentioned steps S101 obtains the background pixel feature of the borderline region of the pending image, and above-mentioned steps S102 is true The borderline region of the fixed pending image expands outward so that it matches the extended area of characteristics of image benchmark, in this step, The pixel characteristic of the extended area is configured using the background pixel feature, obtains target image.For example, such as attached drawing Shown in 3, for wherein the first commodity, the left and right sides is expanded using the background color extracted in left and right sides frontier district domain The color in region is configured, and the target image in the image shows region that can be adapted to discount coupon is obtained.Second of commodity utilizes The color of upper and lower both sides extended area is configured in the background color that upper and lower both sides borderline region extracts, acquisition can fit The target image in the image shows region with discount coupon.The third commodity utilizes the background face extracted in left boundary area Color configures the color of the extended area in left side, and using the background color arrived in right side boundary extracted region to right side The color of extended area configured, obtain the target image in the image shows region that can be adapted to discount coupon.
In the specific implementation, as shown in Fig. 5, the target image in the image shows region of above-mentioned acquisition adaptation discount coupon it Afterwards, the target image is sent to client together with discount coupon, is shown in the user interface of client, is finally existed The discount coupon shown in client user interface is as shown in Fig. 4, wherein no longer occurs due to commodity figure in image shows region It is left white region as caused by not being adapted to image shows region.
In conclusion the method for expanding image provided by the present application, image recognition processing technology is applied to In online trading platform, processing is identified to the commodity image in online trading platform, especially by commodity image Borderline region is detected identification, the background color to match with commodity image is obtained according to recognition result, and will be in discount coupon In the existing extended area for being left white region as commodity image when being shown according to the size in image shows region, and utilize The background color of acquisition configures the color of extended area, to make the borderline region of commodity image be carried out with extended area Seamless connection existing when commodity image is shown in discount coupon is left white region to eliminate;Artificial participation production is avoided simultaneously The problem of raw error and inefficiency, improve treatment effeciency.
A kind of device embodiment for expanding image provided by the present application is as follows:
In the above-described embodiment, a kind of method for expanding image is provided, corresponding, the application also carries A kind of device for expanding image has been supplied, has been illustrated below in conjunction with the accompanying drawings.
With reference to attached drawing 6, it illustrates a kind of schematic diagrames for expanding the device embodiment of image provided by the present application.
Since device embodiment is substantially similar to embodiment of the method, so describing fairly simple, relevant part please join The corresponding explanation of the embodiment of the method for above-mentioned offer is provided.Device embodiment described below is only schematical.
The application provides a kind of device for expanding image, including:
Background pixel feature acquiring unit 601, the background pixel feature of the borderline region for obtaining pending image;
Extended area determination unit 602, for determine the pending image borderline region outward expand so that its Extended area with image character references;
Extended area dispensing unit 603 is used for according to the background pixel feature to the pixel characteristic of the extended area It is configured, obtains target image.
Optionally, the device for expanding image, including:
Characteristic similarity determination unit, for determining background pixel feature between each borderline region of pending image Characteristic similarity;
Characteristic similarity judging unit, for judging whether the characteristic similarity is in characteristic similarity threshold interval It is interior, if so, running the extended area determination unit 602.
Optionally, if the judging result of characteristic similarity judging unit output is no, operation correspondence is established single Member and pixel characteristic dispensing unit;
Wherein, the correspondence relationship establishing unit, for establishing pair between the borderline region and the extended area It should be related to;
The pixel characteristic dispensing unit, for the background pixel feature according to the borderline region, to the frontier district The pixel characteristic that domain corresponds to extended area is configured, and the second target image is obtained;
Wherein, the corresponding extended area of the borderline region, refer in the extended area with the borderline region phase The maximum extended area in neighbouring region.
Optionally, the shape of the pending image includes at least one of following:Triangle, quadrangle and circle.
Optionally, if the shape of the pending image is quadrangle, the pending image and described image feature The matching of benchmark is determined based on the image feature information of the pending image;
Wherein, described image characteristic information, including it is at least one of following:Horizontal pixel and longitudinal pixel, lateral physics are long Degree and longitudinal physical length;
Correspondingly, described image character references, including it is at least one of following:Pixel ratio benchmark laterally and longitudinally, it is horizontal To the physical length scale base with longitudinal direction, horizontal pixel benchmark and longitudinal pixel benchmark, lateral physics length standard and longitudinal direction Physical length benchmark.
Optionally, the device for expanding image, including:
Pixel ratio computing unit is waited for for the horizontal pixel and longitudinal direction pixel according to the pending image described in calculating Handle the ratio between the horizontal pixel of image and longitudinal pixel;
Pixel ratio judging unit, for judging whether the ratio between the horizontal pixel of the pending image and longitudinal pixel fit With the pixel ratio benchmark, if so, showing the pending image according to the pixel ratio benchmark;If it is not, described in operation Background pixel feature acquiring unit 601.
Optionally, the device for expanding image, including:
Borderline region detection unit whether there is borderline region, if so, described in operation for detecting the pending image Background pixel feature acquiring unit 601;
Wherein, the difference of the pixel value comprising pixel is in pre-set pixel value threshold value model in the borderline region In enclosing.
Optionally, if the judging result of borderline region detection unit output is no, operation edge detection unit, image Element extraction unit, the second extended area determination unit and the second pixel characteristic dispensing unit;
Wherein, the edge detection unit obtains described pending for carrying out edge detection to the pending image The pictorial element for including in image;
Described image element extraction unit, for extracting the described image element for including in the pending image;
The second extended area determination unit, for according to the horizontal pixel benchmark and longitudinal pixel benchmark group At initial pictures, determine by described image element as the extended area formed after the initial pictures;
The second pixel characteristic dispensing unit is used for according to presetted pixel feature to the pixel characteristic of the extended area It is configured, and/or, according to the pixel characteristic information extracted from described image element to the pixel characteristic of the extended area It is configured, obtains third target image.
Optionally, the extended area determination unit 602, including:
Pixel ratio computation subunit, for according to the horizontal pixel of the pending image and longitudinal pixel, described in calculating The ratio between the horizontal pixel of pending image and longitudinal pixel;
Pixel ratio judgment sub-unit, for judging whether the ratio between the horizontal pixel and longitudinal pixel are more than the pixel ratio Example benchmark, if more than horizontal pixel judgment sub-unit is run;
The horizontal pixel judgment sub-unit, for judging whether the horizontal pixel of the pending image is more than or small In the horizontal pixel benchmark, if so, operation scaling computation subunit, scaling execute subelement and extended area determines Subelement;
Wherein, the scaling computation subunit, for calculate by the pending image down or be amplified to Diminution ratio when the horizontal pixel benchmark is consistent or magnification ratio;
The scaling executes subelement, is used for according to the diminution ratio or the magnification ratio to the pending figure As being reduced or being amplified;
The extended area determination subelement, for the pending image and the transverse direction after determining diminution or amplifying Both initial pictures of pixel benchmark and longitudinal pixel benchmark composition are in lateral gap, as the extended area.
Optionally, if the judging result of pixel ratio judgment sub-unit output is no, secondary judgement of operation pixel ratio Unit;
The secondary judgment sub-unit of pixel ratio, for judging whether the ratio between the horizontal pixel and longitudinal pixel are less than institute Pixel ratio benchmark is stated, if being less than, runs longitudinal pixel judgment sub-unit;
The longitudinal direction pixel judgment sub-unit, for judging whether longitudinal pixel of the pending image is more than or small In longitudinal pixel benchmark, if so, the second scaling computation subunit of operation, the second scaling execute subelement and second Extended area determination subelement;
Wherein, the second scaling computation subunit, for calculating the pending image down or amplification Diminution ratio when extremely consistent with the longitudinal direction pixel benchmark or magnification ratio;
Second scaling executes subelement, for waiting locating to described according to the diminution ratio or the magnification ratio Reason image is reduced or is amplified;
The second extended area determination subelement, for determine reduce or amplification after the pending image with it is described Both initial pictures of horizontal pixel benchmark and longitudinal pixel benchmark composition are in longitudinal gap, as the extended area Domain.
Optionally, the extended area determination unit 602, including:
Physical length is than computation subunit, for long according to the lateral physical length of the pending image and longitudinal physics Degree calculates the ratio between the lateral physical length of the pending image and longitudinal physical length;
Physical length is than judgment sub-unit, for judging whether the ratio between the lateral physical length and longitudinal physical length are big In the physical length scale base, if more than lateral physical length judgment sub-unit is run;
Whether the transverse direction physical length judgment sub-unit, the lateral physical length for judging the pending image are big In or less than the lateral physics length standard, if so, operation third scaling computation subunit, third scaling execute son Unit and third extended area determination subelement;
Wherein, the third scaling computation subunit, for calculating the pending image down or amplification Diminution ratio when to its lateral physical length and the consistent lateral physics length standard or magnification ratio;
The third scaling executes subelement, for waiting locating to described according to the diminution ratio or the magnification ratio Reason image is reduced or is amplified;
The third extended area determination subelement, for determine reduce or amplification after the pending image with it is described Both initial pictures of lateral physics length standard and longitudinal physical length benchmark composition are in lateral gap, as described Extended area.
Optionally, if the physical length is no than the judging result that judgment sub-unit exports, operation physical length is than two Secondary judgment sub-unit;
The physical length than secondary judgment sub-unit, for judge the lateral physical length and longitudinal physical length it Than whether being less than the physical length scale base, if being less than, longitudinal physical length judgment sub-unit is run;
Whether the longitudinal direction physical length judgment sub-unit, longitudinal physical length for judging the pending image are big In or less than longitudinal physical length benchmark, if so, the 4th scaling computation subunit of operation, the 4th scaling execute son Unit and the 4th extended area determination subelement;
Wherein, the 4th scaling computation subunit, for calculating the pending image down or amplification Diminution ratio when to its longitudinal physical length and consistent longitudinal physical length benchmark or magnification ratio;
4th scaling executes subelement, for waiting locating to described according to the diminution ratio or the magnification ratio Reason image is reduced or is amplified;
The 4th extended area determination subelement, for determine reduce or amplification after the pending image with it is described Both initial pictures of lateral physics length standard and longitudinal physical length benchmark composition are in longitudinal gap, as described Extended area.
A kind of electronic equipment embodiment provided by the present application is as follows:
In the above-described embodiment, a kind of method for expanding image is provided, in addition, present invention also provides one kind For realizing the electronic equipment for expanding the method for image, illustrate below in conjunction with the accompanying drawings.
With reference to attached drawing 7, it illustrates the schematic diagrames of a kind of electronic equipment provided in this embodiment.
The electronic equipment embodiment provided by the present application describes fairly simple, and relevant part refers to above-mentioned offer The corresponding explanation for expanding the embodiment of the method for image.Embodiment described below is only schematical.
The application provides a kind of electronic equipment, including:
Memory 701 and processor 702;
The memory 701 is for storing computer executable instructions, and the processor 702 is for executing following computer Executable instruction:
Obtain the background pixel feature of the borderline region of pending image;
Determine that the borderline region of the pending image expands outward so that it matches the extended area of characteristics of image benchmark;
The pixel characteristic of the extended area is configured according to the background pixel feature, obtains target image.
Optionally, after the background pixel feature instruction execution of the borderline region for obtaining pending image, and it is described true Before the borderline region of the fixed pending image expands outward so that it matches the extended area instruction execution of characteristics of image benchmark, The processor 702 is additionally operable to execute following computer executable instructions:
Determine the characteristic similarity of background pixel feature between each borderline region of pending image;
The characteristic similarity is judged whether in characteristic similarity threshold interval, if so, executing described in the determination The borderline region of pending image expands outward so that it matches the extended area instruction of characteristics of image benchmark.
Optionally, if described judge whether the characteristic similarity is in the execution knot instructed in feature similar threshold value section Fruit is no, executes following operation:
Establish the correspondence between the borderline region and the extended area;
According to the background pixel feature of the borderline region, to the borderline region correspond to the pixel characteristic of extended area into Row configuration, obtains the second target image;
Wherein, the corresponding extended area of the borderline region, refer in the extended area with the borderline region phase The maximum extended area in neighbouring region.
Optionally, the shape of the pending image includes at least one of following:Triangle, quadrangle and circle.
Optionally, if the shape of the pending image is quadrangle, the pending image and described image feature The matching of benchmark is determined based on the image feature information of the pending image;
Wherein, described image characteristic information, including it is at least one of following:Horizontal pixel and longitudinal pixel, lateral physics are long Degree and longitudinal physical length;
Correspondingly, described image character references, including it is at least one of following:Pixel ratio benchmark laterally and longitudinally, it is horizontal To the physical length scale base with longitudinal direction, horizontal pixel benchmark and longitudinal pixel benchmark, lateral physics length standard and longitudinal direction Physical length benchmark.
Optionally, before the background pixel feature instruction execution of the borderline region for obtaining pending image, the processing Device 702 is additionally operable to execute following computer executable instructions:
According to the horizontal pixel of the pending image and longitudinal pixel, calculate the horizontal pixel of the pending image with The ratio between longitudinal pixel;
Judge whether the ratio between the horizontal pixel of the pending image and longitudinal pixel are adapted to the pixel ratio benchmark, if It is to show the pending image according to the pixel ratio benchmark;If it is not, executing the frontier district for obtaining pending image The background pixel feature in domain instructs.
Optionally, before the background pixel feature instruction execution of the borderline region for obtaining pending image, the processing Device 702 is additionally operable to execute following computer executable instructions:
It detects the pending image and whether there is borderline region, if so, executing the boundary for obtaining pending image The background pixel feature in region instructs;
Wherein, the difference of the pixel value comprising pixel is in pre-set pixel value threshold value model in the borderline region In enclosing.
Optionally, if the implementing result that the detection pending image is instructed with the presence or absence of borderline region is no, institute Processor 702 is stated to be additionally operable to execute following computer executable instructions:
Edge detection is carried out to the pending image, obtains the pictorial element for including in the pending image;
Extract the described image element for including in the pending image;
According to the initial pictures of the horizontal pixel benchmark and longitudinal pixel benchmark composition, determine described image member Element is as the extended area formed after the initial pictures;
The pixel characteristic of the extended area is configured according to presetted pixel feature, and/or, according to from described image The pixel characteristic information extracted in element configures the pixel characteristic of the extended area, obtains third target image.
Optionally, the borderline region of the determination pending image expands outward so that it matches characteristics of image benchmark Extended area, realize in the following way:
According to the horizontal pixel of the pending image and longitudinal pixel, calculate the horizontal pixel of the pending image with The ratio between longitudinal pixel;
Judge whether the ratio between the horizontal pixel and longitudinal pixel are more than the pixel ratio benchmark, if more than institute is judged Whether the horizontal pixel for stating pending image is more than or less than the horizontal pixel benchmark, if so, executing following operation:
It calculates the pending image down or diminution ratio when being amplified to consistent with the horizontal pixel benchmark Or magnification ratio;
According to the diminution ratio, either the magnification ratio is reduced or is amplified to the pending image;
Determine the pending image and the horizontal pixel benchmark and longitudinal pixel benchmark after reducing or amplifying Both initial pictures of composition are in lateral gap, as the extended area.
Optionally, if described judge whether the ratio between the horizontal pixel and longitudinal pixel refer to more than the pixel ratio benchmark The implementing result of order is no, executes following operation:
Judge whether the ratio between the horizontal pixel and longitudinal pixel less than the pixel ratio benchmark judge institute if being less than Whether the longitudinal pixel for stating pending image is more than or less than longitudinal pixel benchmark, if so, executing following operation:
It calculates the pending image down or diminution ratio when being amplified to consistent with the longitudinal pixel benchmark Or magnification ratio;
According to the diminution ratio, either the magnification ratio is reduced or is amplified to the pending image;
Determine the pending image and the horizontal pixel benchmark and longitudinal pixel benchmark after reducing or amplifying Both initial pictures of composition are in longitudinal gap, as the extended area.
Optionally, the borderline region of the determination pending image expands outward so that it matches characteristics of image benchmark Extended area, realize in the following way:
According to the lateral physical length of the pending image and longitudinal physical length, the cross of the pending image is calculated To the ratio between physical length and longitudinal physical length;
Judge whether the ratio between the lateral physical length and longitudinal physical length are more than the physical length scale base, if It is more than, judges whether the lateral physical length of the pending image is more than or less than the lateral physics length standard, if It is to execute following operation:
It calculates the pending image down or is amplified to its lateral physical length and the lateral physical length base Diminution ratio when accurate consistent or magnification ratio;
According to the diminution ratio, either the magnification ratio is reduced or is amplified to the pending image;
Determine the pending image and the lateral physics length standard and longitudinal physics after reducing or amplifying Both initial pictures of length standard composition are in lateral gap, as the extended area.
Optionally, if described judge whether the ratio between the lateral physical length and longitudinal physical length are long more than the physics The implementing result of degree scale base instruction is no, executes following operation:
Judge whether the ratio between the lateral physical length and longitudinal physical length are less than the physical length scale base, if It is less than, judges whether longitudinal physical length of the pending image is more than or less than longitudinal physical length benchmark, if It is to execute following operation:
It calculates the pending image down or is amplified to its longitudinal physical length and longitudinal physical length base Diminution ratio when accurate consistent or magnification ratio;
According to the diminution ratio, either the magnification ratio is reduced or is amplified to the pending image;
Determine the pending image and the lateral physics length standard and longitudinal physics after reducing or amplifying Both initial pictures of length standard composition are in longitudinal gap, as the extended area.
Although the application is disclosed as above with preferred embodiment, it is not for limiting the application, any this field skill Art personnel are not departing from spirit and scope, can make possible variation and modification, therefore the guarantor of the application Shield range should be subject to the range that the application claim defined.
In a typical configuration, computing device includes that one or more processors, input/output interface, network connect Mouth and memory.
Memory may include computer-readable medium in volatile memory, random access memory (RAM) and/or The forms such as Nonvolatile memory, such as read-only memory (ROM) or flash memory (flash RAM).Memory is computer-readable medium Example.
Computer-readable medium includes permanent and non-permanent, removable and non-removable media can be by any method Or technology realizes information storage.Information can be computer-readable instruction, data structure, the module of program or other data. The example of the storage medium of computer includes, but are not limited to phase transition internal memory (PRAM), static RAM (SRAM), moves State random access memory (DRAM), other kinds of random access memory (RAM), read-only memory (ROM), electric erasable Programmable read only memory (EEPROM), fast flash memory bank or other memory techniques, read-only disc read only memory (CD-ROM) (CD-ROM), Digital versatile disc (DVD) or other optical storages, magnetic tape cassette, tape magnetic disk storage or other magnetic storage apparatus Or any other non-transmission medium, it can be used for storage and can be accessed by a computing device information.As defined in this article, it calculates Machine readable medium does not include non-temporary computer readable media (transitory media), such as data-signal and carrier wave of modulation.
It will be understood by those skilled in the art that embodiments herein can be provided as method, system or computer program product. Therefore, complete hardware embodiment, complete software embodiment or embodiment combining software and hardware aspects can be used in the application Form.It is deposited moreover, the application can be used to can be used in the computer that one or more wherein includes computer usable program code The shape for the computer program product implemented on storage media (including but not limited to magnetic disk storage, CD-ROM, optical memory etc.) Formula.

Claims (10)

1. a kind of method for expanding image, which is characterized in that including:
Obtain the background pixel feature of the borderline region of pending image;
Determine that the borderline region of the pending image expands outward so that it matches the extended area of characteristics of image benchmark;
The pixel characteristic of the extended area is configured according to the background pixel feature, obtains target image.
2. the method according to claim 1 for expanding image, which is characterized in that the side for obtaining pending image After the background pixel characterization step in battery limit (BL) domain executes, and the borderline region of the determination pending image expand outward so that Before it matches the extended area step execution of characteristics of image benchmark, following operation is executed:
Determine the characteristic similarity of background pixel feature between each borderline region of pending image;
Judge that the characteristic similarity whether in characteristic similarity threshold interval, waits locating if so, executing described in the determination The borderline region for managing image expands outward so that it matches the extended area step of characteristics of image benchmark.
3. the method according to claim 1 for expanding image, which is characterized in that the shape packet of the pending image It includes at least one of following:Triangle, quadrangle and circle.
4. the method according to claim 3 for expanding image, which is characterized in that if the shape of the pending image For quadrangle, the then matching of the pending image and described image character references, the image based on the pending image is special Reference breath determines;
Wherein, described image characteristic information, including it is at least one of following:Horizontal pixel and longitudinal pixel, lateral physical length with Longitudinal physical length;
Correspondingly, described image character references, including it is at least one of following:Pixel ratio benchmark laterally and longitudinally, laterally with Longitudinal physical length scale base, horizontal pixel benchmark and longitudinal pixel benchmark, lateral physics length standard and longitudinal physics Length standard.
5. the method according to claim 4 for expanding image, which is characterized in that the side for obtaining pending image Before the background pixel characterization step in battery limit (BL) domain executes, following operation is executed:
According to the horizontal pixel of the pending image and longitudinal pixel, horizontal pixel and the longitudinal direction of the pending image are calculated The ratio between pixel;
Judge whether the ratio between the horizontal pixel of the pending image and longitudinal pixel are adapted to the pixel ratio benchmark, if so, The pending image is shown according to the pixel ratio benchmark;If it is not, executing the borderline region for obtaining pending image Background pixel characterization step.
6. the method according to claim 4 for expanding image, which is characterized in that the side for obtaining pending image Before the background pixel characterization step in battery limit (BL) domain executes, following operation is executed:
It detects the pending image and whether there is borderline region, if so, executing the borderline region for obtaining pending image Background pixel characterization step;
Wherein, the difference of the pixel value comprising pixel is in pre-set pixel value threshold range in the borderline region It is interior.
7. the method according to claim 6 for expanding image, which is characterized in that if the detection pending figure As being no with the presence or absence of the judging result of borderline region step, following operation is executed:
Edge detection is carried out to the pending image, obtains the pictorial element for including in the pending image;
Extract the described image element for including in the pending image;
According to the initial pictures of the horizontal pixel benchmark and longitudinal pixel benchmark composition, determine described image element extremely The extended area formed after the initial pictures;
The pixel characteristic of the extended area is configured according to presetted pixel feature, and/or, according to from described image element The pixel characteristic information of middle extraction configures the pixel characteristic of the extended area, obtains third target image.
8. the method for expanding image according to claim 4 to 7 any one, which is characterized in that the determining institute The borderline region for stating pending image expands outward so that it matches the extended area of characteristics of image benchmark, in the following way in fact It is existing:
According to the horizontal pixel of the pending image and longitudinal pixel, horizontal pixel and the longitudinal direction of the pending image are calculated The ratio between pixel;
Judge whether the ratio between the horizontal pixel and longitudinal pixel are more than the pixel ratio benchmark, if more than being waited for described in judgement Whether the horizontal pixel for handling image is more than or less than the horizontal pixel benchmark, if so, executing following operation:
Calculate diminution ratio when the pending image down is either amplified to consistent with the horizontal pixel benchmark or Magnification ratio;
According to the diminution ratio, either the magnification ratio is reduced or is amplified to the pending image;
Determine that the pending image is formed with the horizontal pixel benchmark and longitudinal pixel benchmark after reducing or amplifying Both initial pictures in lateral gap, as the extended area.
9. a kind of device for expanding image, which is characterized in that including:
Background pixel feature acquiring unit, the background pixel feature of the borderline region for obtaining pending image;
Extended area determination unit, for determining that the borderline region of the pending image expands outward so that it matches image spy Levy the extended area of benchmark;
Extended area dispensing unit, for matching to the pixel characteristic of the extended area according to the background pixel feature It sets, obtains target image.
10. a kind of electronic equipment, which is characterized in that including:
Memory and processor;
The memory is for storing computer executable instructions, and for executing, the computer is executable to be referred to the processor It enables:
Obtain the background pixel feature of the borderline region of pending image;
Determine that the borderline region of the pending image expands outward so that it matches the extended area of characteristics of image benchmark;
The pixel characteristic of the extended area is configured according to the background pixel feature, obtains target image.
CN201810104571.8A 2018-02-02 2018-02-02 Method for expanding image and device Pending CN108491847A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201810104571.8A CN108491847A (en) 2018-02-02 2018-02-02 Method for expanding image and device

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201810104571.8A CN108491847A (en) 2018-02-02 2018-02-02 Method for expanding image and device

Publications (1)

Publication Number Publication Date
CN108491847A true CN108491847A (en) 2018-09-04

Family

ID=63344461

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201810104571.8A Pending CN108491847A (en) 2018-02-02 2018-02-02 Method for expanding image and device

Country Status (1)

Country Link
CN (1) CN108491847A (en)

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN110619312A (en) * 2019-09-20 2019-12-27 百度在线网络技术(北京)有限公司 Method, device and equipment for enhancing positioning element data and storage medium
CN112464758A (en) * 2020-11-16 2021-03-09 深圳市优必选科技股份有限公司 Data enhancement method and device for gesture recognition, computer equipment and storage medium

Citations (7)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US8355571B2 (en) * 2010-02-17 2013-01-15 Samsung Electronics Co., Ltd Apparatus and method for generating image for character region extraction
CN103020971A (en) * 2012-12-28 2013-04-03 青岛爱维互动信息技术有限公司 Method for automatically segmenting target objects from images
CN103400343A (en) * 2013-07-15 2013-11-20 中国航天科工集团第三研究院第八三五八研究所 Method for compensating uneven brightness of bottom view image under nighttime infrared
CN104700418A (en) * 2015-03-24 2015-06-10 江南大学 Method for estimating precise circumferences of target boundaries based on gray level information
CN105139433A (en) * 2015-08-05 2015-12-09 西安电子科技大学 Method for simulating infrared small target image sequence based on mean value model
US9786055B1 (en) * 2016-03-29 2017-10-10 Adobe Systems Incorporated Method and apparatus for real-time matting using local color estimation and propagation
CN107393459A (en) * 2017-07-31 2017-11-24 京东方科技集团股份有限公司 Method for displaying image and device

Patent Citations (7)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US8355571B2 (en) * 2010-02-17 2013-01-15 Samsung Electronics Co., Ltd Apparatus and method for generating image for character region extraction
CN103020971A (en) * 2012-12-28 2013-04-03 青岛爱维互动信息技术有限公司 Method for automatically segmenting target objects from images
CN103400343A (en) * 2013-07-15 2013-11-20 中国航天科工集团第三研究院第八三五八研究所 Method for compensating uneven brightness of bottom view image under nighttime infrared
CN104700418A (en) * 2015-03-24 2015-06-10 江南大学 Method for estimating precise circumferences of target boundaries based on gray level information
CN105139433A (en) * 2015-08-05 2015-12-09 西安电子科技大学 Method for simulating infrared small target image sequence based on mean value model
US9786055B1 (en) * 2016-03-29 2017-10-10 Adobe Systems Incorporated Method and apparatus for real-time matting using local color estimation and propagation
CN107393459A (en) * 2017-07-31 2017-11-24 京东方科技集团股份有限公司 Method for displaying image and device

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN110619312A (en) * 2019-09-20 2019-12-27 百度在线网络技术(北京)有限公司 Method, device and equipment for enhancing positioning element data and storage medium
CN112464758A (en) * 2020-11-16 2021-03-09 深圳市优必选科技股份有限公司 Data enhancement method and device for gesture recognition, computer equipment and storage medium

Similar Documents

Publication Publication Date Title
JP6209717B1 (en) Information processing system, information processing method, and program
US8908903B2 (en) Image recognition to support shelf auditing for consumer research
US20180330504A1 (en) Systems and methods for determining a camera pose of an image
CN103020947A (en) Image quality analysis method and device
JP2020038619A (en) Object detection method, device, and storage medium
US20120321134A1 (en) Face tracking method and device
US8812376B2 (en) Techniques for generating an electronic shopping list
CN107609056A (en) A kind of question and answer processing method and equipment based on picture recognition
CN110321797A (en) Commodity recognition method and device
CN108364420A (en) Image-recognizing method and device and electronic equipment
CN102800085B (en) Method for detecting and extracting main target image in complicated image
CN104537355A (en) Remarkable object detecting method utilizing image boundary information and area connectivity
CN109308716A (en) A kind of image matching method, device, electronic equipment and storage medium
CN108491847A (en) Method for expanding image and device
CN109544262A (en) Item recommendation method, device, electronic equipment, system and readable storage medium storing program for executing
CN114419289B (en) Unity-based virtual scene shelf display method and system
Hog et al. Light field segmentation using a ray-based graph structure
US9865088B2 (en) Evaluation of augmented reality skins
CN105070094B (en) A kind of parking stall measure system and method for detecting parking stalls based on machine vision
CN110209858A (en) Exhibiting pictures determination, object search, methods of exhibiting, device, equipment and medium
CN108764248B (en) Image feature point extraction method and device
CN110851059A (en) Picture editing method and device and electronic equipment
CN109242601A (en) Commodity information query method and system
US20230177580A1 (en) Design-Aware Image Search
CN107079113A (en) An action shot and message alteration based on geographical position

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
RJ01 Rejection of invention patent application after publication

Application publication date: 20180904

RJ01 Rejection of invention patent application after publication