Disclosure of Invention
The embodiment of the invention provides an information processing method, which comprises the following steps: acquiring depth information of a first image;
detecting a first region in the first image, the first region being a portion of the first image;
changing depth information of the first region;
and fusing the first area with the second area after the depth information is changed to obtain a second image, wherein the second area is a part of the first image except the first area, and the display effect of the first area in the second image is different from that of the first area in the first image.
In the foregoing solution, the acquiring depth information of a first image and detecting a first region in the first image includes:
acquiring depth information of pixel points of the first image;
and determining a pixel area formed by pixel points with depth values smaller than a preset first threshold value as the first area.
In the foregoing solution, the determining that the image composed of the pixels whose depth values are smaller than the preset first threshold is the first area includes:
acquiring a pixel area formed by pixel points of which the actual distance values are smaller than a preset first threshold;
and performing transparency calculation on the edge of the pixel area according to the color information.
In the foregoing solution, the determining that the image composed of the pixels whose actual distance values are smaller than the preset first threshold is the first region includes:
selecting a pixel area formed by pixel points meeting a preset identification from the pixel points of which the actual distance values are smaller than a preset first threshold value;
and performing transparency calculation on the edge of the pixel area according to the color information.
In the above solution, the displaying effect of the first region in the second image is different from the displaying effect of the first region in the first image, and the method includes:
when the depth information of the first region becomes smaller, displaying the first region in the second image with enlargement along the direction in which the depth information changes; or
When the depth information of the first region becomes large, the first region is displayed in a reduced size in the second image along the direction in which the depth information changes.
An embodiment of the present invention further provides an information processing apparatus, where the apparatus includes: an acquisition unit, a detection unit, a change unit, and a fusion unit; wherein,
the acquiring unit is used for acquiring the depth information of the first image;
the detection unit is used for detecting a first area in the first image, wherein the first area is a part of the first image;
the changing unit is used for changing the depth information of the first area;
the fusion unit is configured to fuse a first region and a second region after the depth information is changed to obtain a second image, where the second region is a part of the first image except the first region, and a display effect of the first region in the second image is different from a display effect of the first region in the first image.
In the above scheme, the obtaining unit is specifically configured to obtain depth information of a pixel point of the first image;
the detection unit is specifically configured to determine a pixel region composed of pixels with depth values smaller than a preset first threshold as the first region.
In the above scheme, the detection unit is specifically configured to acquire a pixel region formed by pixel points of which the actual distance value is smaller than a preset first threshold;
and performing transparency calculation on the edge of the pixel area according to the color information.
In the above scheme, the detection unit is specifically configured to select a pixel region formed by pixels meeting a preset identifier from among the pixels whose actual distance values are smaller than a preset first threshold;
and performing transparency calculation on the edge of the pixel area according to the color information.
In the embodiment of the invention, the depth information of the first image is acquired, the first area in the first image is detected, the depth information of the first area is changed, the display effect of the first area in the first image is changed based on the change of the depth information of the first area, the first area in the first image is independently zoomed, and the three-dimensional information of the first image is more embodied.
Detailed Description
The invention is described in further detail below with reference to the figures and specific examples.
An information processing method according to an embodiment of the present invention is applied to an electronic device, and a basic processing flow of the information processing method, as shown in fig. 1, includes the following steps:
step 101, obtaining depth information of a first image;
specifically, the electronic equipment acquires depth information of a pixel point of a first image;
here, the first image may be a 3-dimensional image, the depth information may be present in the form of a normalized data matrix, the depth information has a value range of [0, 1.0], an image region corresponding to a pixel point representing the depth information is closest to an observer when the value of the depth information is 0, and the image region corresponding to the pixel point representing the depth information is farthest from the observer when the value of the depth information is 1.0.
Step 102, detecting a first area in the first image, wherein the first area is a part of the first image;
specifically, the electronic device determines a pixel region composed of pixel points with depth values smaller than a preset first threshold as the first region;
wherein, the determining that the image composed of the pixels with the depth values smaller than the preset first threshold is the first area includes: selecting a pixel area formed by pixel points of which the actual distance values are smaller than a preset first threshold value, and carrying out transparency calculation on the edge of the pixel area according to color information; or selecting a pixel area formed by pixel points meeting a preset identification from the pixel points with the actual distance value smaller than a preset first threshold; performing transparency calculation on the edge of the pixel area according to color information;
here, the first threshold is a preset depth information value, and a value range of the first threshold is (0, 1.0); the first threshold may also be an actual distance from the pixel point to an observer, and when the first threshold is the actual distance from the pixel point to the observer, the actual distance needs to be converted into depth information of the corresponding pixel point according to a preset calibration; the preset mark refers to the preset edge shape of the first area, such as a circle, a square, a triangle and the like;
in an embodiment of the present invention, the transparency calculation on the edge of the pixel region according to the color information is performed to separate the first region from the first image, and a remaining portion of the first region after the first region is separated from the first image is a second region.
Step 103, changing the depth information of the first area;
specifically, the change of the depth information of the first area is realized by sliding in an arbitrary direction with the initial position of the first area as a direction starting point.
Step 104, fusing the first region and the second region after the depth information is changed to obtain a second image;
here, after the first region after the change of the depth information is fused with the second region, the display effect of the first region in the second image is different from the display effect of the first region in the first image;
specifically, when the depth information of the first region becomes small, the first region is displayed in the second image with enlargement along the direction in which the depth information changes; or when the depth information of the first region becomes larger, displaying the first region in the second image by reducing the depth information in the direction in which the depth information changes.
According to the embodiment of the invention, after the depth information of the partial area of the image is changed through one-hand operation, the partial area of the image can be independently reduced or enlarged, and the three-dimensional information of the image can be simply and vividly embodied.
Method embodiment one
An information processing method according to an embodiment of the present invention is applied to an electronic device, and a detailed processing flow of the information processing method, as shown in fig. 2, includes the following steps:
step 201, the electronic device obtains depth information of a pixel point of a first image;
the detailed content of the schematic diagram of the first image, as shown in fig. 3, refers to step 101.
Step 202, determining a pixel area formed by pixel points with depth values smaller than a preset first threshold value in the first image as the first area;
in this embodiment of the present invention, the preset first threshold is 0.5, so that the electronic device selects a pixel region composed of pixels with depth values within a range of (0, 0.5), and performs transparency calculation on an edge of the pixel region according to color information to determine the first region, so that the first region is separated from the image, where a schematic diagram of the first region is shown in fig. 4.
Step 203, reducing the depth information of the first area;
in the embodiment of the present invention, the depth information of the first area is initial depth information of the first area;
specifically, reducing the depth information of the first region includes the following steps:
step a, receiving a first operation instruction;
here, the first operation command is to click the first area, slide the first area in an arbitrary direction, with the clicked location as a direction start point and the slide point as a direction end point, thereby forming a direction vector.
And b, analyzing the first operation instruction, and amplifying and displaying the first area along the direction of the direction vector.
Step 204, fusing the first region and the second region with the reduced depth information to obtain a second image;
here, the second region is a portion of the first image other than the first region, and the second image is a schematic diagram of the second image, as shown in fig. 5, the first region is displayed in the second image in an enlarged manner, and the display effect of the second region in the second image is not changed.
According to the embodiment of the invention, after the depth information of the first area of the image is reduced through one-hand operation, the independent amplification of the first area can be realized, and compared with the prior art that the image can be amplified or reduced only in a whole manner, the embodiment of the invention can embody the three-dimensional information of the image more simply and vividly.
Method embodiment two
An information processing method according to an embodiment of the present invention is applied to an electronic device, and a detailed processing flow of the information processing method, as shown in fig. 6, includes the following steps:
301, the electronic device acquires depth information of a pixel point of a first image;
referring to step 101, the schematic diagram of the first image is shown in fig. 5.
Step 302, determining a pixel area composed of pixel points with depth values smaller than a preset first threshold value in the first image as the first area;
in the embodiment of the present invention, the preset first threshold is an actual distance from a pixel point of the first image to an observer, where the first threshold is 3, and the actual distance of the first image is converted into depth information of a corresponding pixel point according to a pre-calibrated correspondence between the actual distance of the first image and the depth information of the pixel point; here, the depth information of the pixel point corresponding to the actual distance of 3 is 0.3, and therefore, the electronic device selects a pixel region composed of pixel points whose depth values are within the range of (0, 0.3), and performs transparency calculation on the edge of the pixel region according to the color information to determine the first region, so that the first region is separated from the image, which is schematically illustrated in fig. 4.
Step 303, increasing the depth information of the first area;
specifically, increasing the depth information of the first region includes the following steps:
step c, receiving touch operation;
here, the touch operation is to press the first area, slide the first area in any direction, take a clicked location as a direction starting point, and take a slide point as a direction ending point, so as to form a direction vector;
when the first area is pressed, the area of the first area is increased along with the increase of the pressing pressure; as the pressing pressure decreases, the area of the first region also decreases.
And d, analyzing the touch operation, and displaying the first area in a reduced mode along the direction vector direction.
Step 304, fusing the first region and the second region after the depth information is increased to obtain a second image;
here, the second region is a portion of the first image other than the first region, and the second image is a schematic view of the second image, as shown in fig. 7, the first region is displayed in the second image in a reduced size, and the display effect of the second region in the second image is not changed.
According to the embodiment of the invention, after the depth information of the first area of the image is increased through one-hand operation, the first area of the image can be independently reduced, and the three-dimensional information of the image can be simply and vividly embodied.
Method embodiment three
The third information processing method of the embodiment of the present invention is applied to an electronic device, and a detailed processing flow of the information processing method, as shown in fig. 8, includes the following steps:
step 401, the electronic device obtains depth information of a pixel point of a first image;
the detailed content of the schematic diagram of the first image, as shown in fig. 3, refers to step 101.
Step 402, determining a pixel area satisfying a preset identifier among pixel points with depth values smaller than a preset first threshold value in the first image as the first area;
here, the preset mark is a rectangle with a fixed size;
in this embodiment of the present invention, the preset first threshold is 0.5, so that the electronic device selects a pixel region composed of pixels with a fixed size from among the pixels with depth values within a range of (0, 0.5), and performs transparency calculation on an edge of the pixel region according to color information to determine the first region, so that the first region is separated from the image, where a schematic diagram of the first region is shown in fig. 9.
Step 403, reducing the depth information of the first area;
in the embodiment of the present invention, the depth information of the first area is initial depth information of the first area;
specifically, the first region is selected, the first region is slid in an arbitrary direction, a sliding point is used as a direction end point, a direction vector is formed, and the first region is enlarged along the direction of the direction vector.
Step 404, fusing the first region and the second region after the depth information is reduced to obtain a second image;
here, the second region is a portion of the first image other than the first region, and the second image is a schematic diagram of the second image, as shown in fig. 10, the first region is displayed in the second image in an enlarged manner, and the display effect of the second region in the second image is not changed.
According to the embodiment of the invention, after the depth information of the first area of the image is reduced through one-hand operation, the first area of the image can be independently amplified, and the three-dimensional information of the image can be simply and vividly embodied.
Method example four
A fourth information processing method according to an embodiment of the present invention is applied to an electronic device, and a detailed processing flow of the information processing method, as shown in fig. 11, includes the following steps:
step 501, the electronic equipment acquires depth information of a pixel point of a first image;
referring to step 101, a schematic diagram of the first image is shown in fig. 10.
Step 502, determining a pixel area formed by pixel points meeting a preset identification in pixel points with depth values smaller than a preset first threshold value in the first image as the first area;
here, the preset mark is a rectangle with a fixed size;
in the embodiment of the present invention, the preset first threshold is an actual distance from a pixel point of the first image to an observer, where the first threshold is 3, and the actual distance of the first image is converted into depth information of a corresponding pixel point according to a pre-calibrated correspondence between the actual distance of the first image and the depth information of the pixel point; here, the depth information of the pixel point corresponding to the actual distance of 3 is 0.3, and therefore, the electronic device selects a pixel region composed of rectangular pixel points with a fixed size among the pixel points with the depth value within the range of (0, 0.3), and performs transparency calculation on the edge of the pixel region according to the color information to determine the first region, so that the first region is separated from the image, which is schematically illustrated in fig. 9.
Step 503, increasing the depth information of the first area;
specifically, the first region is selected, the first region is slid in a direction away from the observer, the sliding point serves as a direction end point, a direction vector is formed, and the first region decreases along the direction of the direction vector.
Step 504, fusing the first region and the second region after the depth information is increased to obtain a second image;
here, the second region is a portion of the first image other than the first region, and the second image is a schematic view of the second image, as shown in fig. 12, the first region is displayed in the second image in a reduced size, and the display effect of the second region in the second image is not changed.
According to the embodiment of the invention, after the depth information of the first area of the image is increased through one-hand operation, the first area can be independently reduced, and the three-dimensional information of the image can be simply and vividly embodied.
Device embodiment
As shown in fig. 13, the composition structure of the information processing apparatus 1 according to the embodiment of the present invention includes: an acquisition unit 11, a detection unit 12, a change unit 13, and a fusion unit 14; wherein,
the acquiring unit 11 is configured to acquire depth information of the first image;
the detecting unit 12 is configured to detect a first region in the first image, where the first region is a part of the first image;
the changing unit 13 is configured to change the depth information of the first area;
the fusion unit 14 is configured to fuse the first region with the changed depth information with a second region to obtain a second image, where the second region is a part of the first image other than the first region, and a display effect of the first region in the second image is different from a display effect of the first region in the first image.
The detection unit 12 is specifically configured to determine a pixel area formed by pixel points whose depth values are smaller than a preset first threshold as the first area.
Here, determining, as the first area, a pixel area composed of pixel points whose depth values are smaller than a preset first threshold includes: and selecting a pixel area formed by the pixel points of which the actual distance values are smaller than a preset first threshold value. Performing transparency calculation on the edge of the pixel area according to color information; or,
selecting a pixel area formed by pixel points meeting a preset identification from the pixel points with the actual distance value smaller than a preset first threshold, and performing transparency calculation on the edge of the pixel area according to color information.
The display effect of the first area in the second image is different from the display effect of the first area in the first image, and the method comprises the following steps:
when the depth information of the first region becomes smaller, displaying the first region in the second image with enlargement along the direction in which the depth information changes; or,
when the depth information of the first region becomes large, the first region is displayed in a reduced size in the second image along the direction in which the depth information changes.
In this embodiment of the present invention, the first image may be a 3-dimensional image, the depth information may exist in the form of a normalized data matrix, a value range of the depth information is [0, 1.0], when a value of the depth information is 0, an image area corresponding to a pixel point representing the depth information is closest to an observer, and when the value of the depth information is 1.0, an image area corresponding to a pixel point representing the depth information is farthest from the observer.
In the embodiment of the present invention, the first threshold is a preset depth information value, and a value range of the first threshold is (0, 1.0); the first threshold may also be an actual distance from the pixel point to an observer, and when the first threshold is the actual distance from the pixel point to the observer, the actual distance needs to be converted into depth information of the corresponding pixel point according to a preset calibration; the preset mark refers to a preset edge shape of the first area, such as a circle, a square, a triangle, and the like.
In an embodiment of the present invention, the transparency calculation on the edge of the pixel region according to the color information is performed to separate the first region from the first image, and a remaining portion of the first region after the first region is separated from the first image is a second region.
In the embodiment of the present invention, a specific implementation manner of changing the depth information of the first region is as follows: and sliding in any direction by taking the initial position of the first area as a direction starting point so as to change the depth information of the first area.
According to the embodiment of the invention, after the depth information of the partial area of the image is changed through one-hand operation, the partial area of the image can be independently reduced or enlarged, and the three-dimensional information of the image can be simply and vividly embodied.
The functions realized by the information processing device in the embodiment of the invention can be realized by various electronic devices such as a mobile phone, a tablet computer and the like.
Those of ordinary skill in the art will understand that: all or part of the steps for implementing the method embodiments may be implemented by hardware related to program instructions, where the program may be stored in a computer readable storage unit, and when executed, the program performs the steps including the method embodiments; the memory cell includes: a mobile storage device, a Read-Only Memory (ROM), a Random Access Memory (RAM), a magnetic disk or an optical disk, and other various media capable of storing program codes.
Alternatively, the integrated unit of the present invention may be stored in a computer-readable storage unit if it is implemented in the form of a software functional module and sold or used as a separate product. Based on such understanding, the technical solutions of the embodiments of the present invention may be essentially implemented or a part contributing to the prior art may be embodied in the form of a software product, which is stored in a storage unit and includes several instructions for enabling a computer device (which may be a personal computer, a server, or a network device) to execute all or part of the methods described in the embodiments of the present invention. The memory cell includes: a removable storage device, a ROM, a RAM, a magnetic or optical disk, or various other media that can store program code.
The above description is only for the specific embodiments of the present invention, but the scope of the present invention is not limited thereto, and any person skilled in the art can easily conceive of the changes or substitutions within the technical scope of the present invention, and all the changes or substitutions should be covered within the scope of the present invention. Therefore, the protection scope of the present invention shall be subject to the protection scope of the appended claims.