CN105721872A - Image compression method, and terminal - Google Patents

Image compression method, and terminal Download PDF

Info

Publication number
CN105721872A
CN105721872A CN201610066454.8A CN201610066454A CN105721872A CN 105721872 A CN105721872 A CN 105721872A CN 201610066454 A CN201610066454 A CN 201610066454A CN 105721872 A CN105721872 A CN 105721872A
Authority
CN
China
Prior art keywords
image
processed
target area
touch
area
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Pending
Application number
CN201610066454.8A
Other languages
Chinese (zh)
Inventor
黄宏用
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Guangdong Oppo Mobile Telecommunications Corp Ltd
Original Assignee
Guangdong Oppo Mobile Telecommunications Corp 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 Guangdong Oppo Mobile Telecommunications Corp Ltd filed Critical Guangdong Oppo Mobile Telecommunications Corp Ltd
Priority to CN201610066454.8A priority Critical patent/CN105721872A/en
Publication of CN105721872A publication Critical patent/CN105721872A/en
Pending legal-status Critical Current

Links

Classifications

    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04NPICTORIAL COMMUNICATION, e.g. TELEVISION
    • H04N19/00Methods or arrangements for coding, decoding, compressing or decompressing digital video signals
    • H04N19/10Methods or arrangements for coding, decoding, compressing or decompressing digital video signals using adaptive coding
    • H04N19/134Methods or arrangements for coding, decoding, compressing or decompressing digital video signals using adaptive coding characterised by the element, parameter or criterion affecting or controlling the adaptive coding
    • H04N19/162User input
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04NPICTORIAL COMMUNICATION, e.g. TELEVISION
    • H04N19/00Methods or arrangements for coding, decoding, compressing or decompressing digital video signals
    • H04N19/10Methods or arrangements for coding, decoding, compressing or decompressing digital video signals using adaptive coding
    • H04N19/134Methods or arrangements for coding, decoding, compressing or decompressing digital video signals using adaptive coding characterised by the element, parameter or criterion affecting or controlling the adaptive coding
    • H04N19/167Position within a video image, e.g. region of interest [ROI]
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04NPICTORIAL COMMUNICATION, e.g. TELEVISION
    • H04N19/00Methods or arrangements for coding, decoding, compressing or decompressing digital video signals
    • H04N19/20Methods or arrangements for coding, decoding, compressing or decompressing digital video signals using video object coding
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04NPICTORIAL COMMUNICATION, e.g. TELEVISION
    • H04N19/00Methods or arrangements for coding, decoding, compressing or decompressing digital video signals
    • H04N19/85Methods or arrangements for coding, decoding, compressing or decompressing digital video signals using pre-processing or post-processing specially adapted for video compression

Landscapes

  • Engineering & Computer Science (AREA)
  • Multimedia (AREA)
  • Signal Processing (AREA)
  • Compression Or Coding Systems Of Tv Signals (AREA)

Abstract

An embodiment of the present invention provides an image compression method. The method includes the steps of acquiring a to-be-processed image; acquiring a touch parameter generated by a touch operation on the to-be-processed image; determining a target region and a non-target region in the to-be-processed image according to the touch parameter; compressing the target region and the non-target region in the to-be-processed image in different compression manners; and outputting the compressed to-be-processed image. An embodiment of the present invention further provides a terminal. According to the image compression method and the terminal, the target region and the non-target region can be determined through the touch operation for the to-be-processed image, and the target region and the non-target region are compressed in different manners, thereby meeting individual requirements of users. According to the method, the overall to-be-processed image is not blurred, a region that the user is interested in is less compressed, and a region that the user is not interested in is more compressed.

Description

