CN111988520B - Picture switching method and device, electronic equipment and storage medium - Google Patents

Picture switching method and device, electronic equipment and storage medium Download PDF

Info

Publication number
CN111988520B
CN111988520B CN202010647362.5A CN202010647362A CN111988520B CN 111988520 B CN111988520 B CN 111988520B CN 202010647362 A CN202010647362 A CN 202010647362A CN 111988520 B CN111988520 B CN 111988520B
Authority
CN
China
Prior art keywords
pixel point
moment
identification information
picture
panoramic picture
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
CN202010647362.5A
Other languages
Chinese (zh)
Other versions
CN111988520A (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.)
Anhui Wenxiang Technology Co ltd
Original Assignee
Anhui Wenxiang Technology Co ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Anhui Wenxiang Technology Co ltd filed Critical Anhui Wenxiang Technology Co ltd
Priority to CN202010647362.5A priority Critical patent/CN111988520B/en
Publication of CN111988520A publication Critical patent/CN111988520A/en
Application granted granted Critical
Publication of CN111988520B publication Critical patent/CN111988520B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Classifications

    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04NPICTORIAL COMMUNICATION, e.g. TELEVISION
    • H04N23/00Cameras or camera modules comprising electronic image sensors; Control thereof
    • H04N23/60Control of cameras or camera modules
    • H04N23/61Control of cameras or camera modules based on recognised objects
    • H04N23/611Control of cameras or camera modules based on recognised objects where the recognised objects include parts of the human body
    • GPHYSICS
    • G09EDUCATION; CRYPTOGRAPHY; DISPLAY; ADVERTISING; SEALS
    • G09BEDUCATIONAL OR DEMONSTRATION APPLIANCES; APPLIANCES FOR TEACHING, OR COMMUNICATING WITH, THE BLIND, DEAF OR MUTE; MODELS; PLANETARIA; GLOBES; MAPS; DIAGRAMS
    • G09B5/00Electrically-operated educational appliances
    • G09B5/06Electrically-operated educational appliances with both visual and audible presentation of the material to be studied
    • G09B5/065Combinations of audio and video presentations, e.g. videotapes, videodiscs, television systems
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04NPICTORIAL COMMUNICATION, e.g. TELEVISION
    • H04N23/00Cameras or camera modules comprising electronic image sensors; Control thereof
    • H04N23/60Control of cameras or camera modules
    • H04N23/667Camera operation mode switching, e.g. between still and video, sport and normal or high- and low-resolution modes
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04NPICTORIAL COMMUNICATION, e.g. TELEVISION
    • H04N23/00Cameras or camera modules comprising electronic image sensors; Control thereof
    • H04N23/60Control of cameras or camera modules
    • H04N23/698Control of cameras or camera modules for achieving an enlarged field of view, e.g. panoramic image capture
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04NPICTORIAL COMMUNICATION, e.g. TELEVISION
    • H04N5/00Details of television systems
    • H04N5/76Television signal recording

Landscapes

  • Engineering & Computer Science (AREA)
  • Multimedia (AREA)
  • Signal Processing (AREA)
  • Business, Economics & Management (AREA)
  • Physics & Mathematics (AREA)
  • Educational Administration (AREA)
  • Educational Technology (AREA)
  • General Physics & Mathematics (AREA)
  • Theoretical Computer Science (AREA)
  • Studio Devices (AREA)

Abstract

The invention discloses a picture switching method, a picture switching device, electronic equipment and a storage medium, wherein the picture switching method comprises the following steps: the method comprises the steps of obtaining a panoramic picture at the previous moment and a close-up picture at the previous moment, obtaining the panoramic picture at the current moment, determining pixel points which are changed when the current moment is compared with the previous moment by utilizing the panoramic picture at the previous moment and the panoramic picture at the current moment, and generating the close-up picture at the current moment by utilizing the close-up picture at the previous moment and the pixel points which are changed when the current moment is compared with the previous moment. Compared with the prior art that all data frames of each close-up picture are intercepted and then copied, the embodiment of the invention locates and analyzes the pixel point area with only picture change, and only the change pixel point is switched from the panoramic picture to the close-up picture, so that the consumption of memory resources is low.

Description

