CN105657241A - Superpixel picture imaging method and device and electronic device - Google Patents

Superpixel picture imaging method and device and electronic device Download PDF

Info

Publication number
CN105657241A
CN105657241A CN201510526293.1A CN201510526293A CN105657241A CN 105657241 A CN105657241 A CN 105657241A CN 201510526293 A CN201510526293 A CN 201510526293A CN 105657241 A CN105657241 A CN 105657241A
Authority
CN
China
Prior art keywords
pixel
minimum rectangle
pixel value
pixels
limit
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
CN201510526293.1A
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.)
Yulong Computer Telecommunication Scientific Shenzhen Co Ltd
Original Assignee
Yulong Computer Telecommunication Scientific Shenzhen 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 Yulong Computer Telecommunication Scientific Shenzhen Co Ltd filed Critical Yulong Computer Telecommunication Scientific Shenzhen Co Ltd
Priority to CN201510526293.1A priority Critical patent/CN105657241A/en
Publication of CN105657241A publication Critical patent/CN105657241A/en
Pending legal-status Critical Current

Links

Landscapes

  • Image Processing (AREA)

Abstract

The invention discloses a superpixel picture imaging method and device and an electronic device. The method comprises following steps: obtaining an original picture, wherein the original picture comprises MxN pixels; forming (M-1)x(N-1) minimum rectangles composed of the pixels; traversing each pixel in a mode of traversing every minimum rectangle, thus obtaining the pixel values of the pixels at the endpoint locations of each minimum rectangle; aiming at each minimum rectangle, determining the pixel values of first to-be-inserted pixels on each side according to the pixel values of the pixels at the endpoint locations at two ends of each side; determining the pixel values of second to-be-inserted pixels according to the pixel values of the pixels at the endpoint locations at two ends of any one diagonal; inserting corresponding first to-be-inserted pixels at the midpoint location of each side of each minimum rectangle; and inserting corresponding second to-be-inserted pixels at the midpoint location of the diagonal of each minimum rectangle, thus forming a superpixel picture. Through the technical solution provided by the invention, the speed of photographing the superpixel picture can be effectively improved; and the user experience is promoted.

Description