Image compression method and terminal
Technical Field
The invention relates to the field of image processing, in particular to an image compression method and a terminal.
Background
With the rapid development of information technology, the integrated functions of terminals (such as mobile phones, tablet computers, and the like) are becoming larger and larger, and the terminals can be used for conversation, surfing the internet, gaming, photographing, image compression, and the like. In life, when transmitting images on a network, the image compression is selected in consideration of sending speed and flow saving, and the compressed images have the characteristics of high transmission speed and flow saving.
Disclosure of Invention
The embodiment of the invention provides an image compression method and a terminal, which can meet the individual requirements of users.
The first aspect of the embodiments of the present invention provides a method for image compression, including:
acquiring an image to be processed;
acquiring a touch parameter generated by performing touch operation on the image to be processed;
determining a target area and a non-target area in the image to be processed according to the touch parameter;
compressing a target area and a non-target area in the image to be processed according to different compression modes;
and outputting the compressed image to be processed.
With reference to the first aspect of the embodiment of the present invention, in a first possible implementation manner of the first aspect, the touch parameter is at least one of a pressing area for pressing the image to be processed, a closed trajectory formed by a sliding trajectory generated by performing a touch operation on the image to be processed, and a touch point generated by pressing a touch screen.
With reference to the first possible implementation manner of the first aspect of the embodiment of the present invention, in a second possible implementation manner of the first aspect, the determining, according to the touch parameter, a target area and a non-target area in the image to be processed includes:
when the touch parameter is the pressing area, determining the pressing area in the image to be processed as a target area, and determining an area except the target area in the image to be processed as a non-target area;
or,
when the touch parameter is the closed track, determining an area contained in the closed track in the image to be processed as a target area, and determining an area outside the target area in the image to be processed as a non-target area;
or,
when the number of the touch points is 2, the abscissa and the ordinate of the touch points are different from each other, determining a target area according to the coordinates of the touch points, and determining an area except the target area in the image to be processed as a non-target area;
or,
and when the number of the touch points is more than or equal to 3 and at least 3 touch points are not on a straight line, taking areas obtained by sequentially connecting the touch points as target areas, and determining areas except the target areas in the image to be processed as non-target areas.
With reference to the first aspect of the embodiment of the present invention or the first or second possible implementation manner of the first aspect, in a third possible implementation manner of the first aspect, the compressing a target region and a non-specific region in the image to be processed according to different compression manners includes:
and compressing the target area in the image to be processed according to a preset first compression ratio, and compressing the non-target area in the image to be processed according to a preset second compression ratio.
With reference to the first aspect of the embodiment of the present invention or the first or second possible implementation manner of the first aspect, in a fourth possible implementation manner of the first aspect, the compressing a target region and a non-specific region in the image to be processed according to different compression manners includes:
compressing a target area in the image to be processed according to a lossless compression mode and compressing a non-target area in the image to be processed according to a lossy compression mode;
or,
and compressing a target area in the image to be processed according to a lossy compression mode and compressing a non-target area in the image to be processed according to a lossless compression mode.
A second aspect of an embodiment of the present invention provides a terminal, including:
the acquisition unit is used for acquiring an image to be processed;
the acquisition unit is further used for acquiring touch parameters generated by performing touch operation on the image to be processed;
the determining unit is used for determining a target area and a non-target area in the image to be processed according to the touch parameters acquired by the acquiring unit;
the compression unit is used for compressing the target area and the non-target area in the image to be processed, which are determined by the determination unit, according to different compression modes;
and the output unit is used for outputting the image to be processed compressed by the compression unit.
With reference to the second aspect of the embodiment of the present invention, in a first possible implementation manner of the second aspect, the touch parameter is at least one of a pressing area for pressing the image to be processed, a closed trajectory formed by a sliding trajectory generated by performing a touch operation on the image to be processed, and a touch point generated by pressing a touch screen.
With reference to the first possible implementation manner of the second aspect of the embodiment of the present invention, in a second possible implementation manner of the second aspect, the determining unit is specifically configured to:
when the touch parameter is the pressing area, determining the pressing area in the image to be processed as a target area, and determining an area except the target area in the image to be processed as a non-target area;
or,
when the touch parameter is the closed track, determining an area contained in the closed track in the image to be processed as a target area, and determining an area outside the target area in the image to be processed as a non-target area;
or,
when the number of the touch points is 2, the abscissa and the ordinate of the touch points are different from each other, determining a target area according to the coordinates of the touch points, and determining an area except the target area in the image to be processed as a non-target area;
or,
and when the number of the touch points is more than or equal to 3 and at least 3 touch points are not on a straight line, taking areas obtained by sequentially connecting the touch points as target areas, and determining areas except the target areas in the image to be processed as non-target areas.
With reference to the second aspect of the embodiment of the present invention or the first or second possible implementation manner of the second aspect, in a third possible implementation manner of the second aspect, the compression unit is specifically configured to:
and compressing the target area in the image to be processed according to a preset first compression ratio, and compressing the non-target area in the image to be processed according to a preset second compression ratio.
With reference to the second aspect of the embodiment of the present invention or the first or second possible implementation manner of the second aspect, in a fourth possible implementation manner of the second aspect, the compression unit is specifically configured to:
compressing a target area in the image to be processed according to a lossless compression mode and compressing a non-target area in the image to be processed according to a lossy compression mode;
or,
and compressing a target area in the image to be processed according to a lossy compression mode and compressing a non-target area in the image to be processed according to a lossless compression mode.
A third aspect of an embodiment of the present invention provides a terminal, including:
a memory storing executable program code;
a processor coupled with the memory;
the processor calls the executable program code stored in the memory to perform some or all of the steps described in any of the methods of the first aspect of embodiments of the invention.
The embodiment of the invention has the following beneficial effects:
by the embodiment of the invention, the terminal can acquire the image to be processed, acquire the touch parameter generated by performing touch operation on the image to be processed, determine the target area and the non-target area in the image to be processed according to the touch parameter, compress the target area and the non-target area according to different compression modes and output the compressed image to be processed. Therefore, the target area and the non-target area are determined by utilizing the touch operation performed on the image to be processed, different compression is performed on the two parts of areas, the individual requirements of the user can be met, the method can avoid the overall blurring of the image to be processed, the area which the user is interested in can be compressed less, and the area which is not interested in can be compressed more.
Drawings
In order to more clearly illustrate the technical solutions in the embodiments of the present invention, the drawings needed to be used in the description of the embodiments are briefly introduced below, and it is obvious that the drawings in the following description are some embodiments of the present invention, and it is obvious for those skilled in the art to obtain other drawings based on these drawings without creative efforts.
Fig. 1 is a schematic flow chart of a first embodiment of a method for image compression according to an embodiment of the present invention;
FIG. 2 is a flowchart illustrating a second embodiment of a method for image compression according to an embodiment of the present invention;
FIG. 3 is a flowchart illustrating a method for compressing an image according to a third embodiment of the present invention;
fig. 4 is a schematic structural diagram of a terminal according to a first embodiment of the present invention;
fig. 5 is a schematic structural diagram of a terminal according to a second embodiment of the present invention.
Detailed Description
The embodiment of the invention provides an image compression method and a terminal, which can meet the individual requirements of users.
In order to make the technical solutions of the present invention better understood, the technical solutions in the embodiments of the present invention will be clearly and completely described below with reference to the drawings in the embodiments of the present invention, and it is obvious that the described embodiments are only a part of the embodiments of the present invention, and not all of the embodiments. All other embodiments, which can be derived by a person skilled in the art from the embodiments given herein without making any creative effort, shall fall within the protection scope of the present invention.
The following are detailed below.
The terms "first," "second," "third," and "fourth," etc. in the description and claims of the invention and in the accompanying drawings are used for distinguishing between different objects and not for describing a particular order. Furthermore, the terms "include" and "have," as well as any variations thereof, are intended to cover non-exclusive inclusions. For example, a process, method, system, article, or apparatus that comprises a list of steps or elements is not limited to only those steps or elements listed, but may alternatively include other steps or elements not listed, or inherent to such process, method, article, or apparatus.
Reference herein to "an embodiment" means that a particular feature, structure, or characteristic described in connection with the embodiment can be included in at least one embodiment of the invention. The appearances of the phrase in various places in the specification are not necessarily all referring to the same embodiment, nor are separate or alternative embodiments mutually exclusive of other embodiments. It is explicitly and implicitly understood by one skilled in the art that the embodiments described herein can be combined with other embodiments.
It should be noted that the terminal described in the embodiment of the present invention may include a smart phone (such as an Android phone, an iOS phone, a windows phone, etc.), a tablet computer, a palmtop computer, a notebook computer, a mobile internet device (MID, mobile internet devices), a wearable device, and the like, and the terminal is merely an example and is not exhaustive, and includes but is not limited to the terminal.
Fig. 1 is a flowchart illustrating a method of image compression according to a first embodiment of the present invention. The method for compressing an image described in the present embodiment includes the steps of:
101. and acquiring an image to be processed.
In the embodiment of the invention, the image to be processed can be any image in an album of the terminal, an image shot by a camera or a network image. Alternatively, the image to be processed may be one image or a plurality of images.
102. And acquiring touch parameters generated by performing touch operation on the image to be processed.
In the embodiment of the present invention, the touch parameter may be a pressing area for pressing the image to be processed, for example, when the user presses a certain area in the image to be processed with a finger, the pressing area contacted by the terminal, which can detect that the finger touches the touch screen, may be used as the touch parameter.
Alternatively, the touch parameter may be a closed trajectory composed of a sliding trajectory generated by performing a touch operation on the image to be processed. For example, a user performs a touch operation on the touch screen for the image to be processed, and may form a sliding closed trajectory, which may be used as a touch parameter.
Optionally, the touch parameter may also be a closed trajectory composed of a pressing area for pressing the image to be processed and a sliding trajectory generated by performing a touch operation on the image to be processed. For example, when a user presses a certain area in an image to be processed with a finger, the terminal may detect that the pressed area contacted by the finger on the touch screen may be used as a touch parameter, and then, the user performs a touch operation on the touch screen with respect to the image to be processed, may form a sliding closed trajectory, and may use the closed trajectory as the touch parameter. Finally, the pressing area and the closed trajectory can be taken together as a touch parameter.
Optionally, the touch points in this embodiment may be the number of fingers of the user pressing the touch screen, which is detected by the terminal, for example, if 3 fingers are used, 3 touch points may be detected, and when the 3 touch points are not on the same straight line, the 3 touch points may be connected to form a triangle, and the triangle may be used as the touch parameter. Similarly, N touch points, where N is an integer greater than or equal to 3, and at least 3 touch points in the N touch points are not on the same straight line, may be sequentially connected, and a closed area obtained after the connection may be used as a touch parameter.
Optionally, the terminal may obtain two touch points generated by the user performing the touch operation, and obtain coordinates of the two touch points, where abscissa of the coordinates of the two touch points are different from each other, and ordinate of the coordinates of the two touch points are also different from each other, and the target area may be generated according to the coordinates of the two touch points. For example, if the coordinates of the first touch point are (x1, y1), the coordinates of the second touch point are (x2, y2), and x1 is not equal to x2, and y1 is not equal to y2, a closed region may be generated by (x1, y1) and (x2, y2), that is, a closed region may be formed by four lines, that is, x — x1, y — y1, x — x2, and y — y 2. The closed area can be used as a touch parameter.
In short, the touch parameter is one of a pressing area for pressing the image to be processed, a closed track formed by a sliding track generated by performing a touch operation on the image to be processed, a touch point generated by pressing the touch screen, or a combination thereof.
103. And determining a target area and a non-target area in the image to be processed according to the touch parameters.
In the embodiment of the invention, the terminal can determine the target area and the non-target area in the image to be processed according to the touch parameter.
Specifically, when the touch parameter is a pressing area for pressing the image to be processed, the terminal may determine the pressing area in the image to be processed as a target area, and determine an area other than the target area in the image to be processed as a non-target area. Alternatively, when there are a plurality of pressed regions in the image to be processed, then the terminal may take the plurality of pressed regions in the image to be processed as target regions and regions other than the target regions in the image to be processed as non-target regions.
Specifically, when the touch parameter is a closed trajectory formed by a sliding trajectory generated by performing a touch operation on the image to be processed, the terminal may determine an area included in the closed trajectory in the image to be processed as a target area, and determine an area other than the target area in the image to be processed as a non-target area. For example, if a closed trajectory is generated by performing touch operation on an image to be processed through a touch screen, the terminal may use an area included in the closed trajectory as a target area and use an area outside the target area as a non-target area, and further, if multiple closed trajectories are generated by performing touch operation on the image to be processed through the touch screen, the terminal may use a resultant area surrounded by the multiple closed trajectories as the target area,
104. and compressing the target area and the non-target area in the image to be processed according to different compression modes.
In the embodiment of the invention, the terminal can compress the target area and the non-target area in the image to be processed according to different compression modes, and in the prior art, the compression ratio can be understood as the ratio of the size of the image data compressed by the encoder to the size of the original image. For example, the target area is compressed according to a preset first compression ratio, and the non-target area is compressed according to a preset second compression ratio, where the preset first compression ratio is greater than the preset second compression ratio, for example, a user self-photographs an image and wants to send the image to his/her friend, and if the definition of the face area is considered while saving traffic and improving sending efficiency, the head portrait of the user in the image can be used as the target area, and other areas can be used as the non-target area, so that the terminal can compress the target area according to the preset first compression ratio, and the non-target area is compressed according to the preset second compression ratio, so that the target area in the compressed image retains more data, and the non-target area retains less data.
105. And outputting the compressed image to be processed.
In the embodiment of the invention, the terminal can output the compressed image to be processed, and the method in the embodiment is applied to network transmission and can directly send the image to be processed. Specifically, the terminal may synthesize the compressed target region and non-target region using a synthesis technique, and output a synthesized image.
By the embodiment of the invention, the terminal can acquire the image to be processed, acquire the touch parameter generated by performing touch operation on the image to be processed, determine the target area and the non-target area in the image to be processed according to the touch parameter, compress the target area and the non-target area according to different compression modes and output the compressed image to be processed. Therefore, the target area and the non-target area are determined by utilizing the touch operation performed on the image to be processed, different compression is performed on the two parts of areas, the individual requirements of the user can be met, the method can avoid the overall blurring of the image to be processed, the area which the user is interested in can be compressed less, and the area which is not interested in can be compressed more.
It can be understood that, in the embodiment of the present invention, the terminal may further divide the image to be processed into 3 or more than 3 regions, each region may have a compression ratio, the compression ratios of different regions may be the same or different, each region is compressed according to the corresponding compression ratio, and the compressed image is output, so that the personalized requirements of the user may be better satisfied, and the terminal has interestingness.
Please refer to fig. 2, which is a flowchart illustrating a method for compressing an image according to a second embodiment of the present invention. The method for compressing an image described in the present embodiment includes the steps of:
201. and acquiring an image to be processed.
202. And acquiring touch parameters generated by performing touch operation on the image to be processed.
203. And determining a target area and a non-target area in the image to be processed according to the touch parameters.
The detailed description of steps 201 to 203 may refer to steps 101 to 103 of the method for image compression described in fig. 1.
204. And compressing the target area in the image to be processed according to a preset first compression ratio, and compressing the non-target area in the image to be processed according to a preset second compression ratio.
In the embodiment of the present invention, the terminal may compress the target region and the non-target region in different manners, and specifically, may compress the target region in the image to be processed according to a preset first compression ratio, and compress the non-target region in the image to be processed according to a preset second compression ratio. It should be noted that the compression ratio is understood as a ratio of the size of image data compressed by the encoder to the size of the original image. The preset first compression ratio for the target region may be a ratio of a data size of the target region after compression to a data size of the target region before compression, and the second compression ratio for the non-target region may be a ratio of a data size of the non-target region after compression to a data size of the non-target region before compression. For example, if a user wants to ensure that a face region in an image to be processed has higher definition, the face region may be used as a target region, a region outside the face region is used as a non-target region, the face region is set at a higher compression ratio, and a region outside the face region is set at a lower compression ratio.
205. And outputting the compressed image to be processed.
In the embodiment of the invention, the terminal can output the compressed image to be processed, and the method in the embodiment is applied to network transmission and can directly send the image to be processed. Specifically, the terminal may synthesize the compressed target region and non-target region using a synthesis technique, and output a synthesized image.
By the embodiment of the invention, the terminal can acquire the image to be processed, acquire the touch parameter generated by performing touch operation on the image to be processed, determine the target area and the non-target area in the image to be processed according to the touch parameter, compress the target area according to a preset first compression ratio and compress the non-target area according to a preset second compression ratio, and output the compressed image to be processed. Therefore, the target area and the non-target area are determined by utilizing the touch operation performed on the image to be processed, different compression is performed on the two parts of areas, the individual requirements of the user can be met, the method can avoid the overall blurring of the image to be processed, the area which the user is interested in can be compressed less, and the area which is not interested in can be compressed more.
Please refer to fig. 3, which is a flowchart illustrating a method for compressing an image according to a third embodiment of the present invention. The method for compressing an image described in the present embodiment includes the steps of:
301. and acquiring an image to be processed.
302. And acquiring a touch point generated by performing touch operation on the image to be processed.
The detailed description of steps 301 to 302 may refer to steps 101 to 102 of the method for image compression described in fig. 1.
Specifically, the touch points in this embodiment may be the number of fingers of the user pressing the touch screen, which is detected by the terminal, for example, if 3 fingers are used, 3 touch points may be detected, and when the 3 touch points are not on the same straight line, the 3 touch points may be connected to form a triangle, and the triangle may be used as the touch parameter. Similarly, N touch points, where N is an integer greater than or equal to 3, and at least 3 touch points in the N touch points are not on the same straight line, may be sequentially connected, and a closed area obtained after the connection may be used as a touch parameter.
Further optionally, the terminal may obtain two touch points generated by the user performing the touch operation, and obtain coordinates of the two touch points, where abscissa of the coordinates of the two touch points are different from each other, and ordinate of the coordinates of the two touch points are also different from each other, and the target area may be generated according to the coordinates of the two touch points. For example, if the coordinates of the first touch point are (x1, y1), the coordinates of the second touch point are (x2, y2), and x1 is not equal to x2, and y1 is not equal to y2, a closed region may be generated by (x1, y1) and (x2, y2), that is, a closed region may be formed by four lines, that is, x — x1, y — y1, x — x2, and y — y 2. The closed area can be used as a touch parameter.
It should be noted that the touch parameter generated by the touch operation performed on the image to be processed may also be: and the closed track is formed by a sliding track generated by touch operation in the image to be processed. For example, a user performs a touch operation on the touch screen for the image to be processed, and may form a sliding closed trajectory, which may be used as a touch parameter.
Optionally, the touch parameter may also be a closed trajectory composed of a pressing area for pressing the image to be processed and a sliding trajectory generated by performing a touch operation on the image to be processed. For example, when a user presses a certain area in an image to be processed with a finger, the terminal may detect that the pressed area contacted by the finger on the touch screen may be used as a touch parameter, and then, the user performs a touch operation on the touch screen with respect to the image to be processed, may form a sliding closed trajectory, and may use the closed trajectory as the touch parameter. Finally, the pressing area and the closed trajectory can be taken together as a touch parameter.
303. And when the touch parameters are touch points, the number of the touch points is more than or equal to 3, and at least 3 touch points are not on the same line, taking areas obtained after the touch points are sequentially connected as target areas, and determining areas except the target areas in the image to be processed as non-target areas.
In the embodiment of the invention, the terminal can sequentially connect all the touch points, the closed area obtained after connection is used as the target area, and the area outside the target area in the image to be processed is used as the non-target area.
304. And compressing a target area in the image to be processed according to a lossless compression mode and compressing a non-target area in the image to be processed according to a lossy compression mode.
In the embodiment of the invention, the terminal can compress the target area in a lossless compression mode and compress the non-target area in the image to be processed in a lossy compression mode, or the terminal can compress the target area in the lossy compression mode and compress the non-target area in the image to be processed in the lossless compression mode.
305. And outputting the compressed image to be processed.
In the embodiment of the invention, the terminal can output the compressed image to be processed, and the method in the embodiment is applied to network transmission and can directly send the image to be processed. Specifically, the terminal may synthesize the compressed target region and non-target region using a synthesis technique, and output a synthesized image.
By the embodiment of the invention, the terminal can acquire the image to be processed, acquire the touch parameter generated by performing touch operation on the image to be processed, determine the target area and the non-target area in the image to be processed according to the touch parameter, compress the target area in a lossless compression mode, compress the non-target area in a lossy compression mode, and output the compressed image to be processed. Therefore, the target area and the non-target area are determined by utilizing the touch operation performed on the image to be processed, different compression is performed on the two parts of areas, the individual requirements of the user can be met, the method can avoid the overall blurring of the image to be processed, the area which the user is interested in can be compressed less, and the area which is not interested in can be compressed more.
Fig. 4 is a schematic structural diagram of a terminal according to a first embodiment of the present invention. The terminal described in this embodiment includes:
an acquiring unit 401, configured to acquire an image to be processed;
the obtaining unit 401 is further configured to obtain a touch parameter generated by performing a touch operation on the image to be processed;
a determining unit 402, configured to determine a target area and a non-target area in the image to be processed according to the touch parameter acquired by the acquiring unit 401;
a compressing unit 403, configured to compress the target region and the non-target region in the image to be processed, which are determined by the determining unit 402, according to different compression manners;
an output unit 404, configured to output the to-be-processed image compressed by the compression unit 403.
Optionally, the touch parameter is at least one of a pressing area for pressing the image to be processed, a closed trajectory formed by a sliding trajectory generated by performing a touch operation on the image to be processed, and a touch point generated by pressing a touch screen.
Specifically, the touch parameter may be a pressing area for pressing the image to be processed, for example, if the user presses a certain area in the image to be processed with a finger, the pressing area contacted by the terminal, which can detect that the finger touches the touch screen, may be used as the touch parameter.
Alternatively, the touch parameter may be a closed trajectory composed of a sliding trajectory generated by performing a touch operation on the image to be processed. For example, a user performs a touch operation on the touch screen for the image to be processed, and may form a sliding closed trajectory, which may be used as a touch parameter.
Optionally, the touch parameter may also be a closed trajectory composed of a pressing area for pressing the image to be processed and a sliding trajectory generated by performing a touch operation on the image to be processed. For example, when a user presses a certain area in an image to be processed with a finger, the terminal may detect that the pressed area contacted by the finger on the touch screen may be used as a touch parameter, and then, the user performs a touch operation on the touch screen with respect to the image to be processed, may form a sliding closed trajectory, and may use the closed trajectory as the touch parameter. Finally, the pressing area and the closed trajectory can be taken together as a touch parameter.
Optionally, the touch points in this embodiment may be the number of fingers of the user pressing the touch screen, which is detected by the terminal, for example, if 3 fingers are used, 3 touch points may be detected, and when the 3 touch points are not on the same straight line, the 3 touch points may be connected to form a triangle, and the triangle may be used as the touch parameter. Similarly, N touch points, where N is an integer greater than or equal to 3, and at least 3 touch points in the N touch points are not on the same straight line, may be sequentially connected, and a closed area obtained after the connection may be used as a touch parameter.
Optionally, the terminal may obtain two touch points generated by the user performing the touch operation, and obtain coordinates of the two touch points, where abscissa of the coordinates of the two touch points are different from each other, and ordinate of the coordinates of the two touch points are also different from each other, and the target area may be generated according to the coordinates of the two touch points. For example, if the position of the first touch point is (x1, y1), the position of the second touch point is (x2, y2), and x1 is not equal to x2, and y1 is not equal to y2, a closed region may be generated by (x1, y1) and (x2, y2), that is, a closed region may be formed by four lines, that is, x — x1, y — y1, x — x2, and y — y 2. The closed area can be used as a touch parameter.
Optionally, the determining unit 402 is specifically configured to:
determining the pressing area in the image to be processed as a target area, and determining an area except the target area in the image to be processed as a non-target area;
further optionally, the determining unit 402 is specifically configured to:
when the touch parameter is the closed track, determining an area contained in the closed track in the image to be processed as a target area, and determining an area outside the target area in the image to be processed as a non-target area;
further optionally, the determining unit 402 is specifically configured to:
when the number of the touch points is 2, the abscissa and the ordinate of the touch points are different from each other, determining a target area according to the coordinates of the touch points, and determining an area except the target area in the image to be processed as a non-target area;
further optionally, the determining unit 402 is specifically configured to:
and when the number of the touch points is more than or equal to 3 and at least 3 touch points are not on a straight line, taking areas obtained by sequentially connecting the touch points as target areas, and determining areas except the target areas in the image to be processed as non-target areas.
Optionally, the compressing unit 403 is specifically configured to:
and compressing the target area in the image to be processed according to a preset first compression ratio, and compressing the non-target area in the image to be processed according to a preset second compression ratio.
Optionally, the compressing unit 403 is specifically configured to:
compressing a target area in the image to be processed according to a lossless compression mode and compressing a non-target area in the image to be processed according to a lossy compression mode;
further optionally, the compressing unit 403 is specifically configured to:
and compressing a target area in the image to be processed according to a lossy compression mode and compressing a non-target area in the image to be processed according to a lossless compression mode.
The terminal described by the embodiment of the invention can acquire the image to be processed, acquire the touch parameter generated by performing touch operation on the image to be processed, determine the target area and the non-target area in the image to be processed according to the touch parameter, compress the target area and the non-target area according to different compression modes, and output the compressed image to be processed. Therefore, the target area and the non-target area are determined by utilizing the touch operation performed on the image to be processed, different compression is performed on the two parts of areas, the individual requirements of the user can be met, the method can avoid the overall blurring of the image to be processed, the area which the user is interested in can be compressed less, and the area which is not interested in can be compressed more.
It can be understood that, in the embodiment of the present invention, the terminal may further divide the image to be processed into 3 or more than 3 regions, each region may have a compression ratio, the compression ratios of different regions may be the same or different, each region is compressed according to the corresponding compression ratio, and the compressed image is output, so that the personalized requirements of the user may be better satisfied, and the terminal has interestingness.
Fig. 5 is a schematic structural diagram of a terminal according to a second embodiment of the present invention. The terminal described in this embodiment includes: at least one input device 1000; at least one output device 2000; at least one processor 3000, e.g., a CPU; and a memory 4000, the input device 1000, the output device 2000, the processor 3000, and the memory 4000 being connected by a bus 5000.
The input device 1000 may be a touch panel, a physical button, or a mouse.
The output device 2000 may be a display screen.
The memory 4000 may be a high-speed RAM memory or a non-volatile memory (e.g., a magnetic disk memory). The memory 4000 is used for storing a set of program codes, and the input device 1000, the output device 2000 and the processor 3000 are used for calling the program codes stored in the memory 4000 to execute the following operations:
the input device 1000 described above, configured to:
acquiring an image to be processed;
acquiring a touch parameter generated by performing touch operation on the image to be processed;
determining a target area and a non-target area in the image to be processed according to the touch parameter;
compressing a target area and a non-target area in the image to be processed according to different compression modes;
and outputting the compressed image to be processed.
In some possible embodiments, the touch parameter is at least one of a pressing area for pressing the image to be processed, a closed trajectory composed of a sliding trajectory generated by performing a touch operation on the image to be processed, and a touch point generated by pressing a touch screen.
Optionally, the processor 3000 determines a target area and a non-target area in the image to be processed according to the touch parameter, including:
determining the pressing area in the image to be processed as a target area, and determining an area except the target area in the image to be processed as a non-target area;
optionally, the processor 3000 determines a target area and a non-target area in the image to be processed according to the touch parameter, including:
determining a region contained in the closed track in the image to be processed as a target region, and determining a region outside the target region in the image to be processed as a non-target region.
Optionally, the processor 3000 compresses the target region and the non-specific region in the image to be processed according to different compression manners, including:
and compressing the target area in the image to be processed according to a preset first compression ratio, and compressing the non-target area in the image to be processed according to a preset second compression ratio.
Optionally, the processor 3000 compresses the target region and the non-specific region in the image to be processed according to different compression manners, including:
compressing a target area in the image to be processed according to a lossless compression mode and compressing a non-target area in the image to be processed according to a lossy compression mode;
optionally, the processor 3000 compresses the target region and the non-specific region in the image to be processed according to different compression manners, including:
and compressing a target area in the image to be processed according to a lossy compression mode and compressing a non-target area in the image to be processed according to a lossless compression mode.
In a specific implementation, the input device 1000, the output device 2000, and the processor 3000 described in this embodiment of the present invention may execute the implementation manners described in the first embodiment, the second embodiment, and the third embodiment of the method for image compression provided in this embodiment of the present invention, and may also execute the implementation manner of the terminal described in the first embodiment of the terminal provided in this embodiment of the present invention, which is not described herein again.
It should be noted that, for simplicity of description, the above-mentioned method embodiments are described as a series of acts or combination of acts, but those skilled in the art will recognize that the present invention is not limited by the order of acts, as some steps may occur in other orders or concurrently in accordance with the invention. Further, those skilled in the art should also appreciate that the embodiments described in the specification are preferred embodiments and that the acts and modules referred to are not necessarily required by the invention.
In the foregoing embodiments, the descriptions of the respective embodiments have respective emphasis, and for parts that are not described in detail in a certain embodiment, reference may be made to related descriptions of other embodiments.
In the embodiments provided in the present application, it should be understood that the disclosed apparatus may be implemented in other manners. For example, the above-described embodiments of the apparatus are merely illustrative, and for example, the division of the units is only one type of division of logical functions, and there may be other divisions when actually implementing, for example, a plurality of units or components may be combined or may be integrated into another system, or some features may be omitted, or not implemented. In addition, the shown or discussed mutual coupling or direct coupling or communication connection may be an indirect coupling or communication connection of some interfaces, devices or units, and may be an electric or other form.
The units described as separate parts may or may not be physically separate, and parts displayed as units may or may not be physical units, may be located in one place, or may be distributed on a plurality of network units. Some or all of the units can be selected according to actual needs to achieve the purpose of the solution of the embodiment.
In addition, functional units in the embodiments of the present invention may be integrated into one processing unit, or each unit may exist alone physically, or two or more units are integrated into one unit. The integrated unit can be realized in a form of hardware, and can also be realized in a form of a software functional unit.
The integrated unit, if implemented in the form of a software functional unit and sold or used as a stand-alone product, may be stored in a computer readable storage medium. Based on such understanding, the technical solution of the present invention may be embodied in the form of a software product, which is stored in a storage medium and includes instructions for causing a computer device (which may be a personal computer, a server, or a network device) to execute all or part of the steps of the method according to the embodiments of the present invention. And the aforementioned storage medium includes: a U-disk, a Read-only memory (ROM), a Random Access Memory (RAM), a removable hard disk, a magnetic or optical disk, and other various media capable of storing program codes.
The above-mentioned embodiments are only used for illustrating the technical solutions of the present invention, and not for limiting the same; although the present invention has been described in detail with reference to the foregoing embodiments, it will be understood by those of ordinary skill in the art that: the technical solutions described in the foregoing embodiments may still be modified, or some technical features may be equivalently replaced; and the modifications or the substitutions do not make the essence of the corresponding technical solutions depart from the scope of the technical solutions of the embodiments of the present invention.

