CN102339469B - Image processing method and device - Google Patents

Image processing method and device Download PDF

Info

Publication number
CN102339469B
CN102339469B CN201010235716.1A CN201010235716A CN102339469B CN 102339469 B CN102339469 B CN 102339469B CN 201010235716 A CN201010235716 A CN 201010235716A CN 102339469 B CN102339469 B CN 102339469B
Authority
CN
China
Prior art keywords
picture
original image
amendment
image
coordinate
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.)
Active
Application number
CN201010235716.1A
Other languages
Chinese (zh)
Other versions
CN102339469A (en
Inventor
黄飞跃
王建宇
吴永坚
杨洋
刘元芳
李慧
罗匡
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Tencent Technology Shenzhen Co Ltd
Original Assignee
Tencent Technology 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 Tencent Technology Shenzhen Co Ltd filed Critical Tencent Technology Shenzhen Co Ltd
Priority to CN201010235716.1A priority Critical patent/CN102339469B/en
Publication of CN102339469A publication Critical patent/CN102339469A/en
Application granted granted Critical
Publication of CN102339469B publication Critical patent/CN102339469B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Landscapes

  • Image Processing (AREA)

Abstract

The present invention proposes a kind of image processing method and device, belong to field of computer technology.The embodiment of the present invention is by setting up the corresponding relation of the rear pixel between picture and original image of amendment; When selecting an image range to amplify in user wherein a pictures, determine required enlarged image scope in another picture by this corresponding relation, to make the image after the amplification of described original image and the rear picture of amendment consistent.When the embodiment of the present invention allows user pull arbitrarily on picture to select required enlarged image scope, can also ensure to amplify the image range of picture after the original image of rear display and amendment consistent.

Description

Image processing method and device
Technical field
The present invention relates to field of computer technology, particularly a kind of image processing method and device.
Background technology
Can be processed image by various image processing software in prior art, such as " QQ image " software.Existing image processing software all has cuts out function, side by side comparing function, enlarging function.Such as: as shown in Figure 1, left side is original image, and right side is picture after the amendment after cutting out.Cut out the part referring to and select in original image, and other parts are cut out.As shown in Figure 1, the part in the original image in left side is cut out out, picture after formation amendment as shown at right.Comparing function arranged side by side refers to as shown in Figure 1, is compared side by side by rear to original image and amendment picture, modifies to facilitate.Enlarging function refers to that user drags a part of picture shooted a retrievable arrow or replace in his way selection picture by mouse in picture surface, and this part is amplified.
Be all with pixel to mark picture in prior art, be all using first of the picture upper left corner pixel as starting pixels point in prior art, the horizontal ordinate of other pixels and ordinate are the pixel count apart from this starting pixels point.
Realizing in process of the present invention, inventor finds that prior art at least exists following problem:
User drags a part of image range of shooting a retrievable arrow or replacing in his way selection picture by mouse in picture surface, then determine the picture of this selection with the four angular coordinate of selected image range.For picture when comparing side by side after the original image of Fig. 1 and amendment, its after amplifying as shown in Figure 2.The schematic diagram of conventional images process software when showing side by side in Fig. 2; The enlarged drawing that Fig. 2 lower-left is original image, bottom right is picture after amendment, upper left is original image, upper right are the enlarged drawing of picture after amendment.Existing image processing software, when original image compares with picture after amendment and amplifies by user side by side, can see picture as shown in Figure 2.User have selected an image range, the coordinate selection image range that image processing software is identical in the original image of lower-left from picture after the amendment of bottom right; The image range of picture after original image and amendment is amplified then as shown in upper left and upper right.Due to just simple in prior art, user-selected image range coordinate is indiscriminately imitated in another picture, and changed due to both origin coordinates points, so just cause the picture of this image range after original image with amendment in picture inconsistent.
Summary of the invention
In order to solve in prior art when user by original image and amendment after figure compare side by side time, if when selecting an image range to amplify wherein in a width figure, can cause the problem that two width figure institute enlarged image scopes are inconsistent, the embodiment of the present invention proposes a kind of image processing method and device.Described technical scheme is as follows:
The embodiment of the present invention proposes a kind of image processing method, comprising:
When revising the size of original image, set up the pixel in described original image and the corresponding relation between the corresponding pixel revising rear picture;
When amplifying described original image or the rear picture of amendment, obtain required enlarged image scope; According to the corresponding relation between the corresponding pixel of picture after the pixel of described original image and amendment, the relevant position of picture after described original image and amendment is amplified, respectively to make the image after amplification consistent.
Preferred as technique scheme, described when revising the size of original image, after setting up pixel in described original image and amendment picture corresponding pixel between corresponding relation comprise:
When revising the size of described original image, obtaining the starting pixels point of picture after described amendment, and calculating the coordinate that this starting pixels point is arranged in described original image,
According to the coordinate of starting pixels point in original image of picture after described amendment, obtain the difference of the rear picture starting pixels point of amendment relative to the starting pixels point of original image, and coordinate of the pixel of picture and this pixel are positioned at the coordinate of described original image after calculating described amendment with this, with the corresponding relation Pt between the corresponding pixel obtaining picture after pixel in original image and amendment n(i n, j n)=F n(Pt 0(i, j)), wherein Pt n(i n, j n) be the pixel coordinate in picture after described amendment, Pt 0(i, j) is that corresponding pixel is being arranged in the coordinate of original image, F nfor mapping function.
Preferred as technique scheme, described when picture amplifies after to described original image or amendment, obtain required enlarged image scope; According to the corresponding relation between described original image and the corresponding pixel of picture after amendment, the relevant position of picture after described original image and amendment is amplified respectively, unanimously comprises to make the image after amplification:
When user selects required first image range of amplifying in described original image, determine the side-play amount Pt of coordinate points between described first image range and described original image offset;
According to this side-play amount, and after pixel in original image and amendment picture corresponding pixel between corresponding relation Pt n(i n, j n)=F n(Pt 0(i, j)), obtain the second image range corresponding in picture after described amendment;
Second image range of picture after first image range of described original image and described amendment is amplified in proportion; That is:
Coordinate after original image amplifies is Pt 0(x, y)=f ratio× Pt 0(i, j)+Pt offset; Wherein f ratiofor pantograph ratio;
Coordinate after amendment after picture amplification is Pt n(x, y)=f ratio× (Pt n(i n, j n)+Pt offset; Wherein f ratiofor pantograph ratio.
Preferred as technique scheme, described when picture amplifies after to described original image or amendment, obtain required enlarged image scope; According to the corresponding relation between described original image and the corresponding pixel of picture after amendment, the relevant position of picture after described original image and amendment is amplified respectively, unanimously comprises to make the image after amplification:
For when user selects required second image range of amplifying after described amendment in picture, determine the side-play amount Pt of coordinate points between picture after described second image range and described amendment offset;
According to this side-play amount, and after pixel in original image and amendment picture corresponding pixel between corresponding relation Pt n(i n, j n)=F n(Pt 0(i, j)), obtain the first image range corresponding in described original image;
Second image range of picture after described amendment and the first image range of described original image are amplified in proportion; That is:
Coordinate after amendment after picture amplification is Pt n(x, y)=f ratio× Pt n(i n, j n)+Pt offset; Wherein f ratiofor pantograph ratio;
Coordinate after original image amplifies is Pt 0(x, y)=f ratio× K n(Pt n(i n, j n))+Pt offset; Wherein f ratiofor pantograph ratio; K nfor mapping function F ninverse function.
The embodiment of the present invention also proposed a kind of image processing apparatus, comprising:
Corresponding relation determination module, for when revising the size of original image, sets up the pixel in described original image and the corresponding relation between the corresponding pixel revising rear picture;
Image range determination module, for when to described original image or when amplifying after revising, obtains required enlarged image scope; According to the corresponding relation between described original image and the corresponding pixel of picture after amendment, the relevant position of picture after described original image and amendment is amplified, to make the image after amplification consistent.
Preferred as technique scheme, described corresponding relation determination module comprises:
Coordinate acquiring unit, for when revising the size of described original image, obtaining the starting pixels point of picture after described amendment, and calculating the coordinate that this starting pixels point is arranged in described original image,
Corresponding relation unit, for the coordinate of starting pixels point in original image according to picture after described amendment, obtain the difference of the rear picture starting pixels point of amendment relative to the starting pixels point of original image, and after calculating described amendment with this coordinate of the pixel of picture and this do the coordinate that pixel is positioned at described original image, with the corresponding relation Pt between the corresponding pixel obtaining picture after pixel in original image and amendment n(i n, j n)=F n(Pt 0(i, j)), wherein Pt n(i n, j n) be the pixel coordinate in picture after described amendment, Pt 0(i, j) is that corresponding pixel is being arranged in the coordinate of original image, F nfor mapping function.
Preferred as technique scheme, described image range determination module comprises:
First side-play amount acquiring unit, during for selecting required first image range of amplifying in described original image as user, determines the side-play amount Pt of coordinate points between described first image range and described original image offset; Side-play amount Pt offsetcan be the difference of starting pixels point coordinate relative to the origin coordinates point coordinate of original image of this first image range;
First amplifying unit, for according to this side-play amount, and after pixel in original image and amendment picture corresponding pixel between corresponding relation Pt n(i n, j n)=F n(Pt 0(i, j)), obtain the second image range corresponding in picture after described amendment; Second image range of picture after first image range of described original image and described amendment is amplified in proportion; That is:
Coordinate after original image amplifies is Pt 0(x, y)=f ratio× Pt 0(i, j)+Pt offset; Wherein f ratiofor pantograph ratio;
Coordinate after amendment after picture amplification is Pt n(x, y)=f ratio× Pt n(i n, j n)+Pt offset; Wherein f ratiofor pantograph ratio.
Preferred as technique scheme, described image range determination module comprises:
Second side-play amount acquiring unit, for when user selects required second image range of amplifying after described amendment in picture, determines the side-play amount Pt of coordinate points between picture after described second image range and described amendment offset; Side-play amount Pt offsetcan be the difference of starting pixels point coordinate relative to the origin coordinates point coordinate of picture after amendment of this second image range;
Second amplifying unit, according to this side-play amount, and after pixel in original image and amendment picture corresponding pixel between corresponding relation Pt n(i n, j n)=F n(Pt 0(i, j)), obtain the first image range corresponding in described original image; Then the second image range of picture after described amendment and the first image range of described original image are amplified in proportion; That is:
Coordinate after amendment after picture amplification is Pt n(x, y)=f ratio× Pt n(i n, j n)+Pt offset; Wherein f ratiofor pantograph ratio;
Coordinate after original image amplifies is Pt 0(x, y)=f ratio× K n(Pt n(i n, j n))+Pt offset; Wherein f ratiofor pantograph ratio; K nfor mapping function F ninverse function.
The beneficial effect of the technical scheme that the embodiment of the present invention provides is: the embodiment of the present invention proposes a kind of image processing method and device, by setting up the corresponding relation of the rear pixel between picture and original image of amendment; When selecting an image range to amplify in user wherein a pictures, determine required enlarged image scope in another picture by this corresponding relation, to make the image after the amplification of described original image and the rear picture of amendment consistent.The embodiment of the present invention allows user pull arbitrarily on picture and selects required enlarged image scope, can also ensure that the image range of the original image after amplifying and the rear picture of amendment is consistent.
Accompanying drawing explanation
In order to be illustrated more clearly in the technical scheme of the embodiment of the present invention, be briefly described to the accompanying drawing used in embodiment below, apparently, listed accompanying drawing is only some embodiments of the present invention below, for those of ordinary skill in the art, under the prerequisite not paying creative work, other accompanying drawing can also be obtained according to these accompanying drawings.
Fig. 1 carries out comparison schematic diagram arranged side by side after existing image processing software is cut out;
Fig. 2 carries out amplifying and the schematic diagram compared side by side after selecting image range to the picture of in Fig. 1;
Fig. 3 is the schematic flow sheet of first embodiment of the invention;
Fig. 4 is the structural representation of third embodiment of the invention.
Embodiment
For making the object, technical solutions and advantages of the present invention clearly, below in conjunction with accompanying drawing, embodiment of the present invention is described further in detail.
The mentality of designing of the embodiment of the present invention is: the coordinate due to the picture after cutting out can correspond to the coordinate of original image, therefore sets up the corresponding relation between pixel after amendment in picture and the respective pixel point in original image in the embodiment of the present invention; Like this when carrying out partial enlargement to original image and the rear picture of amendment, then can determine corresponding image range.So just can ensure when comparing side by side, user can choose at random required enlarged image scope, and after ensureing original image and amendment, picture image range is after amplification completely the same.
By the following examples the present invention is further detailed.
Embodiment 1
First embodiment of the invention proposes a kind of image processing method, and its flow process as shown in Figure 3, comprising:
Step 101, when revising accompanying drawing size, the corresponding relation between the corresponding pixel setting up picture after pixel in original image and amendment;
Step 102, when amplifying picture, obtain required enlarged image scope;
Step 103, according to the corresponding relation between the corresponding pixel of picture after described original image and amendment, the relevant position of picture after described original image and amendment to be amplified, respectively to make the image after amplification consistent.
The embodiment of the present invention allows user pull arbitrarily on picture and selects required enlarged image scope, can also ensure that the image range of the original image after amplifying and the rear picture of amendment is consistent.
Embodiment 2
Second embodiment of the invention proposes a kind of image processing method, is to improve on the basis of the first embodiment, comprising:
Step 201, when revising accompanying drawing size, the corresponding relation between the corresponding pixel setting up picture after pixel in original image and amendment;
Step 202, when amplifying picture, obtain required enlarged image scope;
Step 203, according to the corresponding relation between the corresponding pixel of picture after described original image and amendment, the relevant position of picture after described original image and amendment to be amplified, respectively to make the image after amplification consistent.
Wherein, described step 201 can be specially:
Step 2011, when revising accompanying drawing size, obtaining the starting pixels point of picture after described amendment, and calculating the coordinate that this starting pixels point is arranged in described original image,
Step 2012, the coordinate of starting pixels point in original image according to picture after described amendment, obtain the difference of the rear picture starting pixels point of amendment relative to the starting pixels point of original image, and after calculating described amendment with this coordinate of the pixel of picture and this do the coordinate that pixel is positioned at described original image, with the corresponding relation Pt between the corresponding pixel obtaining picture after pixel in original image and amendment n(i n, j n)=F n(Pt 0(i, j)), wherein Pt 0(i, j) is the coordinate (i in picture after described amendment n, j n) pixel, Pt 0(i, j) this pixel is being arranged in the coordinate of original image, F nfor mapping function.
After the starting pixels point obtaining the rear picture of amendment, just can obtain the coordinate in original image that each pixel of the rear picture of amendment is corresponding.So just can be easy to obtain mapping function F n.
Such as: when cutting out the original image in left side as shown in Figure 1, its edge being cut out, obtaining as picture after the amendment on the right side of Fig. 1.Like this, after amendment, the coordinate of the pixel of the correspondence of starting pixels point in original image of picture is (20,30); Then each coordinate (s, p) of picture after amendment, its horizontal ordinate in original image is (s+20, p+30).So just can calculate mapping function F according to these two known parameters n.
Can calculate like this and be arranged in the coordinate of original image according to the starting pixels point of picture after amendment, obtain the pixel in original image and the corresponding relation between the corresponding pixel revising rear picture.This mode not only calculated amount is low, and this corresponding relation is accurate.
In step 203, user can select an image range to amplify in original image, also can an image range be selected in picture after the modification to amplify.
When selecting an image range to amplify in original image, then this step 203 can comprise:
Step 203a, when user selects required first image range of amplifying in described original image, determine the side-play amount Pt of coordinate points between described first image range and described original image offset.
Step 203b, according to this side-play amount, and after pixel in original image and amendment picture corresponding pixel between corresponding relation Pt n(i n, j n)=F n(Pt 0(i, j)), obtain the second image range corresponding in picture after described amendment.
Step 203c, the second image range of picture after the first image range of described original image and described amendment to be amplified in proportion.That is:
Coordinate after original image amplifies is Pt 0(x, y)=f ratio× Pt 0(i, j)+Pt offset; Wherein f ratiofor pantograph ratio;
Coordinate after amendment after picture amplification is Pt n(x, y)=f ratio× K n(Pt n(i n, j n))+Pt offset; Wherein f ratiofor pantograph ratio; K nfor mapping function F ninverse function.
Wherein, pantograph ratio fratio and side-play amount PtOffset is the known parameters that can input acquisition according to user.
In step 203b, side-play amount Pt offsetacquisition can be calculated relative to the difference of the origin coordinates point coordinate of original image by the starting pixels point coordinate of this first image range.Owing to having obtained the corresponding relation of picture after original image and amendment in aforesaid step 2011 and step 2022, therefore can according to the side-play amount Pt calculated of this corresponding relation and acquisition offset, the second image range that first image range that can calculate this original image is corresponding in picture after the modification.The first image range can be able to be made identical with the image corresponding to the second image range by simple mode like this.
When selecting an image range to amplify in picture after the modification, then this step 203 can comprise:
Step 203A, for when user selects required second image range of amplifying after described amendment in picture, determines the side-play amount Pt of coordinate points between picture after described second image range and described amendment offset.
Step 203B, according to this side-play amount, and after pixel in original image and amendment picture corresponding pixel between corresponding relation Pt n(i n, j n)=F n(Pt 0(i, j)), obtain the first image range corresponding in described original image.
Step 203C, the second image range of picture after described amendment and the first image range of described original image to be amplified in proportion.That is:
Coordinate after amendment after picture amplification is Pt n(x, y)=f ratio× Pt n(i, j)+Pt offset; Wherein f ratiofor pantograph ratio;
Coordinate after original image amplifies is Pt n(x, y)=f ratio× K n(Pt n(i n, j n))+Pt offset; Wherein f ratiofor pantograph ratio; K nfor mapping function F ninverse function.
Wherein the principle of step 203B is identical with aforesaid step 203b, does not repeat them here.
Wherein, in aforesaid step, may occur that user selects an image range in original image, and the image range do not had in picture after containing amendment in this image range.This situation can adopt various ways to carry out subsequent treatment, and the embodiment of the present invention does not make restriction to this.Such as: user can be pointed out to go beyond the scope; Again such as: the part lacked by picture after amendment adds background color to supplement.
In second embodiment of the invention, can obtain corresponding relation by simple mode, this mode not only calculated amount is low, and this corresponding relation is accurate.Simultaneously, above-mentioned corresponding relation can also be utilized to obtain the mode of being carried out corresponding amplification by above-mentioned corresponding relation, user can be worked as when selecting in picture an image-region to amplify after original image or amendment, by the inverse function of the mapping function of relativity, and the offset function of user-selected image range coordinate and original image, just can calculate the image range of picture after corresponding amendment, realize the image after amplifying with this consistent.
Embodiment 3
Third embodiment of the invention proposes a kind of image processing apparatus, and its structure as shown in Figure 4, comprising:
Corresponding relation determination module 1, for when revising accompanying drawing size, sets up the pixel in original image and the corresponding relation between the corresponding pixel revising rear picture;
Image range determination module 2, for when amplifying picture, obtains required enlarged image scope; According to the corresponding relation between described original image and the corresponding pixel of picture after amendment, the relevant position of picture after described original image and amendment is amplified, to make the image after amplification consistent.
The embodiment of the present invention allows user pull arbitrarily on picture and selects required enlarged image scope, can also ensure that the image range of the original image after amplifying and the rear picture of amendment is consistent.
Embodiment 4
Fourth embodiment of the invention proposes a kind of image processing apparatus, is to improve on the basis of the 3rd embodiment, comprising:
Corresponding relation determination module 1, for when revising accompanying drawing size, sets up the pixel in original image and the corresponding relation between the corresponding pixel revising rear picture;
Image range determination module 2, for when amplifying picture, obtains required enlarged image scope; According to the corresponding relation between described original image and the corresponding pixel of picture after amendment, the relevant position of picture after described original image and amendment is amplified, to make the image after amplification consistent.
Wherein, corresponding relation determination module 1 comprises:
Coordinate acquiring unit, for when revising accompanying drawing size, obtaining the starting pixels point of picture after described amendment, and calculating the coordinate that this starting pixels point is arranged in described original image,
Corresponding relation unit, for the coordinate of starting pixels point in original image according to picture after described amendment, obtain the difference of the rear picture starting pixels point of amendment relative to the starting pixels point of original image, and after calculating described amendment with this coordinate of the pixel of picture and this do the coordinate that pixel is positioned at described original image, with the corresponding relation Pt between the corresponding pixel obtaining picture after pixel in original image and amendment n(i n, j n)=F n(Pt 0(i, j)), wherein Pt n(i n, j n) be the pixel coordinate in picture after described amendment, Pt 0(i, j) is that corresponding pixel is being arranged in the coordinate of original image, F nfor mapping function.
After the starting pixels point obtaining the rear picture of amendment, just can obtain the coordinate in original image that each pixel of the rear picture of amendment is corresponding.So just can be easy to obtain mapping function F n.
Such as: when cutting out the original image in left side as shown in Figure 1, its edge being cut out, obtaining as picture after the amendment on the right side of Fig. 1.Like this, after amendment, the coordinate of the pixel of the correspondence of starting pixels point in original image of picture is (20,30); Then each coordinate (s, p) of picture after amendment, its horizontal ordinate in original image is (s+20, p+30).So just can calculate mapping function F according to these two known parameters n.
The coordinate of original image can be arranged according to the starting pixels point of picture after amendment like this, obtain the pixel in original image and the corresponding relation between the corresponding pixel revising rear picture.This mode not only calculated amount is low, and this corresponding relation is accurate.
In embodiments of the present invention, user can select an image range to amplify in original image, now then needs to amplify the relevant position of picture after amendment; User also can select in picture an image range to amplify after the modification, now then needs to amplify the relevant position of original image.
When selecting an image range to amplify in original image, image range determination module 2 comprises:
First side-play amount acquiring unit, during for selecting required first image range of amplifying in described original image as user, determines the side-play amount Pt of coordinate points between described first image range and described original image offset; Side-play amount Pt offsetcan be the difference of starting pixels point coordinate relative to the origin coordinates point coordinate of original image of this first image range;
First amplifying unit, for according to this side-play amount, and after pixel in original image and amendment picture corresponding pixel between corresponding relation Pt n(i n, j n)=F n(Pt 0(i, j)), obtain the second image range corresponding in picture after described amendment; Second image range of picture after first image range of described original image and described amendment is amplified in proportion.That is:
Coordinate after original image amplifies is Pt 0(x, y)=f ratio× Pt 0(i, j)+Pt offset; Wherein f ratiofor pantograph ratio;
Coordinate after amendment after picture amplification is Pt n(x, y)=f ratio× K n(Pt n(i n, j n))+Pt offset; Wherein f ratiofor pantograph ratio; K nfor mapping function F ninverse function.
Wherein, pantograph ratio fratio and side-play amount PtOffset is the known parameters that can input acquisition according to user.
In the first side-play amount acquiring unit, side-play amount Pt offsetacquisition can be calculated relative to the difference of the origin coordinates point coordinate of original image by the starting pixels point coordinate of this first image range.Owing to having obtained the corresponding relation of picture after original image and amendment in aforesaid coordinate acquiring unit and coordinate acquiring unit, therefore can according to the side-play amount Pt calculated of this corresponding relation and acquisition offset, the second image range that first image range that can calculate this original image is corresponding in picture after the modification.The first image range can be able to be made identical with the image corresponding to the second image range by simple mode like this.
When selecting an image range to amplify in picture after the modification, image range determination module 2 comprises:
Second side-play amount acquiring unit, for when user selects required second image range of amplifying after described amendment in picture, determines the side-play amount Pt of coordinate points between picture after described second image range and described amendment offset; Side-play amount Pt offsetcan be the difference of starting pixels point coordinate relative to the origin coordinates point coordinate of picture after amendment of this second image range;
Second amplifying unit, according to this side-play amount, and after pixel in original image and amendment picture corresponding pixel between corresponding relation Pt n(i n, j n)=F n(Pt 0(i, j)), obtain the first image range corresponding in described original image; Then the second image range of picture after described amendment and the first image range of described original image are amplified in proportion.That is:
Coordinate after amendment after picture amplification is Pt n(x, y)=f ratio× Pt n(i, j)+Pt offset; Wherein f ratiofor pantograph ratio;
Coordinate after original image amplifies is Pt n(x, y)=f ratio× K n(Pt n(i n, j n))+Pt offset; Wherein f ratiofor pantograph ratio; K nfor mapping function F ninverse function.
Wherein, in aforesaid device, may occur that user selects an image range in original image, and the image range do not had in picture after containing amendment in this image range.This situation can adopt various ways to carry out subsequent treatment, and the embodiment of the present invention does not make restriction to this.Such as: user can be pointed out to go beyond the scope; Again such as: the part lacked by picture after amendment adds background color to supplement.
In fourth embodiment of the invention, can obtain corresponding relation by simple mode, this mode not only calculated amount is low, and this corresponding relation is accurate.Simultaneously, above-mentioned corresponding relation can also be utilized to obtain the mode of being carried out corresponding amplification by above-mentioned corresponding relation, user can be worked as when selecting in picture an image-region to amplify after original image or amendment, by the inverse function of the mapping function of relativity, and the offset function of user-selected image range coordinate and original image, just can calculate the image range of picture after corresponding amendment, realize the image after amplifying with this consistent.
If unit integrated described in the embodiment of the present invention using the form of SFU software functional unit realize and as independently production marketing or use time, also can be stored in a computer read/write memory medium.Based on such understanding, technical scheme of the present invention can embody with the form of software product the part that prior art contributes in essence in other words, this computer software product is stored in a storage medium, comprising some instructions in order to make a computer equipment (can be personal computer, server, or the network equipment etc.) perform all or part of of method described in each embodiment of the present invention.And aforesaid storage medium comprises: USB flash disk, portable hard drive, ROM (read-only memory) (ROM, Read-OnlyMemory), random access memory (RAM, RandomAccessMemory), magnetic disc or CD etc. various can be program code stored medium.
These are only preferred embodiment of the present invention, not in order to limit the present invention, within the spirit and principles in the present invention all, any amendment done, equivalent replacement, improvement etc., all should be included within protection scope of the present invention.

Claims (8)

1. an image processing method, is characterized in that, comprising:
When revising the size of original image, set up the pixel in described original image and the corresponding relation between the corresponding pixel revising rear picture;
Described amendment original image is of a size of and carries out scaling to described original image, or cuts out described original image;
When amplifying described original image or the rear picture of amendment, obtain required enlarged image scope; According to the corresponding relation between the corresponding pixel of picture after the pixel of described original image and amendment, the relevant position of picture after described original image and amendment is amplified, respectively to make the image after amplification consistent.
2. image processing method according to claim 1, is characterized in that, described when revising the size of original image, after setting up pixel in described original image and amendment picture corresponding pixel between corresponding relation comprise:
When revising the size of described original image, obtaining the starting pixels point of picture after described amendment, and calculating the coordinate that this starting pixels point is arranged in described original image,
According to the coordinate of starting pixels point in original image of picture after described amendment, obtain the difference of the rear picture starting pixels point of amendment relative to the starting pixels point of original image, and coordinate of the pixel of picture and this pixel are positioned at the coordinate of described original image after calculating described amendment with this, with the corresponding relation Pt between the corresponding pixel obtaining picture after pixel in original image and amendment n(i n, j n)=F n(Pt 0(i, j)), wherein Pt n(i n, j n) be the pixel coordinate in picture after described amendment, Pt 0(i, j) is that corresponding pixel is being arranged in the coordinate of original image, F nfor mapping function.
3. image processing method according to claim 2, is characterized in that, described when amplifying described original image or the rear picture of amendment, obtains required enlarged image scope; According to the corresponding relation between described original image and the corresponding pixel of picture after amendment, the relevant position of picture after described original image and amendment is amplified respectively, unanimously comprises to make the image after amplification:
When user selects required first image range of amplifying in described original image, determine the side-play amount Pt of coordinate points between described first image range and described original image offset;
According to this side-play amount, and after pixel in original image and amendment picture corresponding pixel between corresponding relation Pt n(i n, j n)=F n(Pt 0(i, j)), obtain the second image range corresponding in picture after described amendment;
Second image range of picture after first image range of described original image and described amendment is amplified in proportion; That is:
Coordinate after original image amplifies is Pt 0(x, y)=f ratio× Pt 0(i, j)+Pt offset; Wherein f ratiofor pantograph ratio;
Coordinate after amendment after picture amplification is Pt n(x, y)=f ratio× (Pt n(i n, j n)+Pt offset; Wherein f ratiofor pantograph ratio.
4. image processing method according to claim 2, is characterized in that, described when amplifying described original image or the rear picture of amendment, obtains required enlarged image scope; According to the corresponding relation between described original image and the corresponding pixel of picture after amendment, the relevant position of picture after described original image and amendment is amplified respectively, unanimously comprises to make the image after amplification:
For when user selects required second image range of amplifying after described amendment in picture, determine the side-play amount Pt of coordinate points between picture after described second image range and described amendment offset;
According to this side-play amount, and after pixel in original image and amendment picture corresponding pixel between corresponding relation Pt n(i n, j n)=F n(Pt 0(i, j)), obtain the first image range corresponding in described original image;
Second image range of picture after described amendment and the first image range of described original image are amplified in proportion; That is:
Coordinate after amendment after picture amplification is Pt n(x, y)=f ratio× Pt n(i n, j n)+Pt offset; Wherein f ratiofor pantograph ratio;
Coordinate after original image amplifies is Pt n(x, y)=f ratio× Pt n(i, j)+Pt offset; Wherein f ratiofor pantograph ratio.
5. an image processing apparatus, is characterized in that, comprising:
Corresponding relation determination module, for when revising the size of original image, sets up the pixel in described original image and the corresponding relation between the corresponding pixel revising rear picture;
Described amendment original image is of a size of and carries out scaling to described original image, or cuts out described original image;
Image range determination module, for when to described original image or when amplifying after revising, obtains required enlarged image scope; According to the corresponding relation between described original image and the corresponding pixel of picture after amendment, the relevant position of picture after described original image and amendment is amplified, to make the image after amplification consistent.
6. image processing apparatus according to claim 5, is characterized in that, described corresponding relation determination module comprises:
Coordinate acquiring unit, for when revising the size of described original image, obtaining the starting pixels point of picture after described amendment, and calculating the coordinate that this starting pixels point is arranged in described original image,
Corresponding relation unit, for the coordinate of starting pixels point in original image according to picture after described amendment, obtain the difference of the rear picture starting pixels point of amendment relative to the starting pixels point of original image, and after calculating described amendment with this coordinate of the pixel of picture and this do the coordinate that pixel is positioned at described original image, with the corresponding relation Pt between the corresponding pixel obtaining picture after pixel in original image and amendment n(i n, j n)=F n(Pt 0(i, j)), wherein Pt n(i n, j n) be the pixel coordinate in picture after described amendment, Pt 0(i, j) is that corresponding pixel is being arranged in the coordinate of original image, F nfor mapping function.
7. image processing apparatus according to claim 6, is characterized in that, described image range determination module comprises:
First side-play amount acquiring unit, during for selecting required first image range of amplifying in described original image as user, determines the side-play amount Pt of coordinate points between described first image range and described original image offset; Side-play amount Pt offsetcan be the difference of starting pixels point coordinate relative to the origin coordinates point coordinate of original image of this first image range;
First amplifying unit, for according to this side-play amount, and after pixel in original image and amendment picture corresponding pixel between corresponding relation Pt n(i n, j n)=F n(Pt 0(i, j)), obtain the second image range corresponding in picture after described amendment; Second image range of picture after first image range of described original image and described amendment is amplified in proportion; That is:
Coordinate after original image amplifies is Pt 0(x, y)=f ratio× Pt 0(i, j)+Pt offset; Wherein f ratiofor pantograph ratio;
Coordinate after amendment after picture amplification is Pt n(x, y)=f ratio× Pt n(i n, j n)+Pt offset; Wherein f ratiofor pantograph ratio.
8. the image processing apparatus according to claim 5 or 6, is characterized in that, described image range determination module comprises:
Second side-play amount acquiring unit, for when user selects required second image range of amplifying after described amendment in picture, determines the side-play amount Pt of coordinate points between picture after described second image range and described amendment offset; Side-play amount Pt offsetcan be the difference of starting pixels point coordinate relative to the origin coordinates point coordinate of picture after amendment of this second image range;
Second amplifying unit, according to this side-play amount, and after pixel in original image and amendment picture corresponding pixel between corresponding relation Pt n(i n, j n)=F n(Pt 0(i, j)), obtain the first image range corresponding in described original image; Then the second image range of picture after described amendment and the first image range of described original image are amplified in proportion; That is:
Coordinate after amendment after picture amplification is Pt n(x, y)=f ratio× Pt n(i n, j n)+Pt offset; Wherein f ratiofor pantograph ratio;
Coordinate after original image amplifies is Pt n(x, y)=f ratio× Pt n(i, j)+Pt offset; Wherein f ratiofor pantograph ratio.
CN201010235716.1A 2010-07-21 2010-07-21 Image processing method and device Active CN102339469B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201010235716.1A CN102339469B (en) 2010-07-21 2010-07-21 Image processing method and device

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201010235716.1A CN102339469B (en) 2010-07-21 2010-07-21 Image processing method and device

Publications (2)

Publication Number Publication Date
CN102339469A CN102339469A (en) 2012-02-01
CN102339469B true CN102339469B (en) 2015-11-25

Family

ID=45515183

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201010235716.1A Active CN102339469B (en) 2010-07-21 2010-07-21 Image processing method and device

Country Status (1)

Country Link
CN (1) CN102339469B (en)

Families Citing this family (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN103345738B (en) * 2013-06-04 2016-08-17 北京百度网讯科技有限公司 Method for checking object based on area-of-interest and device
CN106970753A (en) * 2017-03-15 2017-07-21 福建中金在线信息科技有限公司 A kind of picture amplifying method and device
CN110362250B (en) * 2018-04-09 2021-03-23 杭州海康威视数字技术股份有限公司 Image local amplification method and device and display equipment
CN110941375B (en) * 2019-11-26 2023-09-05 腾讯科技(深圳)有限公司 Method, device and storage medium for locally amplifying image

Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN1904940A (en) * 2005-07-28 2007-01-31 汤姆森许可贸易公司 Method and device for generating a sequence of images of reduced size
CN101179671A (en) * 2006-11-10 2008-05-14 上海奇码数字信息有限公司 Image scaling device and image scaling method
EP2015880A1 (en) * 2006-05-04 2009-01-21 Outotec Oyj Method and equipment for cooling anodes
CN101670713A (en) * 2008-09-10 2010-03-17 兄弟工业株式会社 Print label editing apparatus

Family Cites Families (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101576996B (en) * 2009-06-05 2012-04-25 腾讯科技(深圳)有限公司 Processing method and device for realizing image zooming

Patent Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN1904940A (en) * 2005-07-28 2007-01-31 汤姆森许可贸易公司 Method and device for generating a sequence of images of reduced size
EP2015880A1 (en) * 2006-05-04 2009-01-21 Outotec Oyj Method and equipment for cooling anodes
CN101179671A (en) * 2006-11-10 2008-05-14 上海奇码数字信息有限公司 Image scaling device and image scaling method
CN101670713A (en) * 2008-09-10 2010-03-17 兄弟工业株式会社 Print label editing apparatus

Non-Patent Citations (1)

* Cited by examiner, † Cited by third party
Title
《大小不同的图像变形方法的研究与实现》;赵恒军;《中国优秀硕士学位论文全文数据库 信息科技辑》;20071015(第4期);全文 *

Also Published As

Publication number Publication date
CN102339469A (en) 2012-02-01

Similar Documents

Publication Publication Date Title
CN104038807B (en) A kind of figure layer mixed method and device based on OpenGL
US8890886B2 (en) User interface with color themes based on input image data
CN102147911B (en) Image processing device
CN102339469B (en) Image processing method and device
EP1347418A3 (en) Texture map editing
US10347052B2 (en) Color-based geometric feature enhancement for 3D models
CN101183283A (en) Method for directly writing handwriting information
CN104751765A (en) Display control method and electronic device
CN106204441A (en) The method and device that a kind of image local amplifies
CN104915332A (en) Method and device for generating composing template
CN109584366B (en) Terrain rendering method, device, equipment and readable storage medium
CN101656037B (en) Method for displaying large-format picture on small screen equipment and small screen equipment
CN109407940A (en) A kind of target object chooses method, system, terminal and storage medium
CN105094615A (en) Information processing method and electronic equipment
US20110211770A1 (en) Compressibility-aware media retargeting with structure preserving
US10013631B2 (en) Collaboration system with raster-to-vector image conversion
CN105578035A (en) Image processing method and electronic device
CN106201255B (en) Information processing method and electronic equipment
CN103236042A (en) Self-adaptive picture processing method and device
JP2010056691A5 (en)
CN103310409B (en) A kind of Tile-based renders the fast triangle block method of framework GPU
CN102074025A (en) Image stylized drawing method and device
JP2019504430A5 (en)
US20160185049A1 (en) Print data dividing apparatus, program, and recording medium
CN106408647B (en) A kind of image shade adding method and device

Legal Events

Date Code Title Description
C06 Publication
PB01 Publication
C10 Entry into substantive examination
SE01 Entry into force of request for substantive examination
C14 Grant of patent or utility model
GR01 Patent grant