A kind of super-pixel photo formation method, device and a kind of electronics
Technical field
The present invention relates to electronic technology field, particularly relate to a kind of super-pixel photo formation method, device and a kind of electronics.
Background technology
Super-pixel photo refers to that shooting photo out is more much larger than the photo size of general mode, a kind of photo that image quality seems finer and smoother, and this kind of photo receives the welcome of people because of its plurality of advantages.
Current technical scheme, will obtain super-pixel photo needs, with camera, Same Scene is taken multiple pictures (being generally 5) continuously, and then is synthesized by these photos, finally obtains super-pixel photo.
But, Same Scene is taken multiple pictures continuously consuming time longer, in addition, this multiple pictures is synthesized, it is also desirable to some times, therefore, current technical scheme needs the longer time just can synthesize super-pixel photo, and Consumer's Experience is poor.
Summary of the invention
In view of this, the present invention provides a kind of super-pixel photo formation method, device and a kind of electronics, it is possible to effectively improve the speed of shooting super-pixel photo, thus brings better experience for user.
For achieving the above object, the present invention provides following technical scheme:
A kind of super-pixel photo formation method, is applied to electronics, and described electronics comprises camera, and described method comprises:
Obtain the source photo taken with described camera; Described source photo comprises M �� N number of pixel, form the individual minimum rectangle being made up of four pixels of (M-1) �� (N-1), in described four pixels, any two pixels are pixel adjacent in the photo of described source, M and N is positive integer;
In the way of traveling through minimum rectangle described in each, travel through the pixel forming minimum rectangle described in each, obtain the pixel value of minimum rectangle pixel described in each;
For minimum rectangle described in each, according to the pixel value of two ends, every bar limit endpoint location two pixels, determine that every bar limit first is inserted into the pixel value of pixel, according to the pixel value of any diagonal lines two ends endpoint location two pixels, it is determined that the 2nd is inserted into the pixel value of pixel; Described first is inserted into position that pixel is inserted into corresponding to the point midway not adding pixel value in each limit of described minimum rectangle, described 2nd is inserted into position that pixel is inserted into corresponding to the cornerwise point midway of described minimum rectangle, when determining the pixel value that the described 2nd is inserted into pixel, cornerwise direction selected in minimum rectangle described in each is consistent;
Inserting corresponding described first on every bar limit of minimum rectangle described in each and be inserted into pixel, inside of minimum rectangle described in each is inserted corresponding the described 2nd and is inserted into pixel, forms super-pixel photo.
Preferably, before the source photo that described acquisition is taken with described camera, also comprise:
Obtain the selection instruction of super-pixel picture photographing mode;
Respond the selection instruction of described super-pixel picture photographing mode, control described camera and take a source photo.
Preferably, the mode of described traversal minimum rectangle described in each, comprising:
Minimum rectangle described in each is traveled through according to preset rules;
Described preset rules comprises: from left to right, traversal order from top to bottom; Or from right to left, traversal order from top to bottom; Or from left to right, traversal order from top to bottom; Or from right to left, traversal order from top to bottom.
Preferably, described for minimum rectangle described in each, according to the pixel value of two ends, every bar limit endpoint location pixel, it is determined that every bar limit first is inserted into the pixel value of pixel, comprising:
For minimum rectangle described in each, calculate the rgb color pattern space distance between endpoint location two the pixel pixel values of two ends, every bar limit;
If rgb color pattern space distance Article 1 between two ends, limit endpoint location two pixel pixel values does not exceed predetermined threshold value, calculate the pixel value average of two ends, described Article 1 limit endpoint location two pixels, the pixel value average of two ends, described Article 1 limit endpoint location two pixels is defined as the pixel value that described first is inserted into pixel; Described Article 1 limit is any limit of minimum rectangle described in each;
If the rgb color pattern space distance between two ends, Article 2 limit endpoint location two pixel pixel values exceedes described predetermined threshold value, the pixel value of the first endpoint location pixel on described Article 2 limit is defined as the pixel value that described first is inserted into pixel; Described first end points be on described Article 2 limit in two end points any one, described Article 2 limit is any limit of minimum rectangle described in each; The position consistency of first end points described in each in corresponding described minimum rectangle.
Preferably, described for minimum rectangle described in each, according to the pixel value of any diagonal lines two ends endpoint location two pixels, it is determined that the 2nd is inserted into the pixel value of pixel, comprising:
For minimum rectangle described in each, calculate the rgb color pattern space distance between an any diagonal lines two ends endpoint location two pixel pixel values;
If rgb color pattern space distance Article 1 between diagonal lines two ends endpoint location two pixel pixel values does not exceed predetermined threshold value, calculate the pixel value average of described Article 1 diagonal lines two ends endpoint location two pixels, the pixel value average of described Article 1 diagonal lines two ends endpoint location two pixels is defined as the pixel value that the described 2nd is inserted into pixel; Described Article 1 diagonal lines is any diagonal lines of minimum rectangle described in each;
If the rgb color pattern space distance between Article 2 diagonal lines two ends endpoint location two pixel pixel values exceedes described predetermined threshold value, the pixel value of the first endpoint location pixel on described Article 2 diagonal lines is defined as the pixel value that the described 2nd is inserted into pixel; Described first end points be on described Article 2 diagonal lines in two end points any one, described Article 2 diagonal lines is any diagonal lines of minimum rectangle described in each; The position consistency of first end points described in each in corresponding described minimum rectangle.
A kind of super-pixel photo imaging device, is applied to electronics, and described electronics comprises camera, and described device comprises:
First acquisition module, for obtaining the source photo taken with described camera; Described source photo comprises M �� N number of pixel, forms the individual minimum rectangle being made up of four pixels of (M-1) �� (N-1), and in described four pixels, any two pixels are pixel adjacent in the photo of described source;
Spider module, for traveling through the pixel of minimum rectangle described in each in the way of traveling through minimum rectangle described in each, obtains the pixel value of minimum rectangle pixel described in each;
Calculate module, for for minimum rectangle described in each, according to the pixel value of two ends, every bar limit endpoint location two pixels, determine that every bar limit first is inserted into the pixel value of pixel, according to the pixel value of any diagonal lines two ends endpoint location two pixels, it is determined that the 2nd is inserted into the pixel value of pixel; Described first is inserted into position that pixel is inserted into corresponding to the point midway not adding pixel value in each limit of described minimum rectangle, described 2nd is inserted into position that pixel is inserted into corresponding to the cornerwise point midway of described minimum rectangle, when determining the pixel value that the described 2nd is inserted into pixel, cornerwise direction selected in minimum rectangle described in each is consistent;
Insert module, inserts corresponding described first on every bar limit of minimum rectangle described in each and is inserted into pixel, and inside of minimum rectangle described in each is inserted corresponding the described 2nd and is inserted into pixel, forms super-pixel picture.
Preferably, also comprise:
2nd acquisition module, for obtaining the selection instruction of super-pixel picture photographing mode;
Taking module, for responding the selection instruction of described super-pixel picture photographing mode, controls described camera and takes a source photo.
Preferably, described spider module comprises:
Traversal unit, in the way of traveling through minimum rectangle described in each by preset rules, travels through the pixel of minimum rectangle described in each, obtains the pixel value of minimum rectangle pixel described in each;
Described preset rules comprises: from left to right, traversal order from top to bottom; Or from right to left, traversal order from top to bottom; Or from left to right, traversal order from top to bottom; Or from right to left, traversal order from top to bottom.
Preferably, described calculating module comprises:
First calculating unit; Described first calculating unit is used for: for minimum rectangle described in each, calculate the rgb color pattern space distance between endpoint location two the pixel pixel values of two ends, every bar limit; If rgb color pattern space distance Article 1 between two ends, limit endpoint location two pixel pixel values does not exceed predetermined threshold value, calculate the pixel value average of two ends, described Article 1 limit endpoint location two pixels, the pixel value average of two ends, described Article 1 limit endpoint location two pixels is defined as the pixel value that described first is inserted into pixel; Described Article 1 limit is any limit of minimum rectangle described in each; If the rgb color pattern space distance between two ends, Article 2 limit endpoint location two pixel pixel values exceedes described predetermined threshold value, the pixel value of the first endpoint location pixel on described Article 2 limit is defined as the pixel value that described first is inserted into pixel; Described first end points be on described Article 2 limit in two end points any one, described Article 2 limit is any limit of minimum rectangle described in each; The position consistency of first end points described in each in corresponding described minimum rectangle.
Preferably, described calculating module comprises:
2nd calculating unit; Described 2nd calculating unit is used for: for minimum rectangle described in each, calculate the rgb color pattern space distance between an any diagonal lines two ends endpoint location two pixel pixel values; If rgb color pattern space distance Article 1 between diagonal lines two ends endpoint location two pixel pixel values does not exceed predetermined threshold value, calculate the pixel value average of described Article 1 diagonal lines two ends endpoint location two pixels, the pixel value average of described Article 1 diagonal lines two ends endpoint location two pixels is defined as the pixel value that the described 2nd is inserted into pixel; Described Article 1 diagonal lines is any diagonal lines of minimum rectangle described in each; If the rgb color pattern space distance between Article 2 diagonal lines two ends endpoint location two pixel pixel values exceedes described predetermined threshold value, the pixel value of the first endpoint location pixel on described Article 2 diagonal lines is defined as the pixel value that the described 2nd is inserted into pixel; Described first end points be on described Article 2 diagonal lines in two end points any one, described Article 2 diagonal lines is any diagonal lines of minimum rectangle described in each; The position consistency of first end points described in each in corresponding described minimum rectangle.
A kind of electronics, comprising:
Camera and treater;
The operation of described treater comprises: obtain the source photo taken with described camera; Described source photo comprises M �� N number of pixel, form the individual minimum rectangle being made up of four pixels of (M-1) �� (N-1), in described four pixels, any two pixels are pixel adjacent in the photo of described source, M and N is positive integer; In the way of traveling through minimum rectangle described in each, travel through the pixel forming minimum rectangle described in each, obtain the pixel value of minimum rectangle pixel described in each; For minimum rectangle described in each, according to the pixel value of two ends, every bar limit endpoint location two pixels, determine that every bar limit first is inserted into the pixel value of pixel, according to the pixel value of any diagonal lines two ends endpoint location two pixels, it is determined that the 2nd is inserted into the pixel value of pixel; Described first is inserted into position that pixel is inserted into corresponding to the point midway not adding pixel value in each limit of described minimum rectangle, described 2nd is inserted into position that pixel is inserted into corresponding to the cornerwise point midway of described minimum rectangle, when determining the pixel value that the described 2nd is inserted into pixel, cornerwise direction selected in minimum rectangle described in each is consistent; Inserting corresponding described first on every bar limit of minimum rectangle described in each and be inserted into pixel, inside of minimum rectangle described in each is inserted corresponding the described 2nd and is inserted into pixel, forms super-pixel photo.
Via above-mentioned technical scheme it will be seen that compared with prior art, the present invention provides a kind of super-pixel photo formation method, device and a kind of electronics. technical scheme provided by the invention, only need the source photo that acquisition camera is taken, this source photo comprises M �� N number of pixel, form the individual minimum rectangle being made up of four pixels of (M-1) �� (N-1), then, travel through the pixel value that this source photo obtains each pixel, for minimum rectangle described in each, point midway insertion first on the limit of minimum rectangle described in each is inserted into pixel, diagonal lines point midway insertion the 2nd of minimum rectangle described in each is inserted into pixel, finally, through the process of technical solution of the present invention, more than the pixel corresponding with camera physical parameter of source photo one times of the photo formed, thus form super-pixel photo, the pixel value that every bar limit first is inserted into pixel is determined by the pixel value of these two ends, limit endpoint location two pixels, the pixel value that the 2nd of minimum rectangle described in each is inserted into pixel is determined by the pixel value of any one article of diagonal lines two ends endpoint location two pixel of this minimum rectangle. technical scheme provided by the invention, because only needing to take a source photo with camera, relative to the scheme needing shooting multiple pictures of prior art, can effectively save time, and technical solution of the present invention add in the photo of source the pixel time used unlike prior art in that multiple source pictures carry out synthesizing the time used is many. to sum up, it is possible to determine, utilizing technical scheme provided by the invention to obtain super-pixel photo, than existing technical scheme, the used time to be lacked a lot, namely can improve the speed of shooting super-pixel picture significantly such that it is able to for user brings better experience.
Accompanying drawing explanation
In order to be illustrated more clearly in the embodiment of the present invention or technical scheme of the prior art, it is briefly described to the accompanying drawing used required in embodiment or description of the prior art below, apparently, accompanying drawing in the following describes is only embodiments of the invention, for those of ordinary skill in the art, under the prerequisite not paying creative work, it is also possible to obtain other accompanying drawing according to the accompanying drawing provided.
The schema of a kind of super-pixel photo formation method that Fig. 1 provides for the embodiment of the present invention;
The structure iron of each pixel in the provenance photo that Fig. 2 provides for the embodiment of the present invention;
The structure iron of a kind of super-pixel photo imaging device that Fig. 3 provides for the embodiment of the present invention.
Embodiment
Below in conjunction with the accompanying drawing in the embodiment of the present invention, the technical scheme in the embodiment of the present invention is clearly and completely described, it is clear that described embodiment is only the present invention's part embodiment, instead of whole embodiments. Based on the embodiment in the present invention, those of ordinary skill in the art, not making other embodiments all obtained under creative work prerequisite, belong to the scope of protection of the invention.
For enabling above-mentioned purpose, the feature and advantage of the present invention more become apparent, below in conjunction with the drawings and specific embodiments, the present invention is further detailed explanation.
Embodiment
Refer to Fig. 1, the schema of a kind of super-pixel photo formation method that Fig. 1 provides for the embodiment of the present invention. The super-pixel photo formation method that the embodiment of the present invention one provides, is applied to electronics, and described electronics comprises camera, and as shown in Figure 1, the method comprises:
Step S101, obtains the source photo taken with described camera;
Concrete, described source photo comprises M �� N number of pixel, forming the individual minimum rectangle being made up of four pixels of (M-1) �� (N-1), in described four pixels, any two pixels are pixel adjacent in the photo of described source, M and N is positive integer.
Optionally, M represents line number, and N represents row number, and namely described source photo comprises the capable N row pixel of M. Refer to Fig. 2, the structure iron of each pixel in the provenance photo that Fig. 2 provides for the embodiment of the present invention. Fig. 2 is intended to some the technology features in aid illustration the present invention program; in order to convenient, scheme is set forth; in figure, each pixel adopts spacer structure; but not continuous structure in actual techniques (namely adjacent pixel is close to; mid point does not have interval); in addition; in order to unnecessary redundancy accompanying drawing; Fig. 2 provide only the source images of relatively small pixel; only it is used for doing principle to set forth, it is necessary to explanation, technical scheme provided by the invention; the source images of big pixel is applicable equally, do not depart from protection scope of the present invention.
As shown in Figure 2, in order to optionally, the value of M is the value of 4, N is 6. In Fig. 2 label be 201 part represent described minimum rectangle, it is understandable that, the cross part of every adjacent rows and often adjacent two row is divided into four adjacent pixels, these four adjacent pixels form described minimum rectangle, what was certain was that, the individual described minimum rectangle being made up of four pixels of (M-1) �� (N-1) can be formed altogether.
Step S102, travels through the pixel forming minimum rectangle described in each in the way of traveling through minimum rectangle described in each, obtains the pixel value of minimum rectangle pixel described in each;
Concrete, the pixel of minimum rectangle described in each has four, is distributed in four endpoint locations of described minimum rectangle respectively.
Optionally, travel through minimum rectangle described in each according to preset rules, namely travel through minimum rectangle mode described in each by preset rules and travel through the pixel of minimum rectangle described in each, obtain the pixel value of minimum rectangle four endpoint location pixels described in each;
Described preset rules, optionally, comprising: from left to right, traversal order from top to bottom; Or from right to left, traversal order from top to bottom; Or from left to right, traversal order from top to bottom; Or from right to left, traversal order from top to bottom.
Step S103, for minimum rectangle described in each, according to the pixel value of two ends, every bar limit endpoint location two pixels, determine that every bar limit first is inserted into the pixel value of pixel, according to the pixel value of any diagonal lines two ends endpoint location two pixels, it is determined that the 2nd is inserted into the pixel value of pixel;
Concrete, described first is inserted into position that pixel is inserted into corresponding to the point midway not adding pixel value in each limit of described minimum rectangle, described 2nd is inserted into position that pixel is inserted into corresponding to the cornerwise point midway of described minimum rectangle, when determining the pixel value that the described 2nd is inserted into pixel, cornerwise direction selected in minimum rectangle described in each is consistent.
As shown in Figure 2, four end points of described rectangle 201 are respectively A, B, C and D, and E point is positioned at the point midway on AB limit, and F point is positioned at the point midway of diagonal lines AC. Such as, set forth for AB limit, according to the pixel value of A point position pixel and the pixel value of B point position pixel, it is determined that AB limit first is inserted into the pixel value of pixel (namely pixel) corresponding to E point position; Set forth for diagonal lines AC, according to the pixel value of A point position pixel and the pixel value of C point position pixel, it is determined that diagonal lines AC the upper 2nd is inserted into the pixel value of pixel (namely pixel) corresponding to F point position.
Concrete, described for minimum rectangle described in each, according to the pixel value of two ends, every bar limit endpoint location pixel, it is determined that every bar limit first is inserted into the pixel value of pixel, optionally, comprising:
For minimum rectangle described in each, calculate the rgb color pattern space distance between endpoint location two the pixel pixel values of two ends, every bar limit; Such as, as shown in Figure 2, still set forth for AB limit, then need the rgb color pattern space distance calculated between the pixel value of A point position pixel and the pixel value of B point position pixel;
If rgb color pattern space distance Article 1 between two ends, limit endpoint location two pixel pixel values does not exceed predetermined threshold value, calculate the pixel value average of two ends, described Article 1 limit endpoint location two pixels, the pixel value average of two ends, described Article 1 limit endpoint location two pixels is defined as the pixel value that described first is inserted into pixel; Described Article 1 limit is any limit of minimum rectangle described in each;
If the rgb color pattern space distance between two ends, Article 2 limit endpoint location two pixel pixel values exceedes described predetermined threshold value, the pixel value of the first endpoint location pixel on described Article 2 limit is defined as the pixel value that described first is inserted into pixel; Described first end points be on described Article 2 limit in two end points any one, described Article 2 limit is any limit of minimum rectangle described in each; The position consistency of first end points described in each in corresponding described minimum rectangle.
Concrete, described for minimum rectangle described in each, according to the pixel value of any diagonal lines two ends endpoint location two pixels, it is determined that the 2nd is inserted into the pixel value of pixel, optionally, comprising:
For minimum rectangle described in each, calculate the rgb color pattern space distance between an any diagonal lines two ends endpoint location two pixel pixel values; Such as, as shown in Figure 2, still set forth for diagonal lines AC, then need the rgb color pattern space distance calculated between the pixel value of A point position pixel and the pixel value of C point position pixel;
If rgb color pattern space distance Article 1 between diagonal lines two ends endpoint location two pixel pixel values does not exceed predetermined threshold value, calculate the pixel value average of described Article 1 diagonal lines two ends endpoint location two pixels, the pixel value average of described Article 1 diagonal lines two ends endpoint location two pixels is defined as the pixel value that the described 2nd is inserted into pixel; Described Article 1 diagonal lines is any diagonal lines of minimum rectangle described in each;
If the rgb color pattern space distance between Article 2 diagonal lines two ends endpoint location two pixel pixel values exceedes described predetermined threshold value, the pixel value of the first endpoint location pixel on described Article 2 diagonal lines is defined as the pixel value that the described 2nd is inserted into pixel; Described first end points be on described Article 2 diagonal lines in two end points any one, described Article 2 diagonal lines is any diagonal lines of minimum rectangle described in each; The position consistency of first end points described in each in corresponding described minimum rectangle.
Step S104, every bar limit of minimum rectangle described in each is inserted corresponding described first and is inserted into pixel, and inside of minimum rectangle described in each is inserted corresponding the described 2nd and is inserted into pixel, forms super-pixel photo;
Concrete, on every bar limit of minimum rectangle described in each, described first corresponding with this limit of insertion is inserted into pixel, and the position of insertion is the point midway on this limit; Described two corresponding with this minimum rectangle of the inside insertion of minimum rectangle described in each is inserted into pixel, and the position of insertion is the cornerwise point midway of this minimum rectangle
The super-pixel photo formation method that the embodiment of the present invention provides, it is applied to electronics, described electronics comprises camera, the method only needs the source photo that acquisition camera takes, this source photo comprises M �� N number of pixel, form the individual minimum rectangle being made up of four pixels of (M-1) �� (N-1), then, travel through the pixel value that this source photo obtains each pixel, for minimum rectangle described in each, point midway insertion first on the limit of minimum rectangle described in each is inserted into pixel, diagonal lines point midway insertion the 2nd of minimum rectangle described in each is inserted into pixel, finally, through the process of technical solution of the present invention, more than the pixel corresponding with camera physical parameter of source photo one times of the photo formed, thus form super-pixel photo, the pixel value that every bar limit first is inserted into pixel is determined by the pixel value of these two ends, limit endpoint location two pixels, the pixel value that the 2nd of minimum rectangle described in each is inserted into pixel is determined by the pixel value of any one article of diagonal lines two ends endpoint location two pixel of this minimum rectangle. technical scheme provided by the invention, because only needing to take a source photo with camera, relative to the scheme needing shooting multiple pictures of prior art, can effectively save time, and technical solution of the present invention add in the photo of source the pixel time used unlike prior art in that multiple source pictures carry out synthesizing the time used is many. to sum up, it is possible to determine, utilizing technical scheme provided by the invention to obtain super-pixel photo, than existing technical scheme, the used time to be lacked a lot, namely can improve the speed of shooting super-pixel picture significantly such that it is able to for user brings better experience.
Further, technical scheme provided by the invention, before described step S101, also comprises:
Obtain the selection instruction of super-pixel picture photographing mode;
Respond the selection instruction of described super-pixel picture photographing mode, control described camera and take a source photo.
In order to set forth technical scheme provided by the invention more comprehensively, corresponding to the super-pixel photo formation method that the embodiment of the present invention provides, the present invention is open a kind of super-pixel photo imaging device further.
Refer to Fig. 3, the structure iron of a kind of super-pixel photo imaging device that Fig. 3 provides for the embodiment of the present invention. The super-pixel photo imaging device that the embodiment of the present invention provides, is applied to electronics, and described electronics comprises camera, and as shown in Figure 3, this device comprises:
First acquisition module 301, for obtaining the source photo taken with described camera; Described source photo comprises M �� N number of pixel, forms the individual minimum rectangle being made up of four pixels of (M-1) �� (N-1), and in described four pixels, any two pixels are pixel adjacent in the photo of described source;
Spider module 302, for traveling through the pixel of minimum rectangle described in each in the way of traveling through minimum rectangle described in each, obtains the pixel value of minimum rectangle pixel described in each;
Concrete, described spider module 302 comprises:
Traversal unit, in the way of traveling through minimum rectangle described in each by preset rules, travels through the pixel of minimum rectangle described in each, obtains the pixel value of minimum rectangle pixel described in each;
Optionally, described preset rules comprises: from left to right, traversal order from top to bottom; Or from right to left, traversal order from top to bottom; Or from left to right, traversal order from top to bottom; Or from right to left, traversal order from top to bottom.
Calculate module 303, for for minimum rectangle described in each, according to the pixel value of two ends, every bar limit endpoint location two pixels, determine that every bar limit first is inserted into the pixel value of pixel, according to the pixel value of any diagonal lines two ends endpoint location two pixels, it is determined that the 2nd is inserted into the pixel value of pixel; Described first is inserted into position that pixel is inserted into corresponding to the point midway not adding pixel value in each limit of described minimum rectangle, described 2nd is inserted into position that pixel is inserted into corresponding to the cornerwise point midway of described minimum rectangle, when determining the pixel value that the described 2nd is inserted into pixel, cornerwise direction selected in minimum rectangle described in each is consistent;
Optionally, described calculating module 303 comprises:
First calculating unit; Described first calculating unit is used for: for minimum rectangle described in each, calculate the rgb color pattern space distance between endpoint location two the pixel pixel values of two ends, every bar limit; If rgb color pattern space distance Article 1 between two ends, limit endpoint location two pixel pixel values does not exceed predetermined threshold value, calculate the pixel value average of two ends, described Article 1 limit endpoint location two pixels, the pixel value average of two ends, described Article 1 limit endpoint location two pixels is defined as the pixel value that described first is inserted into pixel; Described Article 1 limit is any limit of minimum rectangle described in each; If the rgb color pattern space distance between two ends, Article 2 limit endpoint location two pixel pixel values exceedes described predetermined threshold value, the pixel value of the first endpoint location pixel on described Article 2 limit is defined as the pixel value that described first is inserted into pixel; Described first end points be on described Article 2 limit in two end points any one, described Article 2 limit is any limit of minimum rectangle described in each; The position consistency of first end points described in each in corresponding described minimum rectangle.
Optionally, described calculating module 303 also comprises:
2nd calculating unit; Described 2nd calculating unit is used for: for minimum rectangle described in each, calculate the rgb color pattern space distance between an any diagonal lines two ends endpoint location two pixel pixel values; If rgb color pattern space distance Article 1 between diagonal lines two ends endpoint location two pixel pixel values does not exceed predetermined threshold value, calculate the pixel value average of described Article 1 diagonal lines two ends endpoint location two pixels, the pixel value average of described Article 1 diagonal lines two ends endpoint location two pixels is defined as the pixel value that the described 2nd is inserted into pixel; Described Article 1 diagonal lines is any diagonal lines of minimum rectangle described in each; If the rgb color pattern space distance between Article 2 diagonal lines two ends endpoint location two pixel pixel values exceedes described predetermined threshold value, the pixel value of the first endpoint location pixel on described Article 2 diagonal lines is defined as the pixel value that the described 2nd is inserted into pixel; Described first end points be on described Article 2 diagonal lines in two end points any one, described Article 2 diagonal lines is any diagonal lines of minimum rectangle described in each; The position consistency of first end points described in each in corresponding described minimum rectangle.
Insert module 304, inserts corresponding described first on every bar limit of minimum rectangle described in each and is inserted into pixel, and inside of minimum rectangle described in each is inserted corresponding the described 2nd and is inserted into pixel, forms super-pixel picture.
The super-pixel photo imaging device that the embodiment of the present invention provides, only need to take a source photo with camera, then, in the photo of source, pixel is added according to such scheme, just can form super-pixel photo, photo size is made to become big relative to source photo, color transition is also softer, image quality seems finer and smoother, simultaneously, technical scheme provided by the invention, can be formed on the basis of super-pixel photo satisfied, because only needing to take a source photo with camera, relative to the scheme needing shooting multiple pictures of prior art, can effectively save time, and technical solution of the present invention add in the photo of source the pixel time used unlike prior art in that multiple source pictures carry out synthesizing the time used is many. to sum up, it is possible to determine, utilizing technical scheme provided by the invention to obtain super-pixel photo, than existing technical scheme, the used time to be lacked a lot, namely can promote the speed of shooting super-pixel picture significantly, it is possible to for user brings better experience.
Further, the super-pixel photo imaging device that the embodiment of the present invention provides, also comprises:
2nd acquisition module, for obtaining the selection instruction of super-pixel picture photographing mode;
Taking module, for responding the selection instruction of described super-pixel picture photographing mode, controls described camera and takes a source photo.
Further, in order to more comprehensively protect technical scheme provided by the invention, the embodiment of the present invention is open a kind of electronics also.
The electronics that the embodiment of the present invention provides, comprising:
Camera and treater;
The operation of described treater comprises: obtain the source photo taken with described camera; Described source photo comprises M �� N number of pixel, form the individual minimum rectangle being made up of four pixels of (M-1) �� (N-1), in described four pixels, any two pixels are pixel adjacent in the photo of described source, M and N is positive integer; In the way of traveling through minimum rectangle described in each, travel through the pixel forming minimum rectangle described in each, obtain the pixel value of minimum rectangle pixel described in each; For minimum rectangle described in each, according to the pixel value of two ends, every bar limit endpoint location two pixels, determine that every bar limit first is inserted into the pixel value of pixel, according to the pixel value of any diagonal lines two ends endpoint location two pixels, it is determined that the 2nd is inserted into the pixel value of pixel; Described first is inserted into position that pixel is inserted into corresponding to the point midway not adding pixel value in each limit of described minimum rectangle, described 2nd is inserted into position that pixel is inserted into corresponding to the cornerwise point midway of described minimum rectangle, when determining the pixel value that the described 2nd is inserted into pixel, cornerwise direction selected in minimum rectangle described in each is consistent; Inserting corresponding described first on every bar limit of minimum rectangle described in each and be inserted into pixel, inside of minimum rectangle described in each is inserted corresponding the described 2nd and is inserted into pixel, forms super-pixel photo.
Finally, also it should be noted that, herein, the such as relational terms of first and second grades and so on is only used for separating an entity or operation with another entity or operational zone, and not necessarily requires or imply to there is any this kind of actual relation or sequentially between these entities or operation. And, term " comprises ", " comprising " or its any other variant are intended to contain comprising of nonexcludability, so that comprise the process of a series of key element, method, article or equipment not only comprise those key elements, but also comprise other key elements clearly do not listed, or also comprise the key element intrinsic for this kind of process, method, article or equipment. When not more restrictions, the key element limited by statement " comprising ... ", and be not precluded within process, method, article or the equipment comprising described key element and also there is other identical element.
In this specification sheets, each embodiment adopts the mode gone forward one by one to describe, and what each embodiment emphasis illustrated is the difference with other embodiments, between each embodiment identical similar portion mutually see. For device disclosed in embodiment, owing to it corresponds to the method disclosed in Example, so what describe is fairly simple, relevant part illustrates see method part.
The method described in conjunction with embodiment disclosed herein or the step of algorithm can direct hardware, treater execution software module, or the combination of the two implements. Software module can be placed in the storage media of other form any known in random access memory (RAM), internal memory, read-only storage (ROM), electrically programmable ROM, electrically erasable ROM, register, hard disk, moveable magnetic disc, CD-ROM or technical field.
To the above-mentioned explanation of the disclosed embodiments, professional and technical personnel in the field are enable to realize or use the present invention. To be apparent for those skilled in the art to the multiple amendment of these embodiments, General Principle as defined herein can without departing from the spirit or scope of the present invention, realize in other embodiments. Therefore, the present invention can not be limited in these embodiments shown in this article, but be met the widest scope consistent with principle disclosed herein and features of novelty.

