WO2023185393A1 - 图像处理方法、装置、设备及存储介质 - Google Patents

图像处理方法、装置、设备及存储介质 Download PDF

Info

Publication number
WO2023185393A1
WO2023185393A1 PCT/CN2023/079968 CN2023079968W WO2023185393A1 WO 2023185393 A1 WO2023185393 A1 WO 2023185393A1 CN 2023079968 W CN2023079968 W CN 2023079968W WO 2023185393 A1 WO2023185393 A1 WO 2023185393A1
Authority
WO
WIPO (PCT)
Prior art keywords
virtual
line
collision body
collider
touch screen
Prior art date
Application number
PCT/CN2023/079968
Other languages
English (en)
French (fr)
Inventor
马佳欣
徐力有
王思元
Original Assignee
北京字跳网络技术有限公司
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 北京字跳网络技术有限公司 filed Critical 北京字跳网络技术有限公司
Publication of WO2023185393A1 publication Critical patent/WO2023185393A1/zh

Links

Classifications

    • AHUMAN NECESSITIES
    • A63SPORTS; GAMES; AMUSEMENTS
    • A63FCARD, BOARD, OR ROULETTE GAMES; INDOOR GAMES USING SMALL MOVING PLAYING BODIES; VIDEO GAMES; GAMES NOT OTHERWISE PROVIDED FOR
    • A63F13/00Video games, i.e. games using an electronically generated display having two or more dimensions
    • A63F13/55Controlling game characters or game objects based on the game progress
    • AHUMAN NECESSITIES
    • A63SPORTS; GAMES; AMUSEMENTS
    • A63FCARD, BOARD, OR ROULETTE GAMES; INDOOR GAMES USING SMALL MOVING PLAYING BODIES; VIDEO GAMES; GAMES NOT OTHERWISE PROVIDED FOR
    • A63F13/00Video games, i.e. games using an electronically generated display having two or more dimensions
    • A63F13/55Controlling game characters or game objects based on the game progress
    • A63F13/56Computing the motion of game characters with respect to other game characters, game objects or elements of the game scene, e.g. for simulating the behaviour of a group of virtual soldiers or for path finding
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06TIMAGE DATA PROCESSING OR GENERATION, IN GENERAL
    • G06T11/002D [Two Dimensional] image generation
    • G06T11/20Drawing from basic elements, e.g. lines or circles
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06TIMAGE DATA PROCESSING OR GENERATION, IN GENERAL
    • G06T7/00Image analysis
    • G06T7/20Analysis of motion
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06TIMAGE DATA PROCESSING OR GENERATION, IN GENERAL
    • G06T2207/00Indexing scheme for image analysis or image enhancement
    • G06T2207/30Subject of image; Context of image processing
    • G06T2207/30241Trajectory