Picture switching method and device, electronic equipment and storage medium
Technical Field
The invention relates to the technical field of video processing, in particular to a picture switching method, a picture switching device, electronic equipment and a storage medium.
Background
Most of the recording cameras in the market adopt single-path picture recording and broadcasting, for example, when 4 scene pictures of 'teacher close-up', 'teacher panorama', 'student close-up', 'student panorama' are required, 4 cameras are required to respectively complete recording and broadcasting of 'teacher close-up', 'teacher panorama', 'student close-up', 'student panorama'.
The electronic cloud mirror is a device which intercepts a picture with a fixed size from a large picture as a close-up picture so as to generate two or more paths of videos. FIG. 1 is a schematic diagram of a prior art close-up visual generated from a panoramic visual. However, when the electronic cloud mirror generates a close-up picture, the close-up picture is continuously captured from the panoramic picture for updating, when the close-up picture changes the starting position and the ending position of the captured picture along the X direction or the Y direction, the effect similar to the movement of a pan-tilt is realized, the close-up picture is changed, a memory and a pixel value data block related to a color space move in the memory and the memory is frequently operated, when the memory consumption is too large, excessive CPU resources and threads are occupied when a code is executed, and not only is a picture card or a frame loss caused, but also the picture is jittered in vision (the frame rate is insufficient); and frequent memory thrashing can cause garbage collection to run frequently.
Disclosure of Invention
In view of this, embodiments of the present invention provide a method and an apparatus for switching pictures, an electronic device, and a storage medium, so as to solve the problem of large memory resource consumption when a full-view picture is generated.
According to a first aspect, an embodiment of the present invention provides a screen switching method, including:
acquiring a panoramic picture and a close-up picture of the previous moment;
acquiring a panoramic picture at the current moment, and determining pixel points which change at the current moment compared with the previous moment by using the panoramic picture at the previous moment and the panoramic picture at the current moment;
and generating the close-up picture of the current moment by utilizing the close-up picture of the previous moment and the pixel point which is changed when the current moment is compared with the previous moment.
The picture switching method provided by the embodiment of the invention comprises the steps of obtaining a panoramic picture at the current moment by obtaining the panoramic picture at the previous moment and a close-up picture at the previous moment, determining pixel points which are changed at the current moment and are compared with the previous moment by utilizing the panoramic picture at the previous moment and the panoramic picture at the current moment, and generating the close-up picture at the current moment by utilizing the close-up picture at the previous moment and the pixel points which are changed at the current moment and are compared with the previous moment; compared with the prior art that all data frames of each close-up picture are intercepted and then copied, the embodiment of the invention locates and analyzes the pixel point area with only picture change, only the change pixel point is switched from the panoramic picture to the close-up picture, the consumption of memory resources is low, and the phenomena of blocking and shaking are avoided.
With reference to the first aspect, in a first implementation manner of the first aspect, determining a pixel point that changes at a current time compared to a previous time by using the panoramic picture at the previous time and the panoramic picture at the current time includes:
acquiring first identification information corresponding to each pixel point in the panoramic picture at the previous moment;
identifying each pixel point in the panoramic picture at the current moment according to a preset identification rule to obtain second identification information corresponding to each pixel point in the panoramic picture at the current moment;
and aiming at the same pixel point, determining whether the pixel point changes at the current moment compared with the last moment by using the first identification information and the second identification information, and traversing all the pixel points to obtain the pixel point which changes at the current moment compared with the last moment.
With reference to the first embodiment of the first aspect, in a second embodiment of the first aspect, identifying each pixel in the panoramic image at the current time according to a preset identification rule to obtain second identification information corresponding to each pixel in the panoramic image at the current time includes:
dividing all pixel points contained in the panoramic picture at the current moment according to whether a target exists in the pixel points or not to obtain a first pixel point set without the target and a second pixel point set with the target;
carrying out binarization processing on the first pixel point set aiming at the first pixel point set to obtain identification information corresponding to each pixel point in the first pixel point set;
determining the target quantity in the second pixel point set aiming at the second pixel point set;
when a target exists in the second pixel point set, identifying all the pixel points in the second pixel point set by using the same identification information, wherein the identification information of all the pixel points in the second pixel point set is different from the identification information of all the pixel points in the first pixel point set;
when a plurality of targets exist in the second pixel point set, dividing the pixels with the same targets into a group, identifying the pixels in the same group by using the same identification information, wherein the identification information of all the pixels in the second pixel point set is different from the identification information of all the pixels in the first pixel point set.
With reference to the first implementation manner of the first aspect, in a third implementation manner of the first aspect, determining, for a same pixel point, whether the pixel point changes at a current time compared to a previous time by using the first identification information and the second identification information includes:
aiming at the same pixel point, determining the similarity between the current moment and the previous moment of the pixel point by using the first identification information and the second identification information;
and determining whether the pixel point changes at the current moment compared with the previous moment or not according to the similarity of the current moment and the previous moment of the pixel point.
With reference to the third implementation manner of the first aspect, in the fourth implementation manner of the first aspect, determining, for a same pixel point, a similarity between a current time and a previous time of the pixel point by using the first identification information and the second identification information includes:
calculating Euclidean distances between the first identification information and the second identification information aiming at the same pixel point;
and calculating the similarity between the current moment and the previous moment of the pixel point according to a preset formula by utilizing the Euclidean distance.
With reference to the first aspect to the fourth aspect, in a fifth aspect, the screen switching method, when acquiring a panoramic screen at a current time, further includes: acquiring a panoramic picture at the next moment; when determining the pixel point which is changed at the current moment compared with the previous moment by using the panoramic picture at the previous moment and the panoramic picture at the current moment, the method further comprises the following steps: and determining the pixel point which changes at the next moment compared with the current moment by using the panoramic picture at the current moment and the panoramic picture at the next moment.
According to a second aspect, an embodiment of the present invention provides a screen switching apparatus, including:
the first acquisition module is used for acquiring a panoramic picture at the previous moment and a close-up picture at the previous moment;
the second acquisition module is used for acquiring the panoramic picture at the current moment;
the change pixel point determining module is used for determining the pixel point which changes at the current moment compared with the previous moment by utilizing the panoramic picture at the previous moment and the panoramic picture at the current moment;
and the picture switching module is used for generating the close-up picture of the current moment by utilizing the close-up picture of the previous moment and the pixel point which is changed when the current moment is compared with the previous moment.
According to a third aspect, an embodiment of the present invention further provides an electronic device, including: the camera shooting assembly is used for acquiring a panoramic picture; a memory and a processor, wherein the camera, the memory and the processor are communicatively connected to each other, the memory stores computer instructions, and the processor executes the computer instructions to perform the picture switching method according to the first aspect or any one of the embodiments of the first aspect.
With reference to the third aspect, in a first implementation manner of the third aspect, the electronic device is an electronic cloud mirror.
According to a fourth aspect, an embodiment of the present invention further provides a computer-readable storage medium, where computer instructions are stored, and the computer instructions are configured to cause the computer to execute the screen switching method described in the first aspect or any one of the implementation manners of the first aspect.
Drawings
The features and advantages of the present invention will be more clearly understood by reference to the accompanying drawings, which are illustrative and not to be construed as limiting the invention in any way, and in which:
FIG. 1 is a schematic illustration of a prior art close-up visual generated from a panoramic visual;
FIG. 2 is a flowchart illustrating a method for switching pictures according to an embodiment 1 of the present invention;
fig. 3 is a schematic diagram of an example of a screen switching method according to embodiment 1 of the present invention;
FIG. 4 is a schematic structural diagram of a screen switching apparatus according to embodiment 2 of the present invention;
fig. 5 is a schematic structural diagram of an electronic device according to embodiment 3 of the present invention;
fig. 6 is a schematic structural diagram of a computer-readable storage medium according to embodiment 3 of the present invention.
Detailed Description
In order to make the objects, technical solutions and advantages of the embodiments of the present invention clearer, 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 some, but not all, embodiments of the present invention. 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.
Example 1
An embodiment 1 of the present invention provides a method for switching a picture, which is described in detail below with reference to the accompanying drawings.
Referring to fig. 2, the figure is a schematic flow chart of a picture switching method provided by the present invention. The picture switching method specifically comprises the following steps:
s101: and acquiring the panoramic picture and the close-up picture of the previous moment.
As a specific implementation manner, when the close-up picture at the previous moment is the first close-up picture, a picture with a fixed size can be cut from a large picture as the close-up picture by using a scheme in the prior art; when the close-up picture at the previous moment is any one close-up picture after the first close-up picture, the close-up picture can be generated by using the changed pixel points.
In embodiment 1 of the present invention, a panorama picture is referred to as a close-up picture, a close-up picture is referred to as a panorama picture, a panorama picture is referred to as a large picture, and a close-up picture is referred to as a small picture cut out from a panorama picture.
S102: and acquiring the panoramic picture at the current moment.
As a further embodiment, while acquiring the panoramic picture at the current time, the method further includes: acquiring a panoramic picture at the next moment; that is, the panoramic picture at the previous time, the panoramic picture at the current time, the panoramic picture at the next time, and the close-up picture at the previous time can be simultaneously acquired through steps S101 and S102.
S103: and determining the pixel points which change at the current moment compared with the previous moment by using the panoramic picture at the previous moment and the panoramic picture at the current moment.
As a further embodiment, when the current-time panoramic picture is acquired and the next-time panoramic picture is also acquired in step S102, in step S103, while determining a pixel point that changes at the current time compared to the previous time by using the previous-time panoramic picture and the current-time panoramic picture, the method further includes: and determining the pixel point which changes at the next moment compared with the current moment by using the panoramic picture at the current moment and the panoramic picture at the next moment. Thereby reducing the number of cycles.
It should be noted that the specific step of determining the pixel point that changes at the next time compared to the current time by using the panoramic picture at the current time and the panoramic picture at the next time is the same as the specific step of determining the pixel point that changes at the current time compared to the previous time by using the panoramic picture at the previous time and the panoramic picture at the current time.
As a specific implementation manner, the following technical solution may be adopted to determine, by using the panoramic image at the previous time and the panoramic image at the current time, a pixel point at the current time that changes compared with the previous time:
s1031: and acquiring first identification information corresponding to each pixel point in the panoramic picture at the previous moment.
S1032: and identifying each pixel point in the panoramic picture at the current moment according to a preset identification rule to obtain second identification information corresponding to each pixel point in the panoramic picture at the current moment.
S1033: and aiming at the same pixel point, determining whether the pixel point changes at the current moment compared with the last moment by using the first identification information and the second identification information, and traversing all the pixel points to obtain the pixel point which changes at the current moment compared with the last moment.
As for step S1031, it should be noted that the first identification information corresponding to each pixel point in the panoramic picture at the previous moment can be obtained in the process of generating the close-up picture at the previous moment, so that it is only necessary to obtain in step S103. In addition, the first identification information corresponding to each pixel point in the panoramic picture at the previous time may also be determined according to the following method: and identifying each pixel point in the panoramic picture at the previous moment according to a preset identification rule to obtain first identification information corresponding to each pixel point in the panoramic picture at the previous moment.
For step S1032, identifying each pixel point in the panoramic image at the current time according to a preset identification rule, and obtaining second identification information corresponding to each pixel point in the panoramic image at the current time may adopt the following technical scheme:
(11) and dividing all pixel points contained in the panoramic picture at the current moment according to whether the target exists in the pixel points or not to obtain a first pixel point set without the target and a second pixel point set with the target. By way of example, the target may be understood to be a human.
(12) And aiming at the first pixel point set, carrying out binarization processing on the first pixel point set to obtain identification information corresponding to each pixel point in the first pixel point set.
(13) Determining the target quantity in the second pixel point set aiming at the second pixel point set; when a target exists in the second pixel point set, identifying all the pixel points in the second pixel point set by using the same identification information, wherein the identification information of all the pixel points in the second pixel point set is different from the identification information of all the pixel points in the first pixel point set; when a plurality of targets exist in the second pixel point set, dividing the pixels with the same targets into a group, identifying the pixels in the same group by using the same identification information, wherein the identification information of all the pixels in the second pixel point set is different from the identification information of all the pixels in the first pixel point set.
In the embodiment of the invention, binarization is to remove noise and reduce errors, and because the environments in the shot pictures are different, the pixels with interference can occur.
Specifically, any technical scheme in the prior art can be adopted for performing binarization processing on the first pixel point set in the step (12). For example, the foreground and the background are distinguished from the first pixel point set, the lowest point of the foreground and the background is the threshold, after the threshold is obtained, the pixel value of each pixel point in the first pixel point set is compared with the threshold one by one, so that the gray value of each pixel point in the first pixel point set is 0 (black) or 255 (white), the range of the gray value in the grayed image is 0-255, the range of the gray value in the binarized image is 0 or 255, and the 0 and 1 identifiers, that is, the identifier information corresponding to each pixel point in the first pixel point set, are generated according to the pixel data of which the gray value obtained by comparison is 0 (black) or 255 (white).
Specifically, in step (13), the second pixel point set is first divided into a plurality of regions, for example, when the target is a person, one region of the head, one region of one arm, and the like, and it is determined which regions belong to one target and which regions belong to another target according to the connectivity of the graph.
And when only one target exists in the second pixel point set, identifying all the pixel points in the second pixel point set by adopting the same identification information. When the pixel points in the first pixel point set are identified by 0 and 1, the identification information of the pixel points in the second pixel point set is not 0 and 1.
When a plurality of targets exist in the second pixel point set, the pixels with the same targets are divided into a group, and the pixels in the same group are identified by the same identification information. For example, the pixel point of the target a is identified by the identifier a, and the pixel point of the target B is identified by the identifier B. When the pixels in the first pixel set are identified by 0 and 1, the identifier a and the identifier B are not 0 and 1.
By adopting the scheme, the object targets are mainly identified, if the objects are on the same target, connectivity is carried out, the accuracy is improved and the memory merging is accelerated for the merging of the subsequent pixel blocks, and if the objects are scattered irregular pixels, the objects are merged one by one according to the identified values.
For step S1033, for the same pixel point, the following technical scheme may be adopted to determine whether the pixel point changes at the current time compared to the previous time by using the first identification information and the second identification information:
(21) and determining the similarity between the current moment and the previous moment of the pixel point by using the first identification information and the second identification information aiming at the same pixel point.
(22) And determining whether the pixel point changes at the current moment compared with the previous moment or not according to the similarity of the current moment and the previous moment of the pixel point.
As a specific implementation manner, for the same pixel point, the following technical scheme may be adopted to determine the similarity between the current time and the previous time of the pixel point by using the first identification information and the second identification information: calculating Euclidean distances between the first identification information and the second identification information aiming at the same pixel point; and calculating the similarity between the current moment and the previous moment of the pixel point according to a preset formula by utilizing the Euclidean distance. Wherein, the preset calculation formula is as follows: 1.0/(1.0 + Euclidean distance between the first identification information and the second identification information of the same pixel point).
For example, the similarity between the first identification information and the second identification information of the pixel point K may be expressed as follows:
Figure 763775DEST_PATH_IMAGE001
wherein x is1kFirst identification information, x, representing a pixel point K2kAnd second identification information representing the pixel point K.
Of course, other methods may be used to calculate the similarity between the current time and the previous time of the same pixel point, such as the pearson correlation coefficient.
S104: and generating the close-up picture of the current moment by utilizing the close-up picture of the previous moment and the pixel point which is changed when the current moment is compared with the previous moment.
As a specific embodiment, a pixel point that changes at the current time point compared to the previous time point may be copied to the close-up picture at the previous time point, and the close-up picture at the current time point may be synthesized.
Fig. 3 is a schematic diagram of an example of a picture switching method in embodiment 1 of the present invention, as shown in fig. 3, when a close-up picture needs to be generated from a panoramic picture, since the close-up picture updates the background picture each time, only the changed pixel points are intercepted, and the pixel points are merged on the previous close-up picture, that is, all data frames of the copy close-up picture do not need to be copied, but only the changed pixel points are switched from the panoramic picture to the close-up picture, so that the consumption of memory resources is small.
The picture switching method provided by the embodiment of the invention comprises the steps of obtaining a panoramic picture at the current moment by obtaining the panoramic picture at the previous moment and a close-up picture at the previous moment, determining pixel points which are changed at the current moment and are compared with the previous moment by utilizing the panoramic picture at the previous moment and the panoramic picture at the current moment, and generating the close-up picture at the current moment by utilizing the close-up picture at the previous moment and the pixel points which are changed at the current moment and are compared with the previous moment; compared with the prior art that all data frames of each close-up picture are intercepted and then copied, the embodiment of the invention locates and analyzes the pixel point area with only picture change, and only the change pixel point is switched from the panoramic picture to the close-up picture, so that the consumption of memory resources is low.
The picture switching method provided by the embodiment 1 of the invention can be applied to the electronic cloud mirror. The electronic cloud mirror can realize the switching mode of single machine and double scenes. For example, in an educational teaching system, 2 4K pole-definition cameras are provided. 1 teacher's electron cloud scene camera can realize the switching of podium panorama, teacher's feature-close according to the teacher positioning of walking around before the blackboard, for example: when the teacher is in the lecture station, the teacher features the picture, and when the teacher moves in front of the lecture station, the teacher switches to the lecture station panoramic picture. The electronic cloud scene camera for the students can realize the picture switching of the panoramic pictures and the close-ups of the students, specifically, when 1 student answers questions at the beginning, the picture is switched to the panoramic picture of the student and the next picture is switched to the close-up picture of the student, and when a plurality of students answer questions at the beginning, the picture is switched to the panoramic picture of the student; when the teacher interacts with the students, the pictures are panoramic pictures of the students, and the teacher returns to the platform area, and then the machine position is switched to the panoramic view of the platform. And the scene position of the teaching electronic courseware is equivalent to 2 cameras, so that the recording and broadcasting functions of 4+1 and five-path pictures are realized. By adopting an electronic cloud mirror technology, the two pixel cloud mirror high-definition cameras finish scene position pictures of 'teacher close-up', 'teacher panorama', 'student close-up' and 'student panorama'. In addition, the 'teaching computer' participates in recording and broadcasting, and five scene pictures are shot and recorded. The background is automatically decomposed, and the foreground is smoothly switched, so that no picture shaking sense exists.
Example 2
Corresponds to embodiment 1 of the present invention. Embodiment 2 of the present invention provides a screen switching apparatus. Fig. 4 is a schematic structural diagram of a picture switching apparatus according to embodiment 2 of the present invention, and as shown in fig. 4, the picture switching apparatus according to embodiment 2 of the present invention includes a first obtaining module 40, a second obtaining module 42, a changing pixel point determining module 44, and a picture switching module 46.
Specifically, the first obtaining module 40 is configured to obtain a panoramic picture at a previous moment and a close-up picture at the previous moment.
And a second obtaining module 42, configured to obtain the panoramic picture at the current time.
And a changing pixel point determining module 44, configured to determine, by using the panoramic image at the previous time and the panoramic image at the current time, a pixel point at the current time that changes compared to the previous time.
And a picture switching module 46, configured to generate the close-up picture at the current moment by using the close-up picture at the previous moment and the pixel point at which the current moment changes compared with the previous moment.
The change pixel point determining module 44 is specifically configured to: acquiring first identification information corresponding to each pixel point in the panoramic picture at the previous moment; identifying each pixel point in the panoramic picture at the current moment according to a preset identification rule to obtain second identification information corresponding to each pixel point in the panoramic picture at the current moment; and aiming at the same pixel point, determining whether the pixel point changes at the current moment compared with the last moment by using the first identification information and the second identification information, and traversing all the pixel points to obtain the pixel point which changes at the current moment compared with the last moment.
More specifically, the change pixel point determining module 44 is configured to: dividing all pixel points contained in the panoramic picture at the current moment according to whether a target exists in the pixel points or not to obtain a first pixel point set without the target and a second pixel point set with the target; carrying out binarization processing on the first pixel point set aiming at the first pixel point set to obtain identification information corresponding to each pixel point in the first pixel point set; determining the target quantity in the second pixel point set aiming at the second pixel point set; when a target exists in the second pixel point set, identifying all the pixel points in the second pixel point set by using the same identification information, wherein the identification information of all the pixel points in the second pixel point set is different from the identification information of all the pixel points in the first pixel point set; when a plurality of targets exist in the second pixel point set, dividing the pixels with the same targets into a group, identifying the pixels in the same group by using the same identification information, wherein the identification information of all the pixels in the second pixel point set is different from the identification information of all the pixels in the first pixel point set.
More specifically, the change pixel point determining module 44 is configured to: aiming at the same pixel point, determining the similarity between the current moment and the previous moment of the pixel point by using the first identification information and the second identification information; and determining whether the pixel point changes at the current moment compared with the previous moment or not according to the similarity of the current moment and the previous moment of the pixel point.
More specifically, the change pixel point determining module 44 is configured to: calculating Euclidean distances between the first identification information and the second identification information aiming at the same pixel point; and calculating the similarity between the current moment and the previous moment of the pixel point according to a preset formula by utilizing the Euclidean distance.
As a further implementation manner, when acquiring the panoramic picture at the current time, the second acquiring module is further configured to acquire the panoramic picture at the next time. When determining, by using the previous-time panoramic picture and the current-time panoramic picture, that the current time is compared with the pixel point that has changed at the previous time, the changed pixel point determining module 44 is further configured to: and determining the pixel point which changes at the next moment compared with the current moment by using the panoramic picture at the current moment and the panoramic picture at the next moment.
The details of the image switching device can be understood by referring to the corresponding descriptions and effects in the embodiments shown in fig. 2 to fig. 3, and are not described herein again.
Example 3
An embodiment of the present invention further provides an electronic device, which may include a camera 53, a processor 51 and a memory 52, where the processor 51 and the memory 52 may be connected by a bus or in another manner, and fig. 5 is a bus 50.
The processor 51 may be a Central Processing Unit (CPU) 51. The Processor 51 may also be other general-purpose Processor 51, a Digital Signal Processor 51 (DSP), an Application Specific Integrated Circuit (ASIC), a Field Programmable Gate Array (FPGA) or other Programmable logic device, a discrete Gate or transistor logic device, a discrete hardware component, or a combination thereof.
The memory 52 is a non-transitory computer readable storage medium, and can be used to store non-transitory software programs, non-transitory computer executable programs, and modules, such as program instructions/modules corresponding to the image switching method in the embodiment of the present invention (for example, the first obtaining module 40, the second obtaining module 42, the changing pixel point determining module 44, and the image switching module 46 shown in fig. 4). The processor 51 executes various functional applications and data processing of the processor 51 by running non-transitory software programs, instructions and modules stored in the memory 52, that is, implements the screen switching method in the above-described method embodiment.
The memory 52 may include a storage program area and a storage data area, wherein the storage program area may store an operating system, an application program required for at least one function; the storage data area may store data created by the processor 51, and the like. Further, the memory 52 may include high speed random access memory 52, and may also include non-transitory memory 52, such as at least one piece of disk memory 52, flash memory device, or other non-transitory solid state memory 52. In some embodiments, the memory 52 optionally includes memory 52 located remotely from the processor 51, and these remote memories 52 may be connected to the processor 51 via a network. Examples of such networks include, but are not limited to, the internet, intranets, local area networks, mobile communication networks, and combinations thereof.
The one or more modules are stored in the memory 52 and, when executed by the processor 51, perform a picture switching method as in the embodiment shown in fig. 2.
The details of the electronic device may be understood by referring to the corresponding descriptions and effects in the embodiments shown in fig. 2 to fig. 3, and are not described herein again.
Those skilled in the art will appreciate that all or part of the processes in the methods of the embodiments described above can be implemented by the computer program 601 instructing the relevant hardware, and the programs can be stored in a computer readable storage medium. As shown in fig. 6, the program, when executed, may include the flows of embodiments of the methods described above. The storage medium 601 may be a magnetic Disk, an optical Disk, a Read-Only Memory (ROM), a Random Access Memory (RAM), a Flash Memory (Flash Memory), a Hard Disk (Hard Disk Drive, abbreviated as HDD), a Solid State Drive (SSD), or the like; the storage medium may also comprise a combination of memories of the kind described above.
Although the embodiments of the present invention have been described in conjunction with the accompanying drawings, those skilled in the art may make various modifications and variations without departing from the spirit and scope of the invention, and such modifications and variations fall within the scope defined by the appended claims.