Claims (11)

1. a super-pixel photo formation method, is applied to electronics, and described electronics comprises camera, it is characterised in that, described method comprises:
Obtain the source photo taken with described camera; Described source photo comprises M �� N number of pixel, form the individual minimum rectangle being made up of four pixels of (M-1) �� (N-1), in described four pixels, any two pixels are pixel adjacent in the photo of described source, M and N is positive integer;
In the way of traveling through minimum rectangle described in each, travel through the pixel forming minimum rectangle described in each, obtain the pixel value of minimum rectangle pixel described in each;
For minimum rectangle described in each, according to the pixel value of two ends, every bar limit endpoint location two pixels, determine that every bar limit first is inserted into the pixel value of pixel, according to the pixel value of any diagonal lines two ends endpoint location two pixels, it is determined that the 2nd is inserted into the pixel value of pixel; Described first is inserted into position that pixel is inserted into corresponding to the point midway not adding pixel value in each limit of described minimum rectangle, described 2nd is inserted into position that pixel is inserted into corresponding to the cornerwise point midway of described minimum rectangle, when determining the pixel value that the described 2nd is inserted into pixel, cornerwise direction selected in minimum rectangle described in each is consistent;
Inserting corresponding described first on every bar limit of minimum rectangle described in each and be inserted into pixel, inside of minimum rectangle described in each is inserted corresponding the described 2nd and is inserted into pixel, forms super-pixel photo.
2. method according to claim 1, it is characterised in that, before the source photo that described acquisition is taken with described camera, also comprise:
Obtain the selection instruction of super-pixel picture photographing mode;
Respond the selection instruction of described super-pixel picture photographing mode, control described camera and take a source photo.
3. the method stated according to claim 1, it is characterised in that, the mode of described traversal minimum rectangle described in each, comprising:
Minimum rectangle described in each is traveled through according to preset rules;
Described preset rules comprises: from left to right, traversal order from top to bottom; Or from right to left, traversal order from top to bottom; Or from left to right, traversal order from top to bottom; Or from right to left, traversal order from top to bottom.
4. the method stated according to claim 1, it is characterised in that, described for minimum rectangle described in each, according to the pixel value of two ends, every bar limit endpoint location pixel, it is determined that every bar limit first is inserted into the pixel value of pixel, comprising:
For minimum rectangle described in each, calculate the rgb color pattern space distance between endpoint location two the pixel pixel values of two ends, every bar limit;
If rgb color pattern space distance Article 1 between two ends, limit endpoint location two pixel pixel values does not exceed predetermined threshold value, calculate the pixel value average of two ends, described Article 1 limit endpoint location two pixels, the pixel value average of two ends, described Article 1 limit endpoint location two pixels is defined as the pixel value that described first is inserted into pixel; Described Article 1 limit is any limit of minimum rectangle described in each;
If the rgb color pattern space distance between two ends, Article 2 limit endpoint location two pixel pixel values exceedes described predetermined threshold value, the pixel value of the first endpoint location pixel on described Article 2 limit is defined as the pixel value that described first is inserted into pixel; Described first end points be on described Article 2 limit in two end points any one, described Article 2 limit is any limit of minimum rectangle described in each; The position consistency of first end points described in each in corresponding described minimum rectangle.
5. the method stated according to claim 1, it is characterised in that, described for minimum rectangle described in each, according to the pixel value of any diagonal lines two ends endpoint location two pixels, it is determined that the 2nd is inserted into the pixel value of pixel, comprising:
For minimum rectangle described in each, calculate the rgb color pattern space distance between an any diagonal lines two ends endpoint location two pixel pixel values;
If rgb color pattern space distance Article 1 between diagonal lines two ends endpoint location two pixel pixel values does not exceed predetermined threshold value, calculate the pixel value average of described Article 1 diagonal lines two ends endpoint location two pixels, the pixel value average of described Article 1 diagonal lines two ends endpoint location two pixels is defined as the pixel value that the described 2nd is inserted into pixel; Described Article 1 diagonal lines is any diagonal lines of minimum rectangle described in each;
If the rgb color pattern space distance between Article 2 diagonal lines two ends endpoint location two pixel pixel values exceedes described predetermined threshold value, the pixel value of the first endpoint location pixel on described Article 2 diagonal lines is defined as the pixel value that the described 2nd is inserted into pixel; Described first end points be on described Article 2 diagonal lines in two end points any one, described Article 2 diagonal lines is any diagonal lines of minimum rectangle described in each; The position consistency of first end points described in each in corresponding described minimum rectangle.
6. a super-pixel photo imaging device, is applied to electronics, and described electronics comprises camera, it is characterised in that, described device comprises:
First acquisition module, for obtaining the source photo taken with described camera; Described source photo comprises M �� N number of pixel, forms the individual minimum rectangle being made up of four pixels of (M-1) �� (N-1), and in described four pixels, any two pixels are pixel adjacent in the photo of described source;
Spider module, for traveling through the pixel of minimum rectangle described in each in the way of traveling through minimum rectangle described in each, obtains the pixel value of minimum rectangle pixel described in each;
Calculate module, for for minimum rectangle described in each, according to the pixel value of two ends, every bar limit endpoint location two pixels, determine that every bar limit first is inserted into the pixel value of pixel, according to the pixel value of any diagonal lines two ends endpoint location two pixels, it is determined that the 2nd is inserted into the pixel value of pixel; Described first is inserted into position that pixel is inserted into corresponding to the point midway not adding pixel value in each limit of described minimum rectangle, described 2nd is inserted into position that pixel is inserted into corresponding to the cornerwise point midway of described minimum rectangle, when determining the pixel value that the described 2nd is inserted into pixel, cornerwise direction selected in minimum rectangle described in each is consistent;
Insert module, inserts corresponding described first on every bar limit of minimum rectangle described in each and is inserted into pixel, and inside of minimum rectangle described in each is inserted corresponding the described 2nd and is inserted into pixel, forms super-pixel picture.
7. device according to claim 6, it is characterised in that, also comprise:
2nd acquisition module, for obtaining the selection instruction of super-pixel picture photographing mode;
Taking module, for responding the selection instruction of described super-pixel picture photographing mode, controls described camera and takes a source photo.
8. device according to claim 6, it is characterised in that, described spider module comprises:
Traversal unit, in the way of traveling through minimum rectangle described in each by preset rules, travels through the pixel of minimum rectangle described in each, obtains the pixel value of minimum rectangle pixel described in each;
Described preset rules comprises: from left to right, traversal order from top to bottom; Or from right to left, traversal order from top to bottom; Or from left to right, traversal order from top to bottom; Or from right to left, traversal order from top to bottom.
9. device according to claim 6, it is characterised in that, described calculating module comprises:
First calculating unit; Described first calculating unit is used for: for minimum rectangle described in each, calculate the rgb color pattern space distance between endpoint location two the pixel pixel values of two ends, every bar limit; If rgb color pattern space distance Article 1 between two ends, limit endpoint location two pixel pixel values does not exceed predetermined threshold value, calculate the pixel value average of two ends, described Article 1 limit endpoint location two pixels, the pixel value average of two ends, described Article 1 limit endpoint location two pixels is defined as the pixel value that described first is inserted into pixel; Described Article 1 limit is any limit of minimum rectangle described in each; If the rgb color pattern space distance between two ends, Article 2 limit endpoint location two pixel pixel values exceedes described predetermined threshold value, the pixel value of the first endpoint location pixel on described Article 2 limit is defined as the pixel value that described first is inserted into pixel; Described first end points be on described Article 2 limit in two end points any one, described Article 2 limit is any limit of minimum rectangle described in each; The position consistency of first end points described in each in corresponding described minimum rectangle.
10. device according to claim 6, it is characterised in that, described calculating module comprises:
2nd calculating unit; Described 2nd calculating unit is used for: for minimum rectangle described in each, calculate the rgb color pattern space distance between an any diagonal lines two ends endpoint location two pixel pixel values; If rgb color pattern space distance Article 1 between diagonal lines two ends endpoint location two pixel pixel values does not exceed predetermined threshold value, calculate the pixel value average of described Article 1 diagonal lines two ends endpoint location two pixels, the pixel value average of described Article 1 diagonal lines two ends endpoint location two pixels is defined as the pixel value that the described 2nd is inserted into pixel; Described Article 1 diagonal lines is any diagonal lines of minimum rectangle described in each; If the rgb color pattern space distance between Article 2 diagonal lines two ends endpoint location two pixel pixel values exceedes described predetermined threshold value, the pixel value of the first endpoint location pixel on described Article 2 diagonal lines is defined as the pixel value that the described 2nd is inserted into pixel; Described first end points be on described Article 2 diagonal lines in two end points any one, described Article 2 diagonal lines is any diagonal lines of minimum rectangle described in each; The position consistency of first end points described in each in corresponding described minimum rectangle.
11. 1 kinds of electronicss, it is characterised in that, comprising:
Camera and treater;
The operation of described treater comprises: obtain the source photo taken with described camera; Described source photo comprises M �� N number of pixel, form the individual minimum rectangle being made up of four pixels of (M-1) �� (N-1), in described four pixels, any two pixels are pixel adjacent in the photo of described source, M and N is positive integer; In the way of traveling through minimum rectangle described in each, travel through the pixel forming minimum rectangle described in each, obtain the pixel value of minimum rectangle pixel described in each; For minimum rectangle described in each, according to the pixel value of two ends, every bar limit endpoint location two pixels, determine that every bar limit first is inserted into the pixel value of pixel, according to the pixel value of any diagonal lines two ends endpoint location two pixels, it is determined that the 2nd is inserted into the pixel value of pixel; Described first is inserted into position that pixel is inserted into corresponding to the point midway not adding pixel value in each limit of described minimum rectangle, described 2nd is inserted into position that pixel is inserted into corresponding to the cornerwise point midway of described minimum rectangle, when determining the pixel value that the described 2nd is inserted into pixel, cornerwise direction selected in minimum rectangle described in each is consistent; Inserting corresponding described first on every bar limit of minimum rectangle described in each and be inserted into pixel, inside of minimum rectangle described in each is inserted corresponding the described 2nd and is inserted into pixel, forms super-pixel photo.
CN201510526293.1A 2015-08-25 2015-08-25 Superpixel picture imaging method and device and electronic device Pending CN105657241A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201510526293.1A CN105657241A (en) 2015-08-25 2015-08-25 Superpixel picture imaging method and device and electronic device

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201510526293.1A CN105657241A (en) 2015-08-25 2015-08-25 Superpixel picture imaging method and device and electronic device