Claims (11)

1. A method of image compression, comprising:
acquiring an image to be processed;
acquiring a touch parameter generated by performing touch operation on the image to be processed;
determining a target area and a non-target area in the image to be processed according to the touch parameter;
compressing a target area and a non-target area in the image to be processed according to different compression modes;
and outputting the compressed image to be processed.
2. The method according to claim 1, wherein the touch parameter is at least one of a pressing area for pressing the image to be processed, a closed track formed by a sliding track generated by performing a touch operation on the image to be processed, and a touch point generated by pressing a touch screen.
3. The method of claim 2, wherein the determining the target area and the non-target area in the image to be processed according to the touch parameter comprises:
when the touch parameter is the pressing area, determining the pressing area in the image to be processed as a target area, and determining an area except the target area in the image to be processed as a non-target area;
or,
when the touch parameter is the closed track, determining an area contained in the closed track in the image to be processed as a target area, and determining an area outside the target area in the image to be processed as a non-target area;
or,
when the number of the touch points is 2, the abscissa and the ordinate of the touch points are different from each other, determining a target area according to the coordinates of the touch points, and determining an area except the target area in the image to be processed as a non-target area;
or,
and when the number of the touch points is more than or equal to 3 and at least 3 touch points are not on a straight line, taking areas obtained by sequentially connecting the touch points as target areas, and determining areas except the target areas in the image to be processed as non-target areas.
4. The method according to any one of claims 1 to 3, wherein compressing the target region and the non-specific region in the image to be processed according to different compression modes comprises:
and compressing the target area in the image to be processed according to a preset first compression ratio, and compressing the non-target area in the image to be processed according to a preset second compression ratio.
5. The method according to any one of claims 1 to 3, wherein compressing the target region and the non-specific region in the image to be processed according to different compression modes comprises:
compressing a target area in the image to be processed according to a lossless compression mode and compressing a non-target area in the image to be processed according to a lossy compression mode;
or,
and compressing a target area in the image to be processed according to a lossy compression mode and compressing a non-target area in the image to be processed according to a lossless compression mode.
6. A terminal, comprising:
the acquisition unit is used for acquiring an image to be processed;
the acquisition unit is further used for acquiring touch parameters generated by performing touch operation on the image to be processed;
the determining unit is used for determining a target area and a non-target area in the image to be processed according to the touch parameters acquired by the acquiring unit;
the compression unit is used for compressing the target area and the non-target area in the image to be processed, which are determined by the determination unit, according to different compression modes;
and the output unit is used for outputting the image to be processed compressed by the compression unit.
7. The terminal according to claim 6, wherein the touch parameter is at least one of a pressing area for pressing the image to be processed, a closed track formed by a sliding track generated by performing a touch operation on the image to be processed, and a touch point generated by pressing a touch screen.
8. The terminal according to claim 7, wherein the determining unit is specifically configured to:
when the touch parameter is the pressing area, determining the pressing area in the image to be processed as a target area, and determining an area except the target area in the image to be processed as a non-target area;
or,
when the touch parameter is the closed track, determining an area contained in the closed track in the image to be processed as a target area, and determining an area outside the target area in the image to be processed as a non-target area;
or,
when the number of the touch points is 2, the abscissa and the ordinate of the touch points are different from each other, determining a target area according to the coordinates of the touch points, and determining an area except the target area in the image to be processed as a non-target area;
or,
and when the number of the touch points is more than or equal to 3 and at least 3 touch points are not on a straight line, taking areas obtained by sequentially connecting the touch points as target areas, and determining areas except the target areas in the image to be processed as non-target areas.
9. The terminal according to any of claims 6 to 8, wherein the compression unit is specifically configured to:
and compressing the target area in the image to be processed according to a preset first compression ratio, and compressing the non-target area in the image to be processed according to a preset second compression ratio.
10. The terminal according to any of claims 6 to 8, wherein the compression unit is specifically configured to:
compressing a target area in the image to be processed according to a lossless compression mode and compressing a non-target area in the image to be processed according to a lossy compression mode;
or,
and compressing a target area in the image to be processed according to a lossy compression mode and compressing a non-target area in the image to be processed according to a lossless compression mode.
11. A terminal, comprising:
a memory storing executable program code;
a processor coupled with the memory;
the processor calls the executable program code stored in the memory to perform the method of any one of claims 1 to 5.
CN201610066454.8A 2016-01-29 2016-01-29 Image compression method, and terminal Pending CN105721872A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201610066454.8A CN105721872A (en) 2016-01-29 2016-01-29 Image compression method, and terminal

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201610066454.8A CN105721872A (en) 2016-01-29 2016-01-29 Image compression method, and terminal