Claims (11)

1. A method for switching pictures, comprising:
acquiring a panoramic picture and a close-up picture of the previous moment;
acquiring a panoramic picture at the current moment, and determining pixel points which change at the current moment compared with the previous moment by using the panoramic picture at the previous moment and the panoramic picture at the current moment;
generating a close-up picture of the current moment by utilizing the close-up picture of the previous moment and the pixel point changed when the current moment is compared with the previous moment;
determining the pixel point which changes at the current moment compared with the previous moment by using the panoramic picture at the previous moment and the panoramic picture at the current moment, wherein the determining comprises the following steps:
acquiring first identification information corresponding to each pixel point in the panoramic picture at the previous moment;
identifying each pixel point in the panoramic picture at the current moment according to a preset identification rule to obtain second identification information corresponding to each pixel point in the panoramic picture at the current moment;
aiming at the same pixel point, determining whether the pixel point changes at the current moment compared with the previous moment or not by using the first identification information and the second identification information, and traversing all the pixel points to obtain the pixel point which changes at the current moment compared with the previous moment;
identifying each pixel point in the panoramic picture at the current moment according to a preset identification rule to obtain second identification information corresponding to each pixel point in the panoramic picture at the current moment, wherein the second identification information comprises:
dividing all pixel points contained in the panoramic picture at the current moment according to whether a target exists in the pixel points or not to obtain a first pixel point set without the target and a second pixel point set with the target;
carrying out binarization processing on the first pixel point set aiming at the first pixel point set to obtain identification information corresponding to each pixel point in the first pixel point set;
determining the target quantity in the second pixel point set aiming at the second pixel point set;
when a target exists in the second pixel point set, identifying all the pixel points in the second pixel point set by using the same identification information, wherein the identification information of all the pixel points in the second pixel point set is different from the identification information of all the pixel points in the first pixel point set;
when a plurality of targets exist in the second pixel point set, dividing the pixels with the same targets into a group, identifying the pixels in the same group by using the same identification information, wherein the identification information of all the pixels in the second pixel point set is different from the identification information of all the pixels in the first pixel point set.
2. The method of claim 1, wherein determining whether the pixel point changes at a current time compared to a previous time by using the first identification information and the second identification information for a same pixel point comprises:
aiming at the same pixel point, determining the similarity between the current moment and the previous moment of the pixel point by using the first identification information and the second identification information;
and determining whether the pixel point changes at the current moment compared with the previous moment or not according to the similarity of the current moment and the previous moment of the pixel point.
3. The image switching method according to claim 2, wherein determining, for a same pixel point, a similarity between a current time and a previous time of the pixel point by using the first identification information and the second identification information comprises:
calculating Euclidean distances between the first identification information and the second identification information aiming at the same pixel point;
and calculating the similarity between the current moment and the previous moment of the pixel point according to a preset formula by utilizing the Euclidean distance.
4. The screen switching method according to any one of claims 1 to 3, further comprising:
when the panoramic picture at the current moment is obtained, the method further comprises the following steps: acquiring a panoramic picture at the next moment;
when determining the pixel point which is changed at the current moment compared with the previous moment by using the panoramic picture at the previous moment and the panoramic picture at the current moment, the method further comprises the following steps: and determining the pixel point which changes at the next moment compared with the current moment by using the panoramic picture at the current moment and the panoramic picture at the next moment.
5. A screen switching apparatus, comprising:
the first acquisition module is used for acquiring a panoramic picture at the previous moment and a close-up picture at the previous moment;
the second acquisition module is used for acquiring the panoramic picture at the current moment;
the change pixel point determining module is used for determining the pixel point which changes at the current moment compared with the previous moment by utilizing the panoramic picture at the previous moment and the panoramic picture at the current moment;
the picture switching module is used for generating the close-up picture of the current moment by utilizing the close-up picture of the previous moment and the pixel point which is changed when the current moment is compared with the previous moment;
the determining, by using the previous-time panoramic picture and the current-time panoramic picture, a pixel point at which the current time changes compared with the previous time includes: acquiring first identification information corresponding to each pixel point in the panoramic picture at the previous moment; identifying each pixel point in the panoramic picture at the current moment according to a preset identification rule to obtain second identification information corresponding to each pixel point in the panoramic picture at the current moment; aiming at the same pixel point, determining whether the pixel point changes at the current moment compared with the previous moment or not by using the first identification information and the second identification information, and traversing all the pixel points to obtain the pixel point which changes at the current moment compared with the previous moment;
identifying each pixel point in the panoramic picture at the current moment according to a preset identification rule, and obtaining second identification information corresponding to each pixel point in the panoramic picture at the current moment comprises: dividing all pixel points contained in the panoramic picture at the current moment according to whether a target exists in the pixel points or not to obtain a first pixel point set without the target and a second pixel point set with the target; carrying out binarization processing on the first pixel point set aiming at the first pixel point set to obtain identification information corresponding to each pixel point in the first pixel point set; determining the target quantity in the second pixel point set aiming at the second pixel point set; when a target exists in the second pixel point set, identifying all the pixel points in the second pixel point set by using the same identification information, wherein the identification information of all the pixel points in the second pixel point set is different from the identification information of all the pixel points in the first pixel point set; when a plurality of targets exist in the second pixel point set, dividing the pixels with the same targets into a group, identifying the pixels in the same group by using the same identification information, wherein the identification information of all the pixels in the second pixel point set is different from the identification information of all the pixels in the first pixel point set.
6. The apparatus of claim 5, wherein:
the change pixel point determination module is further configured to: aiming at the same pixel point, determining the similarity between the current moment and the previous moment of the pixel point by using the first identification information and the second identification information; and determining whether the pixel point changes at the current moment compared with the previous moment or not according to the similarity of the current moment and the previous moment of the pixel point.
7. The apparatus of claim 6, wherein:
the change pixel point determination module is further configured to: calculating Euclidean distances between the first identification information and the second identification information aiming at the same pixel point; and calculating the similarity between the current moment and the previous moment of the pixel point according to a preset formula by utilizing the Euclidean distance.
8. The apparatus according to any one of claims 5 to 7, wherein:
when the panoramic picture at the current moment is obtained, the second obtaining module is further used for obtaining the panoramic picture at the next moment;
when determining that the current time is compared with the pixel point changed at the previous time by using the panoramic picture at the previous time and the panoramic picture at the current time, the changed pixel point determining module is further configured to: and determining the pixel point which changes at the next moment compared with the current moment by using the panoramic picture at the current moment and the panoramic picture at the next moment.
9. An electronic device, comprising:
the camera is used for acquiring a panoramic picture;
a memory and a processor, the camera, the memory and the processor being communicatively connected to each other, the memory having stored therein computer instructions, the processor executing the computer instructions to perform the picture switching method according to any one of claims 1 to 4.
10. The electronic device of claim 9, wherein the electronic device is an electronic cloud mirror.
11. A computer-readable storage medium storing computer instructions for causing a computer to execute the picture switching method according to any one of claims 1 to 4.
CN202010647362.5A 2020-07-07 2020-07-07 Picture switching method and device, electronic equipment and storage medium Active CN111988520B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202010647362.5A CN111988520B (en) 2020-07-07 2020-07-07 Picture switching method and device, electronic equipment and storage medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202010647362.5A CN111988520B (en) 2020-07-07 2020-07-07 Picture switching method and device, electronic equipment and storage medium