Publications (1)

Publication Number Publication Date
CN105657241A true CN105657241A (en) 2016-06-08

Family

ID=56481993

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201510526293.1A Pending CN105657241A (en) 2015-08-25 2015-08-25 Superpixel picture imaging method and device and electronic device

Country Status (1)

Country Link
CN (1) CN105657241A (en)

Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP2010041336A (en) * 2008-08-04 2010-02-18 Toshiba Corp Image processing unit and image processing method
CN102164246A (en) * 2011-03-08 2011-08-24 青岛海信移动通信技术股份有限公司 Realization method and device for generating photo meeting set solution by mobile terminal
CN102609900A (en) * 2012-01-16 2012-07-25 北京环星基业数码科技发展有限公司 Image interpolation algorithm based on region consistency
CN103686029A (en) * 2013-11-29 2014-03-26 浙江大学 Video pixel opposite-angle interpolation method for large-screen and multi-projection system
CN103810675A (en) * 2013-09-09 2014-05-21 深圳市华星光电技术有限公司 Image super-resolution reconstruction system and method

Patent Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP2010041336A (en) * 2008-08-04 2010-02-18 Toshiba Corp Image processing unit and image processing method
CN102164246A (en) * 2011-03-08 2011-08-24 青岛海信移动通信技术股份有限公司 Realization method and device for generating photo meeting set solution by mobile terminal
CN102609900A (en) * 2012-01-16 2012-07-25 北京环星基业数码科技发展有限公司 Image interpolation algorithm based on region consistency
CN103810675A (en) * 2013-09-09 2014-05-21 深圳市华星光电技术有限公司 Image super-resolution reconstruction system and method
CN103686029A (en) * 2013-11-29 2014-03-26 浙江大学 Video pixel opposite-angle interpolation method for large-screen and multi-projection system