Publications (1)

Publication Number Publication Date
CN105721872A true CN105721872A (en) 2016-06-29

Family

ID=56155346

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201610066454.8A Pending CN105721872A (en) 2016-01-29 2016-01-29 Image compression method, and terminal

Country Status (1)

Country Link
CN (1) CN105721872A (en)

Cited By (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN107948650A (en) * 2017-12-25 2018-04-20 横琴国际知识产权交易中心有限公司 A kind of method for video coding and device
CN111031325A (en) * 2019-10-28 2020-04-17 西安万像电子科技有限公司 Data processing method and system
CN111491169A (en) * 2020-04-22 2020-08-04 湖南国科微电子股份有限公司 Digital image compression method, device, equipment and medium
CN112352215A (en) * 2019-01-24 2021-02-09 华为技术有限公司 Image sharing method and mobile device
WO2024055676A1 (en) * 2022-09-15 2024-03-21 深圳Tcl新技术有限公司 Image compression method and apparatus, computer device, and computer readable storage medium

Citations (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN1678075A (en) * 2004-04-02 2005-10-05 索尼公司 Image coding method, imaging apparatus, and computer program
CN103096045A (en) * 2011-10-28 2013-05-08 宏碁股份有限公司 Method for adjusting video image compression through gesture
WO2014000238A1 (en) * 2012-06-28 2014-01-03 宇龙计算机通信科技(深圳)有限公司 Terminal and video image compression method
CN104754340A (en) * 2015-03-09 2015-07-01 南京航空航天大学 Reconnaissance image compression method for unmanned aerial vehicle
CN104778007A (en) * 2015-04-08 2015-07-15 魅族科技(中国)有限公司 Screen capturing method and screen capturing device
US20150365683A1 (en) * 2013-03-18 2015-12-17 Vega Grieshaber Kg Method for the compressed storage of graphical data

Patent Citations (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN1678075A (en) * 2004-04-02 2005-10-05 索尼公司 Image coding method, imaging apparatus, and computer program
CN103096045A (en) * 2011-10-28 2013-05-08 宏碁股份有限公司 Method for adjusting video image compression through gesture
WO2014000238A1 (en) * 2012-06-28 2014-01-03 宇龙计算机通信科技(深圳)有限公司 Terminal and video image compression method
US20150365683A1 (en) * 2013-03-18 2015-12-17 Vega Grieshaber Kg Method for the compressed storage of graphical data
CN104754340A (en) * 2015-03-09 2015-07-01 南京航空航天大学 Reconnaissance image compression method for unmanned aerial vehicle
CN104778007A (en) * 2015-04-08 2015-07-15 魅族科技(中国)有限公司 Screen capturing method and screen capturing device

Cited By (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN107948650A (en) * 2017-12-25 2018-04-20 横琴国际知识产权交易中心有限公司 A kind of method for video coding and device
CN112352215A (en) * 2019-01-24 2021-02-09 华为技术有限公司 Image sharing method and mobile device
US11695726B2 (en) 2019-01-24 2023-07-04 Huawei Technologies Co., Ltd. Image sharing method and mobile device
CN111031325A (en) * 2019-10-28 2020-04-17 西安万像电子科技有限公司 Data processing method and system
CN111491169A (en) * 2020-04-22 2020-08-04 湖南国科微电子股份有限公司 Digital image compression method, device, equipment and medium
WO2024055676A1 (en) * 2022-09-15 2024-03-21 深圳Tcl新技术有限公司 Image compression method and apparatus, computer device, and computer readable storage medium

Similar Documents

Publication Publication Date Title
CN105721872A (en) Image compression method, and terminal
CN103475572B (en) Method, device and system for sending multiple pictures in instant messaging application
CN105744292A (en) Video data processing method and device
KR101620933B1 (en) Method and apparatus for providing a mechanism for gesture recognition
CN110288710B (en) Three-dimensional map processing method and device and terminal equipment
CN112770059B (en) Photographing method and device and electronic equipment
CN109145970B (en) Image-based question and answer processing method and device, electronic equipment and storage medium
CN108763350B (en) Text data processing method and device, storage medium and terminal
EP4191513A1 (en) Image processing method and apparatus, device and storage medium
CN112703534B (en) Image processing method and related product
CN105554430A (en) Video call method, system and device
CN112351327A (en) Face image processing method and device, terminal and storage medium
CN111935442A (en) Information display method and device and electronic equipment
TW201926968A (en) Program and information processing method and information processing device capable of easily changing choice of content to be transmitted
CN106775370A (en) The Zoom method and device of picture
CN107705275B (en) Photographing method and mobile terminal
CN105678696B (en) A kind of information processing method and electronic equipment
CN105022480A (en) Input method and terminal
CN106326476B (en) Information processing method and device
CN107733874A (en) Information processing method, device, computer equipment and storage medium
CN109089040B (en) Image processing method, image processing device and terminal equipment
CN108549702B (en) Method for cleaning picture library of mobile terminal and mobile terminal
CN106502496B (en) Window switching method and device
CN111325656B (en) Image processing method, image processing device and terminal equipment
CN105100826B (en) Image processing method, apparatus and system

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: 20160629