Publications (2)

Publication Number Publication Date
CN111988520A CN111988520A (en) 2020-11-24
CN111988520B true CN111988520B (en) 2021-08-13

Family

ID=73438575

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202010647362.5A Active CN111988520B (en) 2020-07-07 2020-07-07 Picture switching method and device, electronic equipment and storage medium

Country Status (1)

Country Link
CN (1) CN111988520B (en)

Families Citing this family (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN114245146A (en) * 2021-12-02 2022-03-25 北京鸿合爱学教育科技有限公司 Display picture switching method, device, equipment and computer readable storage medium

Citations (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
EP2654286A1 (en) * 2011-11-29 2013-10-23 Samsung Electronics Co., Ltd. Method of providing panoramic image and imaging device thereof
CN108702445A (en) * 2017-03-03 2018-10-23 华为技术有限公司 A kind of method for displaying image and electronic equipment

Family Cites Families (17)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
TWI283536B (en) * 2003-01-23 2007-07-01 Jau-Hung Jang Active monitoring system and monitoring method
TWI484458B (en) * 2008-08-04 2015-05-11 Prime View Int Co Ltd Display method applied to electrophoretic display
JP5498059B2 (en) * 2009-06-02 2014-05-21 オリンパスイメージング株式会社 Imaging apparatus, imaging method, reproduction method, image processing apparatus, and image processing program
CN102244786A (en) * 2011-07-12 2011-11-16 深圳市万兴软件有限公司 Method and device for compressing and decompressing video data and mobile terminal
US9258485B2 (en) * 2014-03-24 2016-02-09 Omnivision Technologies, Inc. Image sensor cropping images in response to cropping coordinate feedback
CN105120164B (en) * 2015-08-28 2016-10-19 努比亚技术有限公司 The processing means of continuous photo and method
CN106815587B (en) * 2015-11-30 2019-10-18 浙江宇视科技有限公司 Image processing method and device
US20170280054A1 (en) * 2016-03-22 2017-09-28 Le Holdings (Beijing) Co., Ltd. Method and electronic device for panoramic live broadcast
CN106803863A (en) * 2016-12-20 2017-06-06 深圳市金立通信设备有限公司 A kind of image sharing method and terminal
CN106534211A (en) * 2016-12-29 2017-03-22 四川九洲电器集团有限责任公司 Data transmission method and electronic equipment
CN109218656B (en) * 2017-06-30 2021-03-26 杭州海康威视数字技术股份有限公司 Image display method, device and system
CN108010037B (en) * 2017-11-29 2019-09-13 腾讯科技(深圳)有限公司 Image processing method, device and storage medium
CN109348288A (en) * 2018-11-09 2019-02-15 五八同城信息技术有限公司 A kind of processing method of video, device, storage medium and terminal
CN110136166B (en) * 2019-04-09 2021-04-30 深圳锐取信息技术股份有限公司 Automatic tracking method for multi-channel pictures
CN110351480B (en) * 2019-06-13 2021-01-15 歌尔光学科技有限公司 Image processing method and device for electronic equipment and electronic equipment
CN110896497A (en) * 2019-10-30 2020-03-20 厦门天锐科技股份有限公司 Image processing method, video playing method and device
CN111225145A (en) * 2020-01-13 2020-06-02 北京中庆现代技术股份有限公司 Real-time image detection analysis and tracking method

Patent Citations (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
EP2654286A1 (en) * 2011-11-29 2013-10-23 Samsung Electronics Co., Ltd. Method of providing panoramic image and imaging device thereof
CN108702445A (en) * 2017-03-03 2018-10-23 华为技术有限公司 A kind of method for displaying image and electronic equipment

Also Published As

Publication number Publication date
CN111988520A (en) 2020-11-24

Similar Documents

Publication Publication Date Title
US20180284777A1 (en) Method, control apparatus, and system for tracking and shooting target
US11978225B2 (en) Depth determination for images captured with a moving camera and representing moving features
CN109299703B (en) Method and device for carrying out statistics on mouse conditions and image acquisition equipment
WO2020037881A1 (en) Motion trajectory drawing method and apparatus, and device and storage medium
CN111193961B (en) Video editing apparatus and method
CN110866473B (en) Target object tracking detection method and device, storage medium and electronic device
CN112800850B (en) Video processing method and device, electronic equipment and storage medium
CN110062157B (en) Method and device for rendering image, electronic equipment and computer readable storage medium
CN112995678B (en) Video motion compensation method and device and computer equipment
CN113112542A (en) Visual positioning method and device, electronic equipment and storage medium
WO2023217138A1 (en) Parameter configuration method and apparatus, device, storage medium and product
CN111444822B (en) Object recognition method and device, storage medium and electronic device
CN114429191B (en) Electronic anti-shake method, system and storage medium based on deep learning
CN112218005A (en) Video editing method based on artificial intelligence
CN112511859A (en) Video processing method, device and storage medium
CN111988520B (en) Picture switching method and device, electronic equipment and storage medium
CN111160340B (en) Moving object detection method and device, storage medium and terminal equipment
CN109598195B (en) Method and device for processing clear face image based on monitoring video
CN114222065B (en) Image processing method, image processing apparatus, electronic device, storage medium, and program product
CN116168233A (en) Blackboard writing restoration method based on grid image patch classification
CN116188535A (en) Video tracking method, device, equipment and storage medium based on optical flow estimation
CN115239551A (en) Video enhancement method and device
CN112085002A (en) Portrait segmentation method, portrait segmentation device, storage medium and electronic equipment
CN117177004B (en) Content frame extraction method, device, equipment and storage medium
TWI783390B (en) Image processing system and method for generating dynamic image segmentation

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination
CB02 Change of applicant information

Address after: 247100 workshop C2, science and Technology Incubation Park, Jiangnan industrial concentration zone, Chizhou City, Anhui Province

Applicant after: Anhui Wenxiang Technology Co.,Ltd.

Address before: Room 1101, 11 / F, building 2, No.15, Ronghua South Road, Daxing Economic and Technological Development Zone, Beijing 100176

Applicant before: BEIJING WENXIANG INFORMATION TECHNOLOGY Co.,Ltd.

CB02 Change of applicant information
GR01 Patent grant
GR01 Patent grant