Definitions

  • the embodiments of the present disclosure relate to the field of image processing technology, such as an image processing method, device, equipment and storage medium.
  • a collision body is usually set on each virtual object to detect whether a collision occurs.
  • Embodiments of the present disclosure provide an image processing method, device, equipment and storage medium to process linear collision bodies and improve the diversity of game development.
  • an embodiment of the present disclosure provides an image processing method, including:
  • a line collider is generated according to the drawing trajectory triggered by the user in the screen corresponding to the current scene; wherein the current scene includes multiple virtual colliders; the line collider is composed of a plurality of box colliders with set shapes;
  • a first result is generated, in response to the line collision body and the first virtual collision object At least one of the objects does not collide with the second virtual collider, and a second result is generated.
  • embodiments of the present disclosure also provide an image processing device, including:
  • the line collision body generation module is configured to generate a line collision body according to the drawing trajectory triggered by the user in the screen corresponding to the current scene; wherein the current scene includes multiple virtual collision bodies; the line collision body is composed of multiple set shapes The box collision body is composed of;
  • a motion control module configured to control the line collision body and the first virtual collision body in the current scene to move in a set manner
  • a collision detection module configured to detect whether at least one of the line collision body and the first virtual collision object collides with the second virtual collision body
  • a result generation module configured to generate a first result in response to a collision between at least one of the line collision body and the first virtual collision object and the second virtual collision body, in response to the line collision At least one of the body and the first virtual collision object does not collide with the second virtual collision body, and a second result is generated.
  • embodiments of the present disclosure also provide an electronic device, where the electronic device includes:
  • a storage device configured to store programs
  • the processing device When the program is executed by the processing device, the processing device is caused to implement the image processing method described in the embodiments of the present disclosure.
  • embodiments of the present disclosure also provide a computer-readable medium.
  • a computer program is stored on the computer-readable medium.
  • the image processing method as described in the embodiments of the disclosure is implemented. .
  • Figure 1 is a flow chart of an image processing method in an embodiment of the present disclosure
  • Figure 2 is an example diagram of generating a line collision body in an embodiment of the present disclosure
  • Figure 3 is an example diagram of a scenario in an embodiment of the present disclosure.
  • Figure 4 is a schematic structural diagram of an image processing device in an embodiment of the present disclosure.
  • Figure 5 is a schematic structural diagram of an electronic device in an embodiment of the present disclosure.
  • the term “include” and its variations are open-ended, ie, “including but not limited to.”
  • the term “based on” means “based at least in part on.”
  • the term “one embodiment” means “at least one embodiment”; the term “another embodiment” means “at least one additional embodiment”; and the term “some embodiments” means “at least some embodiments”. Relevant definitions of other terms will be given in the description below.
  • the solution of this embodiment can be applied to a game scene.
  • the game contains multiple levels, each level corresponds to a scene, and multiple virtual collision bodies are set in each scene.
  • the virtual collision body can be a static collision body or a dynamic collision body. body.
  • the virtual collider can be fixed at a set position, and the dynamic collider can move in the scene of the current level according to the set method. During the movement, it can collide with other virtual colliders.
  • Figure 1 is a flow chart of an image processing method provided in Embodiment 1 of the present disclosure. This embodiment can be applied to the situation of processing the collision of a line collision body.
  • the method can be executed by an image processing device, and the device can be implemented by hardware. and/or software, and generally can be integrated in a device with image processing method functions.
  • the device can be an electronic device such as a server, a mobile terminal, or a server cluster. As shown in Figure 1, the method may include the following steps:
  • S110 Generate a line collision body according to the drawing trajectory triggered by the user in the screen corresponding to the current scene.
  • the current scene includes multiple virtual colliders.
  • the current scene can be the scene corresponding to one of the levels in the game scene.
  • the line collider is composed of multiple box colliders (Box Collider) with set shapes.
  • the APP displays the tasks that need to be completed for the level through text information, and the user starts to touch according to the task prompts. Lines are drawn on the screen. After the user completes the drawing, a line collision body is generated based on the obtained drawing trajectory.
  • the process of generating a line collision body based on the drawing trajectory triggered by the user in the screen corresponding to the current scene may be: when the drawing moment reaches the end time, based on the drawing trajectory completed by the user in the screen corresponding to the current scene Generate a line collision body; or, when it is detected that the user stops drawing, the user generates a line collision body on the completed drawing trajectory in the screen corresponding to the current scene.
  • stopping drawing may be when it is detected that the user's finger leaves the screen or when it is detected that the user's finger stops in one position.
  • the drawing countdown starts (for example, 10 seconds), and the user starts touching the screen to draw lines.
  • the completed drawing trajectory is obtained and generated based on the completed drawing trajectory.
  • Line Collider In this embodiment, the drawing is counted down and the line collision body is generated based on the user's completed drawing trajectory on the screen corresponding to the current scene, which can improve the accuracy of the generated line collision body.
  • the way to generate a line collision body based on the drawing trajectory triggered by the user on the screen corresponding to the current scene can be: obtaining the user's touch screen points in every two adjacent frames during the drawing process, as the first touch screen point and the second touch screen point.
  • Two touch screen points use the first touch screen point and the second touch screen point as the two vertices of the set shape to generate a box collider of the set shape, and obtain multiple box colliders; Connect in series to obtain a line collision body.
  • the set shape may be a rectangle, and the first touch screen point and the second touch screen point serve as two vertices on the diagonal line of the rectangle.
  • the first touch screen point and the second touch screen point are used as two vertices of a diagonal line to generate a rectangular collision body, so that multiple rectangular collision bodies are connected in series to form a line collision body.
  • FIG. 2 is an example diagram of generating a line collision body in this embodiment. As shown in Figure 2, the touch screen points on the drawing trajectory are obtained, and the adjacent touch screen points are used as the diagonal vertices of the rectangle to generate a rectangular collision body. Multiple rectangular collision bodies are connected in series to generate a line collision body. In this embodiment, multiple rectangular colliders are connected in series to generate a line collider, so that the line collider can perform collision detection.
  • the first touch screen point and the second touch screen point are used as two vertices of the set shape to generate a box collider of the set shape: if the first touch screen point and the second touch screen point are The horizontal distance between the points is greater than the set ratio of the horizontal length of the screen, and/or the vertical distance between the first touch screen point and the second touch screen point is greater than the set ratio of the vertical length of the screen, then between the first touch screen point and the second touch screen point Insert touch screen points between screen points; generate a box collider with a set shape based on two adjacent touch screen points after insertion point processing.
  • the setting ratio can be set to any value between 0.03-0.05, for example: the setting ratio is set to 0.04.
  • the lateral distance between the first touch screen point and the second touch screen point will be greater than the set ratio of the screen lateral length (width), and/or the first touch screen point will be drawn at a faster speed.
  • the vertical distance between the screen point and the second touch screen point is greater than the set ratio of the vertical length (height) of the screen.
  • the method of inserting a touch screen point between the first touch screen point and the second touch screen point may be: the horizontal distance is based on a set ratio of the horizontal length of the screen as a unit and the vertical distance is inserted into the touch screen as a unit of a set ratio of the vertical length of the screen. point, so that the horizontal distance between two adjacent touch screen points after interpolation point processing is less than or equal to the set ratio of the horizontal length of the screen, and the vertical distance is less than or equal to the set ratio of the vertical length of the screen.
  • a touch screen point is inserted between the first touch screen point and the second touch screen point, so that the size of the produced rectangular collision body matches the line.
  • the method of inserting a touch screen point between the first touch screen point and the second touch screen point may be: obtaining the connection between the first touch screen point and the second touch screen point; using the set standard to connect the Insert at least one touch screen point on the screen.
  • the setting standard is that the horizontal distance between adjacent touch screen points is less than or equal to the set ratio of the horizontal length of the screen and the vertical distance of adjacent touch screen points is less than or equal to the set ratio of the vertical length of the screen.
  • the process of inserting at least one touch screen point on the connection line may be: first, calculate the diagonal length of a rectangle formed by taking the set ratio of the horizontal length of the screen as the width and taking the set ratio of the vertical length of the screen as the height. , and then divide the connection line between the first touch screen point and the second touch screen point in units of diagonal length, thereby realizing the insertion of the touch screen point.
  • inserting a touch screen point on the connection line between the first touch screen point and the second touch screen point can ensure the smoothness of the generated line collision body.
  • the generated box colliders exceed the set value (for example: 200), stop generating box colliders. Can improve the performance of line colliders.
  • the method of generating line colliders based on the drawing trajectory triggered by the user in the screen corresponding to the current scene can be: if the drawing trajectory passes through the virtual collider in the current scene, obtain the overlapping area between the drawing trajectory and the virtual collider; Skips overlapping areas when generating box colliders of a set shape.
  • the first virtual collider may be a dynamic collider of the current scene, and may be generated by setting a collider on a virtual object.
  • Virtual objects can be set based on current scene requirements.
  • virtual objects can be virtual stones, virtual bombs, virtual bullets, etc.
  • the setting method may be to set a force field in the current scene so that the line collision body and the first virtual collision body move under the action of the force field.
  • the set position may be a gravity field, so that the line collider and the first virtual collider perform free fall motion.
  • S130 detect whether the line collision body and/or the first virtual collision object collides with the second virtual collision body. If a collision occurs, S140 is executed. If no collision occurs, S150 is executed.
  • the second virtual collider can be a static or dynamic collider in the current scene, and can be generated by setting a collider on the avatar.
  • the virtual image may be, for example, an animation image or an animal image, etc.
  • the second virtual collider may be generated by fusing the image with the second virtual collider to obtain a new second virtual collider.
  • the image is a static image or a dynamic image.
  • Static images can be obtained from a local database or a server database.
  • Dynamic images can be recorded videos or images collected in real time.
  • the user starts the entertainment APP, he starts the camera of the terminal device.
  • the camera collects the current picture (for example, the user's face) in real time, and fuses the collected image with the second virtual collision body to obtain a new third Two virtual collision bodies.
  • the image and the second virtual collision body are Integration can improve the fun.
  • At least one of the line collision body and the first virtual collision object can collide with the second virtual collision object before the line collision body collides with the first virtual collision object.
  • the virtual collider collides; or, after the linear collider and the first virtual collider object collide, at least one of the linear collider and the first virtual collider object collides with the second virtual collider.
  • the method of detecting whether at least one of the line collision body and the first virtual collision object collides with the second virtual collision body may be: detecting whether at least one of the line collision body and the first virtual collision object collides with the second virtual collision body. Whether there is a collision with the second virtual collider within a certain time period.
  • a countdown is performed (for example, 5 seconds), and it is detected whether at least one of the line collision body and the first virtual collision object is within a set time period before the countdown ends. Collision with the second virtual collider. Using a countdown method can increase the fun.
  • the process of detecting whether at least one of the line collider and the first virtual collider collides with the second virtual collider may be: if the line collider collides with the first virtual collider, determine whether the line collider collides with the second virtual collider. The first movement trajectory after the collision and the second movement trajectory after the collision of the first virtual collision body; the control line collision body continues to move according to the first movement trajectory, and the first virtual collision body is controlled to continue to move according to the second movement trajectory; detecting continued movement Whether at least one of the rear line collision body and the first virtual collision object collides with the second virtual collision body.
  • the method of determining the first movement trajectory after the collision of the line collision body and the second movement trajectory after the collision of the first virtual collision body may be: after the collision between the line collision body and the first virtual collision body, using physics
  • the principle is to perform force analysis on the linear collision body and the first virtual collision body, and obtain the motion states (including speed, acceleration, position and other information) of the linear collision body and the first virtual collision body at multiple moments after the collision, thereby based on multiple The motion state at the moment obtains the first motion trajectory after the collision of the line collider and the second motion trajectory after the collision of the first virtual collider.
  • FIG. 3 is an example diagram of a scenario in this embodiment.
  • the first virtual collision body is a virtual stone
  • the line collision body is generated according to the trajectory drawn by the user
  • the second virtual collision body is a virtual human body
  • the line collision body and the first virtual collision body all collide according to the free fall During the movement, the two collide.
  • determining the first movement trajectory after the collision of the line collision body and the second movement trajectory after the collision of the first virtual collision body can improve the accuracy of collision detection.
  • the first result may be "challenge failed".
  • the line collision body and the first virtual collision object collides with the second virtual collision body, it means that the line collision body drawn by the user has not completed the challenge task, and then "Challenge failed" is generated. "the result of.
  • the method further includes the following steps: popping up a selection window for returning to the current scene for the user to choose to return to the current scene.
  • the second result may be "challenge successful".
  • the line collision body and the first virtual collision object does not collide with the second virtual collision body, it means that the line collision body drawn by the user has completed the challenge task, and then "Challenge Successful" is generated. "the result of.
  • the method further includes the following steps: popping up a selection window for jumping to the next scene for the user to choose to jump to the next scene.
  • the user can choose to challenge the next scene.
  • the technical solution of this embodiment is to generate a line collider based on the drawing trajectory triggered by the user in the screen corresponding to the current scene; wherein the current scene includes multiple virtual colliders; the line collider is composed of multiple box colliders with set shapes. ; Control the line collider and the first virtual collider in the current scene to move in a set manner; detect whether at least one of the line collider and the first virtual collider collides with the second virtual collider; if a collision occurs, The first result is generated, and if no collision occurs, the second result is generated.
  • the image processing method provided by the embodiment of the present disclosure generates a line collision body composed of multiple box collision bodies with set shapes based on the user-triggered drawing trajectory, which can realize the processing of linear collision bodies and improve the diversity of game development.
  • FIG 4 is a schematic structural diagram of an image processing device disclosed in an embodiment of the present disclosure. As shown in Figure 4, the device includes:
  • the line collision body generation module 410 is configured to generate a line collision body according to the drawing trajectory triggered by the user in the screen corresponding to the current scene; wherein the current scene includes multiple virtual collision bodies; the line collision body is collided by multiple boxes of set shapes body composition;
  • the motion control module 420 is configured to control the line collision body and the first virtual collision body in the current scene to move in a set manner;
  • the collision detection module 430 is configured to detect whether at least one of the line collision body and the first virtual collision object collides with the second virtual collision body;
  • the result generation module 440 is configured to generate a first result in response to at least one of the line collision body and the first virtual collision object colliding with the second virtual collision body. At least one of them does not collide with the second virtual collider, thereby generating a second result.
  • the method also includes: a second virtual collision body generation module, which is set to:
  • the image is fused with the second virtual collision body to obtain a new second virtual collision body; where the image is a static image or a dynamic image.
  • the line collision body generation module 410 is also set to:
  • a line collision body is generated based on the drawing trajectory that the user has completed in the screen corresponding to the current scene.
  • the line collision body generation module 410 is also set to:
  • the line collision body generation module 410 is also set to:
  • the line collision body generation module 410 is also set to:
  • the line collision body generation module 410 is also set to:
  • the collision detection module 430 is also set to:
  • the collision detection module 430 is also set to:
  • the method also includes: selecting a window pop-up module and setting it to:
  • a selection window for returning to the current scene pops up for the user to choose to return to the current scene
  • a selection window for jumping to the next scene pops up for the user to choose to jump to the next scene.
  • the above-mentioned device can execute the methods provided by all the foregoing embodiments of the present disclosure, and has corresponding functional modules and beneficial effects for executing the above-mentioned methods.
  • the methods provided by all the previous embodiments of this disclosure please refer to the methods provided by all the previous embodiments of this disclosure.
  • Electronic devices in embodiments of the present disclosure may include mobile phones, notebook computers, digital broadcast receivers, personal digital assistants (Personal Digital Assistant, PDA), tablet computers (Portable Android Device, PAD), portable multimedia players (Portable Media Player, PMP), mobile terminals such as vehicle-mounted terminals (such as vehicle-mounted navigation terminals), and fixed terminals such as digital televisions (also known as digital TVs), desktop computers, etc., or various forms of servers, such as independent servers or server clusters.
  • PDA Personal Digital Assistant
  • PMP portable multimedia players
  • mobile terminals such as vehicle-mounted terminals (such as vehicle-mounted navigation terminals), and fixed terminals such as digital televisions (also known as digital TVs), desktop computers, etc., or various forms of servers, such as independent servers or server clusters.
  • the electronic device shown in FIG. 5 is only an example.
  • the electronic device 300 may include a processing device (such as a central processing unit, a graphics processor, etc.) 301.
  • the processing device 301 may process data according to a program stored in a read-only storage device (Read Only Memory, ROM) 302 or from a program.
  • the storage device 308 loads the program in the random access memory device (Random Access Memory, RAM) 303 to perform various appropriate actions and processes.
  • RAM random access memory
  • various programs and data required for the operation of the electronic device 300 are also stored.
  • the processing device 301, ROM 302 and RAM 303 are connected to each other via a bus 304.
  • An input/output (I/O) interface 305 is also connected to bus 304.
  • the following devices can be connected to the I/O interface 305: input devices 306 including, for example, a touch screen, touch pad, keyboard, mouse, camera, microphone, accelerometer, gyroscope, etc.; including, for example, a Liquid Crystal Display (LCD) , an output device 307 such as a speaker, a vibrator, etc.; a storage device 308 including a magnetic tape, a hard disk, etc.; and a communication device 309.
  • the communication device 309 may allow the electronic device 300 to communicate wirelessly or wiredly with other devices to exchange data.
  • FIG. 5 illustrates electronic device 300 with various means, it should be understood that implementation or availability of all illustrated means is not required. More or fewer means may alternatively be implemented or provided.
  • embodiments of the present disclosure include a computer program product including a computer program carried on a computer-readable medium, the computer program including program code for performing a recommendation method for words.
  • the computer program may be downloaded and installed from the network via communication device 309, or from storage device 308, or from ROM 302.
  • the processing device 301 When the computer program is executed by the processing device 301, the above-mentioned functions defined in the method of the embodiment of the present disclosure are performed.
  • the computer-readable medium mentioned above in the present disclosure may be a computer-readable signal medium or a computer-readable storage medium, or a combination of the above two.
  • the computer-readable storage medium may, for example It can be an electrical, magnetic, optical, electromagnetic, infrared, or semiconductor system, device or device, or a combination of the above.
  • Examples of computer readable storage media may include: an electrical connection having at least one conductor, a portable computer disk, a hard drive, random access memory (RAM), read only memory (ROM), erasable programmable read only memory (e.g., electronically removable memory).
  • a computer-readable storage medium may be a tangible medium that contains or stores a program that may be used by or in connection with an instruction execution system, apparatus, or device.
  • a computer-readable signal medium may include a data signal propagated in baseband or as part of a carrier wave, carrying computer-readable program code therein. Such propagated data signals may take a variety of forms, including electromagnetic signals, optical signals, or a suitable combination of the above.
  • a computer-readable signal medium may also be any computer-readable medium other than a computer-readable storage medium that can send, propagate, or transmit a program for use by or in connection with an instruction execution system, apparatus, or device .
  • Program codes contained on computer-readable media can be transmitted using any appropriate medium, including: wires, optical cables, radio frequency (Radio Frequency, RF), etc., or appropriate combinations of the above.
  • the client and server can communicate using currently known or future developed network protocols such as HyperText Transfer Protocol (HTTP), and can communicate with digital data in any form or medium (e.g., communications network) interconnection.
  • HTTP HyperText Transfer Protocol
  • Examples of communication networks include local area networks (LAN), wide area networks (WAN), the Internet (e.g., the Internet), and end-to-end networks (e.g., ad hoc end-to-end networks), as well as currently known or networks for future research and development.
  • the above-mentioned computer-readable medium may be included in the above-mentioned electronic device; it may also exist independently without being assembled into the electronic device.
  • the computer-readable medium carries at least one program.
  • the electronic device When the at least one program is executed by the electronic device, the electronic device: generates a line collision body according to the drawing trajectory triggered by the user in the screen corresponding to the current scene; wherein, the The current scene includes multiple virtual colliders; the line collider is composed of a plurality of box colliders with a set shape; the line collider and the first virtual collider in the current scene are controlled to move in a set manner; Detecting whether at least one of the line collision body and the first virtual collision object collides with a second virtual collision body; in response to at least one of the line collision body and the first virtual collision object colliding with The second virtual collider collides to generate a first result, and in response to at least one of the line collider and the first virtual collider not colliding with the second virtual collider, a second result is generated. result.
  • Computer program code for performing the operations of the present disclosure may be written in one or more programming languages, including object-oriented programming languages such as Java, Smalltalk, C++, and conventional procedures, or a combination thereof. programming language such as "C" or a similar programming language.
  • the program code may execute entirely on the user's computer, partly on the user's computer, as a stand-alone software package, partly on the user's computer and partly on a remote computer or entirely on a remote computer or server.
  • the remote computer may be connected to the user's computer through any kind of network, including a local area network (LAN) or a wide area network (WAN), or may be connected to an external computer (such as through the Internet using an Internet service provider) .
  • LAN local area network
  • WAN wide area network
  • Internet service provider such as AT&T, MCI, Sprint, EarthLink, MSN, GTE, etc.
  • each block in the flowchart or block diagrams may represent a module, segment, or portion of code that contains at least one operable function for implementing the specified logical function.
  • Execute instructions may also be noted that, in some alternative implementations, the functions noted in the block may occur out of the order noted in the figures. For example, two blocks shown one after another may actually execute substantially in parallel, or they may sometimes execute in the reverse order, depending on the functionality involved.
  • each block of the block diagram and/or flowchart illustration, and combinations of blocks in the block diagram and/or flowchart illustration can be implemented by special purpose hardware-based systems that perform the specified functions or operations. , or can be implemented using a combination of specialized hardware and computer instructions.
  • the units involved in the embodiments of the present disclosure can be implemented in software or hardware. Among them, the name of a unit does not constitute a limitation on the unit itself under certain circumstances.
  • exemplary types of hardware logic components include: Field-Programmable Gate Array (FPGA), Application Specific Integrated Circuit (ASIC), Application Specific Standard Parts (ASSP) ), System on Chip (SOC), Complex Programmable Logic Device (CPLD), etc.
  • FPGA Field-Programmable Gate Array
  • ASIC Application Specific Integrated Circuit
  • ASSP Application Specific Standard Parts
  • SOC System on Chip
  • CPLD Complex Programmable Logic Device
  • a machine-readable medium may be a tangible medium that may contain or store a program for use by or in connection with an instruction execution system, apparatus, or device.
  • the machine-readable medium may be a machine-readable signal medium or a machine-readable storage medium.
  • Machine-readable media may include electronic, magnetic, optical, electromagnetic, infrared, or semiconductor systems, devices, or devices, or suitable combinations of the foregoing. Examples of machine-readable storage media may include an electrical connection based on at least one wire, a portable computer disk, a hard disk, random access memory (RAM), read only memory (ROM), erasable programmable read only memory (EPROM or flash memory). flash memory), fiber optics, portable compact disk read-only memory (CD-ROM), optical storage devices, magnetic storage devices, or a suitable combination of the above.
  • an image processing method including:
  • a line collider is generated according to the drawing trajectory triggered by the user in the screen corresponding to the current scene; wherein the current scene includes multiple virtual colliders; the line collider is composed of a plurality of box colliders with set shapes;
  • a first result is generated, in response to the line collision body and the first virtual collision object At least one of the objects does not collide with the second virtual collider, and a second result is generated.
  • the method before generating the line collision body according to the drawing trajectory triggered by the user in the screen corresponding to the current scene, the method also includes:
  • the image is fused with the second virtual collision body to obtain a new second virtual collision body; wherein the image is a static image or a dynamic image.
  • line collision bodies are generated based on the drawing trajectory triggered by the user in the screen corresponding to the current scene, including:
  • a line collision body is generated based on the drawing trajectory that the user has completed in the screen corresponding to the current scene.
  • line collision bodies are generated based on the drawing trajectory triggered by the user in the screen corresponding to the current scene, including:
  • the multiple box colliders are connected in series to obtain a line collider.
  • first touch screen point and the second touch screen point as two vertices of the set shape to generate a box collision body of the set shape includes:
  • the box collider of the set shape is generated based on two adjacent touch screen points after interpolation point processing.
  • inserting a touch screen point between the first touch screen point and the second touch screen point includes:
  • line collision bodies are generated based on the drawing trajectory triggered by the user in the screen corresponding to the current scene, including:
  • the overlapping region is skipped when generating the shaped box collider.
  • detecting whether at least one of the line collision body and the first virtual collision object collides with the second virtual collision body includes:
  • detecting whether at least one of the line collision body and the first virtual collision object collides with the second virtual collision body includes:
  • the method further includes:
  • a selection window for returning to the current scene pops up for the user to choose to return to the current scene
  • the method After generating the second result, the method also includes:
  • a selection window for jumping to the next scene pops up for the user to choose to jump to the next scene.