Similar Documents

Publication Publication Date Title
US9153032B2 (en) Conversion method and apparatus with depth map generation
EP2774124B1 (en) Depth-map generation for an input image using an example approximate depth-map associated with an example similar image
US9299152B2 (en) Systems and methods for image depth map generation
US9137512B2 (en) Method and apparatus for estimating depth, and method and apparatus for converting 2D video to 3D video
EP2547111B1 (en) Method and apparatus for processing multi-view image using hole rendering
TWI595771B (en) Optimization method of image depth information and image processing apparatus
US8798361B2 (en) Mapping colors of an image
CN101610423B (en) Method and device for rendering image
CN107393459B (en) Image display method and device
US20130182945A1 (en) Image processing method and apparatus for generating disparity value
CN107871321B (en) Image segmentation method and device
EP1815441B1 (en) Rendering images based on image segmentation
CN103440664A (en) Method, system and computing device for generating high-resolution depth map
CN102436671A (en) Virtual viewpoint drawing method based on depth value non-linear transformation
CN102111637A (en) Stereoscopic video depth map generation method and device
CN105657241A (en) Superpixel picture imaging method and device and electronic device
JP2014072809A (en) Image generation apparatus, image generation method, and program for the image generation apparatus
Farid et al. Edges shape enforcement for visual enhancement of depth image based rendering
US20120154388A1 (en) Stereo image processing method, stereo image processing device and display device
US9008413B2 (en) Processing method for a pair of stereo images
CN108377379B (en) Image depth information optimization method and image processing device
Liu et al. Texture-adaptive hole-filling algorithm in raster-order for three-dimensional video applications
KR101993961B1 (en) Hole Filling Method for Arbitrary View Image
Toyoura et al. Silhouette extraction with random pattern backgrounds for the volume intersection method
CN111145108A (en) Image processing method, device, equipment and storage medium

Legal Events

Date Code Title Description
C06 Publication
PB01 Publication
C10 Entry into substantive examination
SE01 Entry into force of request for substantive examination
RJ01 Rejection of invention patent application after publication
RJ01 Rejection of invention patent application after publication

Application publication date: 20160608