Landscapes

  • Engineering & Computer Science (AREA)
  • Multimedia (AREA)
  • Theoretical Computer Science (AREA)
  • Human Computer Interaction (AREA)
  • Physics & Mathematics (AREA)
  • General Physics & Mathematics (AREA)
  • Computer Vision & Pattern Recognition (AREA)
  • Processing Or Creating Images (AREA)

Abstract

本公开实施例公开了一种图像处理方法、装置、设备及存储介质。根据用户在当前场景对应的屏幕中触发的绘制轨迹生成线碰撞体;其中,所述当前场景包括多个虚拟碰撞体;所述线碰撞体由多个设定形状的盒碰撞体构成;控制所述线碰撞体和所述当前场景中的第一虚拟碰撞体按照设定方式运动;检测所述线碰撞体和所述第一虚拟碰撞物体中的至少之一是否与第二虚拟碰撞体发生碰撞;若发生碰撞,则生成第一结果,若未发生碰撞,则生成第二结果。

Description

图像处理方法、装置、设备及存储介质
本公开要求在2022年3月29日提交中国专利局、申请号为202210325298.8的中国专利申请的优先权,以上申请的全部内容通过引用结合在本公开中。
技术领域
本公开实施例涉及图像处理技术领域,例如涉及一种图像处理方法、装置、设备及存储介质。
背景技术
在基于设定游戏引擎开发的电子游戏中,对于可能产生碰撞现象的虚拟物体,通常采用在每个虚拟物体上分别设置一个碰撞体的方式检测是否发生碰撞。
相关技术的游戏中,生成的碰撞体多为具有一定形状的碰撞体,而无法生成线条形状的碰撞体,限制了游戏的多样性开发。
发明内容
本公开实施例提供一种图像处理方法、装置、设备及存储介质,以实现对线状碰撞体的处理,提高游戏开发的多样性。
第一方面,本公开实施例提供了一种图像处理方法,包括:
根据用户在当前场景对应的屏幕中触发的绘制轨迹生成线碰撞体;其中,所述当前场景包括多个虚拟碰撞体;所述线碰撞体由多个设定形状的盒碰撞体构成;
控制所述线碰撞体和所述当前场景中的第一虚拟碰撞体按照设定方式运动;
检测所述线碰撞体和所述第一虚拟碰撞物体中的至少之一是否与第二虚拟碰撞体发生碰撞;
响应于所述线碰撞体和所述第一虚拟碰撞物体中的至少之一与所述第二虚拟碰撞体发生碰撞,生成第一结果,响应于所述线碰撞体和所述第一虚拟碰撞物体中的至少之一与所述第二虚拟碰撞体未发生碰撞,生成第二结果。
第二方面,本公开实施例还提供了一种图像处理装置,包括:
线碰撞体生成模块,设置为根据用户在当前场景对应的屏幕中触发的绘制轨迹生成线碰撞体;其中,所述当前场景包括多个虚拟碰撞体;所述线碰撞体由多个设定形状的盒碰撞体构成;
运动控制模块,设置为控制所述线碰撞体和所述当前场景中的第一虚拟碰撞体按照设定方式运动;
碰撞检测模块,设置为检测所述线碰撞体和所述第一虚拟碰撞物体中的至少之一是否与第二虚拟碰撞体发生碰撞;
结果生成模块,设置为响应于所述线碰撞体和所述第一虚拟碰撞物体中的至少之一与所述第二虚拟碰撞体若发生碰撞,则生成第一结果,响应于所述线碰撞体和所述第一虚拟碰撞物体中的至少之一与所述第二虚拟碰撞体未发生碰撞,生成第二结果。
第三方面,本公开实施例还提供了一种电子设备,所述电子设备包括:
处理装置;
存储装置,设置为存储程序;
当所述程序被所述处理装置执行,使得所述处理装置实现如本公开实施例所述的图像处理方法。
第四方面,本公开实施例还提供了一种计算机可读介质,所述计算机可读介质上存储有计算机程序,该计算机程序被处理装置执行时实现如本公开实施例所述的图像处理方法。
附图说明
图1是本公开实施例中的一种图像处理方法的流程图;
图2是本公开实施例中的生成线碰撞体的示例图;
图3是本公开实施例中的场景的示例图;
图4是本公开实施例中的一种图像处理装置的结构示意图;
图5是本公开实施例中的一种电子设备的结构示意图。
具体实施方式
下面将参照附图描述本公开的实施例。虽然附图中显示了本公开的一些实施例,然而应当理解的是,本公开可以通过各种形式来实现,而且不应该被解释为限于这里阐述的实施例。应当理解的是,本公开的附图及实施例仅用于示例性作用。
应当理解,本公开的方法实施方式中记载的各个步骤可以按照不同的顺序执行,和/或并行执行。此外,方法实施方式可以包括附加的步骤和/或省略执行示出的步骤。
本文使用的术语“包括”及其变形是开放性包括,即“包括但不限于”。术语“基于”是“至少部分地基于”。术语“一个实施例”表示“至少一个实施例”;术语“另一实施例”表示“至少一个另外的实施例”;术语“一些实施例”表示“至少一些实施例”。其他术语的相关定义将在下文描述中给出。
需要注意,本公开中提及的“第一”、“第二”等概念仅用于对不同的装置、模块或单元进行区分,并非用于限定这些装置、模块或单元所执行的功能的顺序或者相互依存关系。
需要注意,本公开中提及的“一个”、“多个”的修饰是示意性的,本领域技术人员应当理解,除非在上下文另有明确指出,否则应该理解为“一个或多个”。
本公开实施方式中的多个装置之间所交互的消息或者信息的名称仅用于说明性的目的,而并不是用于对这些消息或信息的范围进行限制。
本实施例的方案可以应用于游戏场景中,该游戏包含多个关卡,每个关卡对应一个场景,在每个场景中设置有多个虚拟碰撞体,虚拟碰撞体可以是静态碰撞体或者动态碰撞体。虚拟碰撞体可以被设置于设定位置固定不动,动态碰撞体可以按照设定方式在当前关卡的场景中运动,在运动过程中,可以与其他虚拟碰撞体发生碰撞。
图1为本公开实施例一提供的一种图像处理方法的流程图,本实施例可适用于对线碰撞体的碰撞进行处理的情况,该方法可以由图像处理装置来执行,该装置可由硬件和/或软件组成,并一般可集成在具有图像处理方法功能的设备中,该设备可以是服务器、移动终端或服务器集群等电子设备。如图1所示,该方法可以包括如下步骤:
S110,根据用户在当前场景对应的屏幕中触发的绘制轨迹生成线碰撞体。
例如,当前场景包括多个虚拟碰撞体。当前场景可以是游戏场景中其中一个关卡对应的场景。线碰撞体由多个设定形状的盒碰撞体(Box Collider)构成。
本实施例中,当用户通过娱乐应用程序(Application,APP)进入游戏一关卡对应的当前场景中时,在当前场景中,APP通过文字信息展示该关卡需要完成的任务,用户根据任务提示开始触屏绘制线条,用户绘制完成后,基于获取到的绘制轨迹生成线碰撞体。
可选的,根据用户在当前场景对应的屏幕中触发的绘制轨迹生成线碰撞体的过程可以是:当绘制时刻达到计时结束时间时,根据用户在在当前场景对应的屏幕中已完成的绘制轨迹生成线碰撞体;或者,当检测到用户停止绘制,则用户在在当前场景对应的屏幕中已完成的绘制轨迹生成线碰撞体。
例如,停止绘制可以是检测到用户手指离开屏幕或者检测到用户手指停在一位置不动。示例性的,当进入当前场景时,开始绘制倒计时(例如10秒),用户开始触屏绘制线条,当倒计时结束或者用户停止绘制时,获取已完成的绘制轨迹,并根据已完成的绘制轨迹生成线碰撞体。本实施例中,对绘制进行倒计时,并根据用户在在当前场景对应的屏幕中已完成的绘制轨迹生成线碰撞体,可以提高生成的线碰撞体的准确性。
可选的,根据用户在当前场景对应的屏幕中触发的绘制轨迹生成线碰撞体的方式可以是:获取用户在绘制过程中每相邻两帧的触屏点,作为第一触屏点和第二触屏点;将第一触屏点和第二触屏点作为设定形状的两个顶点,以生成设定形状的盒碰撞体,获得多个盒碰撞体;将多个盒碰撞体进行串联,获得线碰撞体。
在一实施例中,设定形状可以是矩形,则第一触屏点和第二触屏点作为矩形对角线上的两个顶点。示例性的,将第一触屏点和第二触屏点作为对角线的两个顶点生成矩形碰撞体,这样多个矩形碰撞体串联在一起形成线碰撞体。示例性的,图2是本实施例中生成线碰撞体的示例图。如图2所示,获取绘制轨迹上的触屏点,将相邻的触屏点作为矩形的对角线顶点以生成矩形碰撞体,多个矩形碰撞体串联生成线碰撞体。本实施例中,将多个矩形碰撞体串联生成线碰撞体,使得线碰撞体可以进行碰撞检测。
可选的,将第一触屏点和第二触屏点作为设定形状的两个顶点,以生成设定形状的盒碰撞体的方式可以是:若第一触屏点和第二触屏点的横向距离大于屏幕横向长度的设定比例,和/或第一触屏点和第二触屏点的纵向距离大于屏幕纵向长度的设定比例,则在第一触屏点和第二触屏点间插入触屏点;基于插点处理后的相邻两个触屏点生成设定形状的盒碰撞体。
在一实施例中,设定比例可以设置为0.03-0.05之间的任意值,例如:设定比例设置为0.04。本实施例中,若用户在屏幕绘制的速度较快,则会使得第一触屏点和第二触屏点的横向距离大于屏幕横向长度(width)的设定比例,和/或第一触屏点和第二触屏点的纵向距离大于屏幕纵向长度(height)的设定比例。
在第一触屏点和第二触屏点间插入触屏点的方式可以是:横向距离以屏幕横向长度的设定比例为单位以及纵向距离以屏幕纵向长度的设定比例为单位插入触屏点,从而使得插点处理后的相邻两个触屏点的横向距离小于或等于屏幕横向长度的设定比例且纵向距离小于或等于屏幕纵向长度的设定比例。本实施例中,在第一触屏点和第二触屏点间插入触屏点,使得生产的矩形碰撞体的尺寸与线条相匹配。
可选的,在第一触屏点和第二触屏点间插入触屏点的方式可以是:获取第一触屏点和第二触屏点间的连线;采用设定标准在连线上插入至少一个触屏点。
其中,设定标准为相邻触屏点的横向距离小于或等于屏幕横向长度的设定比例且相邻触屏点的纵向距离小于或等于屏幕纵向长度的设定比例。示例性的,在连线上插入至少一个触屏点的过程可以是:首先计算以屏幕横向长度的设定比例为宽、以屏幕纵向长度的设定比例为高构成的矩形的对角线长度,然后以对角线长度为单位对第一触屏点和第二触屏点间的连线进行分割,从而实现触屏点的插入。本实施例中,在第一触屏点和第二触屏点间的连线上插入触屏点,可以保证生成的线碰撞体的平滑性。
可选的,当生成的盒碰撞体超过设定值时(例如:200),则停止生成盒碰撞体。可以提高线碰撞体的性能。
可选的,据用户在当前场景对应的屏幕中触发的绘制轨迹生成线碰撞体的方式可以是:若绘制轨迹经过当前场景中的虚拟碰撞体,则获取绘制轨迹与虚拟碰撞体的重叠区域;在生成设定形状的盒碰撞体时,跳过重叠区域。
本实施例中,若绘制轨迹经过当前场景中的虚拟碰撞体,则在该虚拟碰撞体内不再生成盒碰撞体。这样设置可以防止生成的碰撞体在碰撞时发生剧烈抖动,而影响游戏效果。
S120,控制线碰撞体和当前场景中的第一虚拟碰撞体按照设定方式运动。
例如,第一虚拟碰撞体可以当前场景的动态碰撞体,可以是通过在虚拟物体上设置碰撞器而生成的。虚拟物体可以是基于当前场景需求设置的,例如:虚拟物体可以是虚拟石头、虚拟炸弹、虚拟子弹等。设定方式可以是在当前场景中设置力场,使得线碰撞体和第一虚拟碰撞体在该力场的作用下运动。示例性的,设置的立场可以是重力场,使得线碰撞体和第一虚拟碰撞体进行自由落体运动。
S130,检测线碰撞体和/或第一虚拟碰撞物体是否与第二虚拟碰撞体发生碰撞,若发生碰撞,则执行S140,若未发生碰撞,则执行S150。
例如,第二虚拟碰撞体可以是当前场景中的静态或动态碰撞体,可以是在虚拟形象上设置碰撞器生成的。虚拟形象例如可以是:动漫形象或者动物形象等。
可选的,第二虚拟碰撞体的生成方式可以是:将图像与第二虚拟碰撞体进行融合,获得新的第二虚拟碰撞体。
其中,图像为静态图像或者动态图像。静态图像可以从本地数据库或者服务器数据库中获得的。动态图像可以是录制的视频或者实时采集的图像。本实施例中,用户在启动娱乐APP的同时,启动终端设备的摄像头,摄像头对当前画面(例如:用户面部)进行实时采集,将采集的图像与第二虚拟碰撞体进行融合,获得新的第二虚拟碰撞体。本实施例中,将图像与所述第二虚拟碰撞体进 行融合,可以提高趣味性。
本实施例中,线碰撞体和第一虚拟碰撞物体在运动过程中,可以在线碰撞体和第一虚拟碰撞物体发生碰撞前,线碰撞体和第一虚拟碰撞物体中的至少之一与第二虚拟碰撞体发生碰撞;或者,在线碰撞体和第一虚拟碰撞物体发生碰撞后,线碰撞体和第一虚拟碰撞物体中的至少之一与第二虚拟碰撞体发生碰撞。
可选的,检测线碰撞体和第一虚拟碰撞物体中的至少之一是否与第二虚拟碰撞体发生碰撞的方式可以是:检测线碰撞体和第一虚拟碰撞物体中的至少之一在设定时长内是否与第二虚拟碰撞体发生碰撞。
本实施例中,线碰撞体和第一虚拟碰撞物体开始运动时,进行倒计时(例如5秒),检测倒计时结束之前线碰撞体和第一虚拟碰撞物体中的至少之一在设定时长内是否与第二虚拟碰撞体发生碰撞。采用倒计时的方式,可以提高趣味性。
可选的,检测线碰撞体和第一虚拟碰撞物体中的至少之一是否与第二虚拟碰撞体发生碰撞的过程可以是:若线碰撞体和第一虚拟碰撞体发生碰撞,确定线碰撞体碰撞后的第一运动轨迹和第一虚拟碰撞体碰撞后的第二运动轨迹;控制线碰撞体按照第一运动轨迹继续运动,控制第一虚拟碰撞体按照第二运动轨迹继续运动;检测继续运动后线碰撞体和第一虚拟碰撞物体中的至少之一是否与第二虚拟碰撞体发生碰撞。
本实施例中,确定线碰撞体碰撞后的第一运动轨迹和第一虚拟碰撞体碰撞后的第二运动轨迹的方式可以是:在线碰撞体和第一虚拟碰撞体发生碰撞之后,采用物理学原理对线碰撞体和第一虚拟碰撞体进行受力分析,获得线碰撞体和第一虚拟碰撞体在碰撞后多个时刻的运动状态(包括速度、加速度、位置等信息),从而基于多个时刻的运动状态获得线碰撞体碰撞后的第一运动轨迹和第一虚拟碰撞体碰撞后的第二运动轨迹。本实施例中,检测线碰撞体和第一虚拟碰撞物体中的至少之一是否与第二虚拟碰撞体发生碰撞的方式可以采用相关技术任意的碰撞检测方式。示例性的,图3是本实施例中场景的示例图。如图3所示,第一虚拟碰撞体为虚拟石头,线碰撞体为根据用户绘制的轨迹生成的,第二虚拟碰撞体为虚拟人体,线碰撞体和第一虚拟碰撞体碰撞均按照自由落体运动,在运动过程中,二者发生碰撞。本实施例中,确定线碰撞体碰撞后的第一运动轨迹和所述第一虚拟碰撞体碰撞后的第二运动轨迹,可以提高碰撞检测的准确性。
S140,生成第一结果。
例如,第一结果可以是“挑战失败”。本实施例中,线碰撞体和所述第一虚拟碰撞物体中的至少之一与第二虚拟碰撞体发生碰撞,则表明用户绘制而成的线碰撞体未完成挑战任务,则生成“挑战失败”的结果。
可选的,在生成第一结果之后,该方法还包括如下步骤:弹出返回当前场景的选择窗口,以供用户选择返回至所述当前场景。
本实施例中,当“挑战失败”后,用户可以选择返回当前场景继续挑战。
S150,生成第二结果。
例如,第二结果可以是“挑战成功”。本实施例中,线碰撞体和所述第一虚拟碰撞物体中的至少之一未与第二虚拟碰撞体发生碰撞,则表明用户绘制而成的线碰撞体完成挑战任务,则生成“挑战成功”的结果。
可选的,在生成第二结果之后,该方法还包括如下步骤:弹出跳转至下一场景的选择窗口,以供用户选择跳转至下一场景。
本实施例中,当“挑战成功”后,用户可以选择挑战下一场景进行挑战。
本实施例的技术方案,根据用户在当前场景对应的屏幕中触发的绘制轨迹生成线碰撞体;其中,当前场景包括多个虚拟碰撞体;线碰撞体由多个设定形状的盒碰撞体构成;控制线碰撞体和当前场景中的第一虚拟碰撞体按照设定方式运动;检测线碰撞体和第一虚拟碰撞物体中的至少之一是否与第二虚拟碰撞体发生碰撞;若发生碰撞,则生成第一结果,若未发生碰撞,则生成第二结果。本公开实施例提供的图像处理方法,基于用户触发的绘制轨迹生成由多个设定形状的盒碰撞体构成的线碰撞体,可以实现对线状碰撞体的处理,提高游戏开发的多样性。
图4是本公开实施例公开的一种图像处理装置的结构示意图,如图4所示,该装置包括:
线碰撞体生成模块410,设置为根据用户在当前场景对应的屏幕中触发的绘制轨迹生成线碰撞体;其中,当前场景包括多个虚拟碰撞体;线碰撞体由多个设定形状的盒碰撞体构成;
运动控制模块420,设置为控制线碰撞体和当前场景中的第一虚拟碰撞体按照设定方式运动;
碰撞检测模块430,设置为检测线碰撞体和第一虚拟碰撞物体中的至少之一是否与第二虚拟碰撞体发生碰撞;
结果生成模块440,设置为响应于线碰撞体和第一虚拟碰撞物体中的至少之一与第二虚拟碰撞体发生碰撞,生成第一结果,响应于线碰撞体和第一虚拟碰撞物体中的至少之一与第二虚拟碰撞体未发生碰撞,生成第二结果。
可选的,该方法还包括:第二虚拟碰撞体生成模块,设置为:
将图像与第二虚拟碰撞体进行融合,获得新的第二虚拟碰撞体;其中,图像为静态图像或者动态图像。
可选的,线碰撞体生成模块410,还设置为:
响应于绘制时刻达到计时结束时间,根据用户在在当前场景对应的屏幕中已完成的绘制轨迹生成线碰撞体;或者,
响应于检测到用户停止绘制,根据用户在在当前场景对应的屏幕中已完成的绘制轨迹生成线碰撞体。
可选的,线碰撞体生成模块410,还设置为:
获取用户在绘制过程中每相邻两帧的触屏点,作为第一触屏点和第二触屏点;
将第一触屏点和第二触屏点作为设定形状的两个顶点,以生成设定形状的盒碰撞体,获得多个盒碰撞体;
将多个盒碰撞体进行串联,获得线碰撞体。
可选的,线碰撞体生成模块410,还设置为:
响应于第一触屏点和第二触屏点的横向距离大于屏幕横向长度的设定比例,和/或响应于第一触屏点和第二触屏点的纵向距离大于屏幕纵向长度的设定比例,在第一触屏点和第二触屏点间插入触屏点;
基于插点处理后的相邻两个触屏点生成设定形状的盒碰撞体。
可选的,线碰撞体生成模块410,还设置为:
获取第一触屏点和第二触屏点间的连线;
采用设定标准在连线上插入至少一个触屏点;其中,设定标准为相邻触屏点的横向距离小于或等于屏幕横向长度的设定比例且相邻触屏点的纵向距离小于或等于屏幕纵向长度的设定比例。
可选的,线碰撞体生成模块410,还设置为:
响应于绘制轨迹经过当前场景中的虚拟碰撞体,获取绘制轨迹与虚拟碰撞体的重叠区域;
在生成设定形状的盒碰撞体时,跳过重叠区域。
可选的,碰撞检测模块430,还设置为:
响应于线碰撞体和第一虚拟碰撞体发生碰撞,确定线碰撞体碰撞后的第一运动轨迹和第一虚拟碰撞体碰撞后的第二运动轨迹;
控制线碰撞体按照第一运动轨迹继续运动,控制第一虚拟碰撞体按照第二运动轨迹继续运动;
检测继续运动后线碰撞体和第一虚拟碰撞物体中的至少之一是否与第二虚拟碰撞体发生碰撞。
可选的,碰撞检测模块430,还设置为:
检测线碰撞体和第一虚拟碰撞物体中的至少之一在设定时长内是否与第二虚拟碰撞体发生碰撞。
可选的,该方法还包括:选择窗口弹出模块,设置为:
在生成第一结果之后,弹出返回当前场景的选择窗口,以供用户选择返回至当前场景;
在生成第二结果之后,弹出跳转至下一场景的选择窗口,以供用户选择跳转至下一场景。
上述装置可执行本公开前述所有实施例所提供的方法,具备执行上述方法相应的功能模块和有益效果。未在本实施例中详尽描述的技术细节,可参见本公开前述所有实施例所提供的方法。
下面参考图5,其示出了适于用来实现本公开实施例的电子设备300的结构示意图。本公开实施例中的电子设备可以包括诸如移动电话、笔记本电脑、数字广播接收器、个人数字助理(Personal Digital Assistant,PDA)、平板电脑(Portable Android Device,PAD)、便携式多媒体播放器(Portable Media Player,PMP)、车载终端(例如车载导航终端)等的移动终端以及诸如数字电视机(也即数字TV)、台式计算机等的固定终端,或者各种形式的服务器,如独立服务器或者服务器集群。图5示出的电子设备仅仅是一个示例。
如图5所示,电子设备300可以包括处理装置(例如中央处理器、图形处理器等)301,处理装置301可以根据存储在只读存储装置(Read Only Memory,ROM)302中的程序或者从存储装置308加载到随机访问存储装置(Random Access Memory,RAM)303中的程序而执行各种适当的动作和处理。在RAM 303中,还存储有电子设备300操作所需的各种程序和数据。处理装置301、ROM 302以及RAM 303通过总线304彼此相连。输入/输出(Input/Output,I/O)接口305也连接至总线304。
通常,以下装置可以连接至I/O接口305:包括例如触摸屏、触摸板、键盘、鼠标、摄像头、麦克风、加速度计、陀螺仪等的输入装置306;包括例如液晶显示器(Liquid Crystal Display,LCD)、扬声器、振动器等的输出装置307;包括例如磁带、硬盘等的存储装置308;以及通信装置309。通信装置309可以允许电子设备300与其他设备进行无线或有线通信以交换数据。虽然图5示出了具有各种装置的电子设备300,但是应理解的是,并不要求实施或具备所有示出的装置。可以替代地实施或具备更多或更少的装置。
在一实施例中,根据本公开的实施例,上文参考流程图描述的过程可以被实现为计算机软件程序。例如,本公开的实施例包括一种计算机程序产品,其包括承载在计算机可读介质上的计算机程序,该计算机程序包含用于执行词语的推荐方法的程序代码。在这样的实施例中,该计算机程序可以通过通信装置309从网络上被下载和安装,或者从存储装置308被安装,或者从ROM 302被安装。在该计算机程序被处理装置301执行时,执行本公开实施例的方法中限定的上述功能。
需要说明的是,本公开上述的计算机可读介质可以是计算机可读信号介质或者计算机可读存储介质或者是上述两者的组合。计算机可读存储介质例如可 以是电、磁、光、电磁、红外线、或半导体的系统、装置或器件,或者以上的组合。计算机可读存储介质的示例可以包括:具有至少一个导线的电连接、便携式计算机磁盘、硬盘、随机访问存储器(RAM)、只读存储器(ROM)、可擦式可编程只读存储器(如电子可编程只读存储器(Electronic Programable Read Only Memory,EPROM)或闪存)、光纤、便携式紧凑磁盘只读存储器(Compact Disc-Read Only Memory,CD-ROM)、光存储器件、磁存储器件、或者上述的合适的组合。在本公开中,计算机可读存储介质可以是包含或存储程序的有形介质,该程序可以被指令执行系统、装置或者器件使用或者与其结合使用。而在本公开中,计算机可读信号介质可以包括在基带中或者作为载波一部分传播的数据信号,其中承载了计算机可读的程序代码。这种传播的数据信号可以采用多种形式,包括电磁信号、光信号或上述的合适的组合。计算机可读信号介质还可以是计算机可读存储介质以外的任何计算机可读介质,该计算机可读信号介质可以发送、传播或者传输用于由指令执行系统、装置或者器件使用或者与其结合使用的程序。计算机可读介质上包含的程序代码可以用任何适当的介质传输,包括:电线、光缆、射频(Radio Frequency,RF)等,或者上述的合适的组合。
在一些实施方式中,客户端、服务器可以利用诸如超文本传输协议(HyperText Transfer Protocol,HTTP)之类的当前已知或未来研发的网络协议进行通信,并且可以与任意形式或介质的数字数据通信(例如,通信网络)互连。通信网络的示例包括局域网(Local Area Network,LAN),广域网(Wide Area Network,WAN),网际网(例如,互联网)以及端对端网络(例如,ad hoc端对端网络),以及当前已知或未来研发的网络。
上述计算机可读介质可以是上述电子设备中所包含的;也可以是单独存在,而未装配入该电子设备中。
上述计算机可读介质承载有至少一个程序,当上述至少一个程序被该电子设备执行时,使得该电子设备:根据用户在当前场景对应的屏幕中触发的绘制轨迹生成线碰撞体;其中,所述当前场景包括多个虚拟碰撞体;所述线碰撞体由多个设定形状的盒碰撞体构成;控制所述线碰撞体和所述当前场景中的第一虚拟碰撞体按照设定方式运动;检测所述线碰撞体和所述第一虚拟碰撞物体中的至少之一是否与第二虚拟碰撞体发生碰撞;响应于所述线碰撞体和所述第一虚拟碰撞物体中的至少之一与所述第二虚拟碰撞体发生碰撞,生成第一结果,响应于所述线碰撞体和所述第一虚拟碰撞物体中的至少之一与所述第二虚拟碰撞体未发生碰撞,生成第二结果。
可以以一种或多种程序设计语言或其组合来编写用于执行本公开的操作的计算机程序代码,上述程序设计语言包括面向对象的程序设计语言诸如Java、Smalltalk、C++,还包括常规的过程式程序设计语言诸如“C”语言或类似的程序设计语言。程序代码可以完全地在用户计算机上执行、部分地在用户计算机上执行、作为一个独立的软件包执行、部分在用户计算机上部分在远程计算机 上执行、或者完全在远程计算机或服务器上执行。在涉及远程计算机的情形中,远程计算机可以通过任意种类的网络包括局域网(LAN)或广域网(WAN)连接到用户计算机,或者,可以连接到外部计算机(例如利用因特网服务提供商来通过因特网连接)。
附图中的流程图和框图,图示了按照本公开各种实施例的系统、方法和计算机程序产品的可能实现的体系架构、功能和操作。在这点上,流程图或框图中的每个方框可以代表一个模块、程序段、或代码的一部分,该模块、程序段、或代码的一部分包含至少一个用于实现规定的逻辑功能的可执行指令。也应当注意,在有些作为替换的实现中,方框中所标注的功能也可以以不同于附图中所标注的顺序发生。例如,两个接连地表示的方框实际上可以基本并行地执行,它们有时也可以按相反的顺序执行,这依所涉及的功能而定。也要注意的是,框图和/或流程图中的每个方框、以及框图和/或流程图中的方框的组合,可以用执行规定的功能或操作的专用的基于硬件的系统来实现,或者可以用专用硬件与计算机指令的组合来实现。
描述于本公开实施例中所涉及到的单元可以通过软件的方式实现,也可以通过硬件的方式来实现。其中,单元的名称在某种情况下并不构成对该单元本身的限定。
本文中以上描述的功能可以至少部分地由至少一个硬件逻辑部件来执行。例如,可以使用的示范类型的硬件逻辑部件包括:现场可编程门阵列(Field-Programmable Gate Array,FPGA)、专用集成电路(Application Specific Integrated Circuit,ASIC)、专用标准产品(Application Specific Standard Parts,ASSP)、片上系统(System on Chip,SOC)、复杂可编程逻辑设备(Complex Programmable Logic Device,CPLD)等。
在本公开的上下文中,机器可读介质可以是有形的介质,其可以包含或存储以供指令执行系统、装置或设备使用或与指令执行系统、装置或设备结合地使用的程序。机器可读介质可以是机器可读信号介质或机器可读储存介质。机器可读介质可以包括电子的、磁性的、光学的、电磁的、红外的、或半导体系统、装置或设备,或者上述内容的合适组合。机器可读存储介质的示例可以包括基于至少一个线的电气连接、便携式计算机盘、硬盘、随机存取存储器(RAM)、只读存储器(ROM)、可擦除可编程只读存储器(EPROM或快闪存储器)、光纤、便捷式紧凑盘只读存储器(CD-ROM)、光学储存设备、磁储存设备、或上述内容的合适组合。
根据本公开实施例的一个或多个实施例,本公开实施例公开了一种图像处理方法,包括:
根据用户在当前场景对应的屏幕中触发的绘制轨迹生成线碰撞体;其中,所述当前场景包括多个虚拟碰撞体;所述线碰撞体由多个设定形状的盒碰撞体构成;
控制所述线碰撞体和所述当前场景中的第一虚拟碰撞体按照设定方式运动;
检测所述线碰撞体和所述第一虚拟碰撞物体中的至少之一是否与第二虚拟碰撞体发生碰撞;
响应于所述线碰撞体和所述第一虚拟碰撞物体中的至少之一与所述第二虚拟碰撞体发生碰撞,生成第一结果,响应于所述线碰撞体和所述第一虚拟碰撞物体中的至少之一与所述第二虚拟碰撞体未发生碰撞,生成第二结果。
进一步地,在根据用户在当前场景对应的屏幕中触发的绘制轨迹生成线碰撞体之前,该方法还包括:
将图像与所述第二虚拟碰撞体进行融合,获得新的第二虚拟碰撞体;其中,所述图像为静态图像或者动态图像。
进一步地,根据用户在当前场景对应的屏幕中触发的绘制轨迹生成线碰撞体,包括:
响应于绘制时刻达到计时结束时间,根据用户在在当前场景对应的屏幕中已完成的绘制轨迹生成线碰撞体;或者,
响应于检测到用户停止绘制,根据用户在在当前场景对应的屏幕中已完成的绘制轨迹生成线碰撞体。
进一步地,根据用户在当前场景对应的屏幕中触发的绘制轨迹生成线碰撞体,包括:
获取用户在绘制过程中每相邻两帧的触屏点,作为第一触屏点和第二触屏点;
将所述第一触屏点和所述第二触屏点作为所述设定形状的两个顶点,以生成所述设定形状的盒碰撞体,获得多个盒碰撞体;
将所述多个盒碰撞体进行串联,获得线碰撞体。
进一步地,将所述第一触屏点和所述第二触屏点作为所述设定形状的两个顶点,以生成所述设定形状的盒碰撞体,包括:
响应于所述第一触屏点和所述第二触屏点的横向距离大于屏幕横向长度的设定比例,和/或响应于所述第一触屏点和所述第二触屏点的纵向距离大于屏幕纵向长度的设定比例,在所述第一触屏点和所述第二触屏点间插入触屏点;
基于插点处理后的相邻两个触屏点生成所述设定形状的盒碰撞体。
进一步地,在所述第一触屏点和所述第二触屏点间插入触屏点,包括:
获取所述第一触屏点和所述第二触屏点间的连线;
采用设定标准在所述连线上插入至少一个触屏点;其中,所述设定标准为相邻触屏点的横向距离小于或等于屏幕横向长度的设定比例且相邻触屏点的纵向距离小于或等于屏幕纵向长度的设定比例。
进一步地,根据用户在当前场景对应的屏幕中触发的绘制轨迹生成线碰撞体,包括:
响应于所述绘制轨迹经过所述当前场景中的虚拟碰撞体,获取所述绘制轨迹与所述虚拟碰撞体的重叠区域;
在生成所述设定形状的盒碰撞体时,跳过所述重叠区域。
进一步地,检测所述线碰撞体和所述第一虚拟碰撞物体中的至少之一是否与第二虚拟碰撞体发生碰撞,包括:
响应于所述线碰撞体和所述第一虚拟碰撞体发生碰撞,确定所述线碰撞体碰撞后的第一运动轨迹和所述第一虚拟碰撞体碰撞后的第二运动轨迹;
控制所述线碰撞体按照所述第一运动轨迹继续运动,控制所述第一虚拟碰撞体按照所述第二运动轨迹继续运动;
检测继续运动后所述线碰撞体和所述第一虚拟碰撞物体中的至少之一是否与第二虚拟碰撞体发生碰撞。
进一步地,检测所述线碰撞体和所述第一虚拟碰撞物体中的至少之一是否与第二虚拟碰撞体发生碰撞,包括:
检测所述线碰撞体和所述第一虚拟碰撞物体中的至少之一在设定时长内是否与第二虚拟碰撞体发生碰撞。
进一步地,在生成第一结果之后,该方法还包括:
弹出返回当前场景的选择窗口,以供用户选择返回至所述当前场景;
在生成第二结果之后,该方法还包括:
弹出跳转至下一场景的选择窗口,以供用户选择跳转至下一场景。
应该理解,可以使用上面所示的各种形式的流程,重新排序、增加或删除步骤。例如,本公开中记载的各步骤可以并行地执行也可以顺序地执行也可以不同的次序执行,只要能够实现本公开的技术方案所期望的结果。

Claims (13)

  1. 一种图像处理方法,包括:
    根据用户在当前场景对应的屏幕中触发的绘制轨迹生成线碰撞体;其中,所述当前场景包括多个虚拟碰撞体;所述线碰撞体由多个设定形状的盒碰撞体构成;
    控制所述线碰撞体和所述当前场景中的第一虚拟碰撞体按照设定方式运动;
    检测所述线碰撞体和所述第一虚拟碰撞物体中的至少之一是否与第二虚拟碰撞体发生碰撞;
    响应于所述线碰撞体和所述第一虚拟碰撞物体中的至少之一与所述第二虚拟碰撞体发生碰撞,生成第一结果,响应于所述线碰撞体和所述第一虚拟碰撞物体中的至少之一与所述第二虚拟碰撞体未发生碰撞,生成第二结果。
  2. 根据权利要求1所述的方法,在根据用户在当前场景对应的屏幕中触发的绘制轨迹生成线碰撞体之前,所述方法还包括:
    将图像与所述第二虚拟碰撞体进行融合,获得新的第二虚拟碰撞体;其中,所述图像为静态图像或者动态图像。
  3. 根据权利要求1所述的方法,其中,所述根据用户在当前场景对应的屏幕中触发的绘制轨迹生成线碰撞体,包括:
    响应于绘制时刻达到计时结束时间,根据用户在在当前场景对应的屏幕中已完成的绘制轨迹生成线碰撞体;或者,
    响应于检测到用户停止绘制,根据用户在在当前场景对应的屏幕中已完成的绘制轨迹生成线碰撞体。
  4. 根据权利要求1或3所述的方法,其中,所述根据用户在当前场景对应的屏幕中触发的绘制轨迹生成线碰撞体,包括:
    获取用户在绘制过程中每相邻两帧的触屏点,作为第一触屏点和第二触屏点;
    将所述第一触屏点和所述第二触屏点作为所述设定形状的两个顶点,以生成所述设定形状的盒碰撞体,获得多个盒碰撞体;
    将所述多个盒碰撞体进行串联,获得线碰撞体。
  5. 根据权利要求4所述的方法,其中,所述将所述第一触屏点和所述第二触屏点作为所述设定形状的两个顶点,以生成所述设定形状的盒碰撞体,包括:
    响应于所述第一触屏点和所述第二触屏点的横向距离大于屏幕横向长度的设定比例,和/或响应于所述第一触屏点和所述第二触屏点的纵向距离大于屏幕纵向长度的设定比例,在所述第一触屏点和所述第二触屏点间插入触屏点;
    基于插点处理后的相邻两个触屏点生成所述设定形状的盒碰撞体。
  6. 根据权利要求5所述的方法,其中,所述在所述第一触屏点和所述第二触屏点间插入触屏点,包括:
    获取所述第一触屏点和所述第二触屏点之间的连线;
    采用设定标准在所述连线上插入至少一个触屏点;其中,所述设定标准为相邻触屏点的横向距离小于或等于屏幕横向长度的设定比例且相邻触屏点的纵向距离小于或等于屏幕纵向长度的设定比例。
  7. 根据权利要求4所述的方法,其中,所述根据用户在当前场景对应的屏幕中触发的绘制轨迹生成线碰撞体,包括:
    响应于所述绘制轨迹经过所述当前场景中的虚拟碰撞体,获取所述绘制轨迹与所述虚拟碰撞体的重叠区域;
    在生成所述设定形状的盒碰撞体时,跳过所述重叠区域。
  8. 根据权利要求1所述的方法,其中,所述检测所述线碰撞体和所述第一虚拟碰撞物体中的至少之一是否与第二虚拟碰撞体发生碰撞,包括:
    响应于所述线碰撞体和所述第一虚拟碰撞体发生碰撞,确定所述线碰撞体碰撞后的第一运动轨迹和所述第一虚拟碰撞体碰撞后的第二运动轨迹;
    控制所述线碰撞体按照所述第一运动轨迹继续运动,控制所述第一虚拟碰撞体按照所述第二运动轨迹继续运动;
    检测继续运动后所述线碰撞体和所述第一虚拟碰撞物体中的至少之一是否与第二虚拟碰撞体发生碰撞。
  9. 根据权利要求1所述的方法,其中,所述检测所述线碰撞体和所述第一虚拟碰撞物体中的至少之一是否与第二虚拟碰撞体发生碰撞,包括:
    检测所述线碰撞体和所述第一虚拟碰撞物体中的至少之一在设定时长内是否与所述第二虚拟碰撞体发生碰撞。
  10. 根据权利要求9所述的方法,在生成第一结果之后,所述方法还包括:
    弹出返回当前场景的选择窗口,以供用户选择返回至所述当前场景;
    在生成第二结果之后,所述方法还包括:
    弹出跳转至下一场景的选择窗口,以供用户选择跳转至下一场景。
  11. 一种图像处理装置,包括:
    线碰撞体生成模块,设置为根据用户在当前场景对应的屏幕中触发的绘制轨迹生成线碰撞体;其中,所述当前场景包括多个虚拟碰撞体;所述线碰撞体由多个设定形状的盒碰撞体构成;
    运动控制模块,设置为控制所述线碰撞体和所述当前场景中的第一虚拟碰撞体按照设定方式运动;
    碰撞检测模块,设置为检测所述线碰撞体和所述第一虚拟碰撞物体中的至少之一是否与第二虚拟碰撞体发生碰撞;
    结果生成模块,设置为响应于所述线碰撞体和所述第一虚拟碰撞物体中的至少之一与所述第二虚拟碰撞体发生碰撞,生成第一结果,响应于所述线碰撞体和所述第一虚拟碰撞物体中的至少之一与所述第二虚拟碰撞体未发生碰撞,生成第二结果。
  12. 一种电子设备,所述电子设备包括:
    处理装置;
    存储装置,设置为存储程序;
    当所述程序被所述处理装置执行,使得所述处理装置实现如权利要求1-10中任一所述的图像处理方法。
  13. 一种计算机可读介质,所述计算机可读介质上存储有计算机程序,所述计算机程序被处理装置执行时实现如权利要求1-10中任一所述的图像处理方法。
PCT/CN2023/079968 2022-03-29 2023-03-07 图像处理方法、装置、设备及存储介质 WO2023185393A1 (zh)

Applications Claiming Priority (2)

Application Number Priority Date Filing Date Title
CN202210325298.8 2022-03-29
CN202210325298.8A CN114797106A (zh) 2022-03-29 2022-03-29 图像处理方法、装置、设备及存储介质

Publications (1)

Publication Number Publication Date
WO2023185393A1 true WO2023185393A1 (zh) 2023-10-05

Family

ID=82533365

Family Applications (1)

Application Number Title Priority Date Filing Date
PCT/CN2023/079968 WO2023185393A1 (zh) 2022-03-29 2023-03-07 图像处理方法、装置、设备及存储介质

Country Status (2)

Country Link
CN (1) CN114797106A (zh)
WO (1) WO2023185393A1 (zh)

Families Citing this family (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN114797106A (zh) * 2022-03-29 2022-07-29 北京字跳网络技术有限公司 图像处理方法、装置、设备及存储介质

Citations (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20110199302A1 (en) * 2010-02-16 2011-08-18 Microsoft Corporation Capturing screen objects using a collision volume
CN108540454A (zh) * 2018-03-16 2018-09-14 武汉微派网络科技有限公司 碰撞同步方法、客户端及存储介质
JP2019000174A (ja) * 2017-06-12 2019-01-10 株式会社コロプラ 情報処理方法、プログラム及びコンピュータ
CN109857259A (zh) * 2019-02-26 2019-06-07 网易(杭州)网络有限公司 碰撞体交互控制方法及装置、电子设备和存储介质
CN111249719A (zh) * 2020-01-20 2020-06-09 腾讯科技(深圳)有限公司 轨迹提示方法和装置、存储介质及电子装置
CN114797106A (zh) * 2022-03-29 2022-07-29 北京字跳网络技术有限公司 图像处理方法、装置、设备及存储介质

Patent Citations (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20110199302A1 (en) * 2010-02-16 2011-08-18 Microsoft Corporation Capturing screen objects using a collision volume
JP2019000174A (ja) * 2017-06-12 2019-01-10 株式会社コロプラ 情報処理方法、プログラム及びコンピュータ
CN108540454A (zh) * 2018-03-16 2018-09-14 武汉微派网络科技有限公司 碰撞同步方法、客户端及存储介质
CN109857259A (zh) * 2019-02-26 2019-06-07 网易(杭州)网络有限公司 碰撞体交互控制方法及装置、电子设备和存储介质
CN111249719A (zh) * 2020-01-20 2020-06-09 腾讯科技(深圳)有限公司 轨迹提示方法和装置、存储介质及电子装置
CN114797106A (zh) * 2022-03-29 2022-07-29 北京字跳网络技术有限公司 图像处理方法、装置、设备及存储介质

Also Published As

Publication number Publication date
CN114797106A (zh) 2022-07-29

Similar Documents

Publication Publication Date Title
US9454282B2 (en) Sending application input commands over a network
WO2023116653A1 (zh) 元素展示方法、装置、电子设备及存储介质
WO2023071507A1 (zh) 弹幕的控制方法、装置、电子设备和存储介质
WO2023185393A1 (zh) 图像处理方法、装置、设备及存储介质
WO2023078069A1 (zh) 一种直播互动方法、系统及相关装置
CN115576632A (zh) 交互方法、装置、电子设备、存储介质和计算机程序产品
WO2023207989A1 (zh) 虚拟对象的控制方法、装置、设备及存储介质
CN113766303B (zh) 多屏互动方法、装置、设备及存储介质
WO2024016924A1 (zh) 视频处理方法、装置、电子设备及存储介质
CN117244249A (zh) 多媒体数据生成方法、装置、可读介质及电子设备
WO2023116562A1 (zh) 图像展示方法、装置、电子设备及存储介质
WO2023142834A1 (zh) 帧同步数据处理方法、装置、可读介质和电子设备
CN114025116B (zh) 视频生成方法、装置、可读介质和电子设备
CN114419201B (zh) 动画的展示方法、装置、电子设备和介质
CN112040328B (zh) 数据交互方法、装置和电子设备
CN110882537B (zh) 一种交互方法、装置、介质和电子设备
JP2015089485A (ja) ゲームを提供するサーバ及び方法
CN111077984A (zh) 人机交互方法、装置、电子设备及计算机存储介质
CN113694531B (zh) 游戏特效的生成方法、装置、电子设备及计算机可读介质
CN115119033B (zh) 音画同步方法、装置、存储介质以及电子设备
WO2022135018A1 (zh) 动态流体显示方法、装置、电子设备和可读介质
CN115134614B (zh) 任务参数配置方法、装置、电子设备及计算机可读存储介质
CN111539978B (zh) 用于生成解说信息的方法、装置、电子设备和介质
WO2023143318A1 (zh) 一种数据展示方法、装置、电子设备及存储介质
CN115350474A (zh) 虚拟物体的控制方法、装置、设备及介质

Legal Events

Date Code Title Description
121 Ep: the epo has been informed by wipo that ep was designated in this application

Ref document number: 23777771

Country of ref document: EP

Kind code of ref document: A1