Search

CN-115531861-B - Vibration control method, device, chip and medium of motor

CN115531861BCN 115531861 BCN115531861 BCN 115531861BCN-115531861-B

Abstract

The embodiment of the application discloses a motor vibration control method, a motor vibration control device, a motor vibration control chip and a motor vibration control medium. And determining the target gun type by using the gun type image to be identified. Thus, the target gun type used by the user in the current game can be accurately determined, and the motor vibration information is generated by utilizing the preset vibration information of the preset target gun type and is used for controlling the motor to vibrate so that the motor can generate the vibration corresponding to the target gun type. The game experience of the user is enhanced by controlling the motor to generate corresponding specific shock sense aiming at specific gun type.

Inventors

  • MIAO LILIN
  • TONG XIAOBIN

Assignees

  • 上海艾为电子技术股份有限公司

Dates

Publication Date
20260505
Application Date
20210630

Claims (9)

  1. 1. A vibration control method of a motor, the method comprising: Obtaining a gun type display image from a target game image, and performing image processing on the gun type display image to obtain a gun type image to be identified, wherein the gun type image to be identified consists of black pixel points and white pixel points; The method comprises the steps of determining a target gun type corresponding to a gun type display image by utilizing the gun type image to be identified, wherein the steps comprise sequentially obtaining the number of target color pixel points of each pixel area in the gun type image to be identified to obtain a number sequence, wherein the pixel areas are pixel rows or pixel columns, the target color pixel points are white pixel points or black pixel points, selecting a target sequence from a preset sequence according to the number sequence, wherein the preset sequence is a sequence consisting of the number of target color pixel points of each pixel area in a standard gun type image corresponding to the preset gun type, and taking the preset gun type corresponding to the target sequence as the target gun type; generating motor vibration control information based on preset vibration information corresponding to the target gun type, wherein the motor vibration control information is used for controlling motor vibration; before the target sequence is selected from the preset sequence according to the number sequence, the method further comprises the step of performing equal-length processing on the number sequence or the preset sequence if the image size of the standard gun type image is different from the image size of the gun type image to be identified, wherein the step is specifically that the preset sequence is adjusted to obtain an updated preset sequence if the image size of the standard gun type image is larger than the image size of the gun type image to be identified, and the number sequence is adjusted to obtain the updated number sequence if the image size of the gun type image to be identified is larger than the image size of the standard gun type image.
  2. 2. The method of claim 1, wherein the adjusting the preset sequence to obtain an updated preset sequence comprises: Determining a first step size and a first proportion according to the image size of the standard gun type image and the image size of the gun type image to be identified; Determining a first target pixel area in the standard gun-type image according to the first step length; Acquiring the number of target color pixel points in the first target pixel area as a first pixel number; and obtaining an updated preset sequence according to the first pixel number and the first proportion.
  3. 3. The method of claim 1, wherein said adjusting the number sequence to obtain an updated number sequence comprises: Determining a second step size and a second proportion according to the image size of the standard gun type image and the image size of the gun type image to be identified; determining a second target pixel area in the gun-type image to be identified according to the second step length; acquiring the number of target color pixel points in the second target pixel area as second pixel number; and obtaining an updated number sequence according to the second pixel number and the second proportion.
  4. 4. The method according to claim 1, wherein selecting the target sequence from the preset sequences according to the number sequence comprises: And taking the preset sequence with the smallest difference value or the ratio closest to 1 with the number sequence as a target sequence.
  5. 5. The method of claim 1, wherein prior to said capturing the gun-type display image from the target game image, the method further comprises: if the image acquisition condition is met, acquiring game images to be processed according to a preset time interval, and identifying gun-type display identifiers of the game images to be processed; And if the to-be-processed game image has a gun-type display mark, taking the to-be-processed game image as a target game image.
  6. 6. The method of claim 1, wherein before sequentially obtaining the number of target color pixels of each pixel region in the gun-shaped image to be identified, and obtaining a number sequence, the method further comprises: Acquiring the image size of the gun type image to be identified, and determining a digital area according to the image size of the gun type image to be identified; and setting the color of the pixel points in the digital region as background color to obtain an updated gun-type image to be identified.
  7. 7. A vibration control device of a motor, the device comprising: the first acquisition unit is used for acquiring a gun-shaped display image from a target game image, and performing image processing on the gun-shaped display image to obtain a gun-shaped image to be identified, wherein the gun-shaped image to be identified consists of black pixel points and white pixel points; The first determining unit is used for determining a target gun type corresponding to the gun type display image by utilizing the gun type image to be recognized, and is specifically used for sequentially obtaining the number of target color pixel points of each pixel area in the gun type image to be recognized to obtain a number sequence, wherein the pixel areas are pixel rows or pixel columns, the target color pixel points are white pixel points or black pixel points, selecting a target sequence from a preset sequence according to the number sequence, wherein the preset sequence is a sequence consisting of the number of target color pixel points of each pixel area in a standard gun type image corresponding to the preset gun type, and taking the preset gun type corresponding to the target sequence as the target gun type; a generation unit configured to generate motor vibration control information for controlling motor vibration based on preset vibration information corresponding to the target gun type; The apparatus further comprises: the adjusting unit is used for carrying out equal-length processing on the number sequence or the preset sequence if the image size of the standard gun type image is different from the image size of the gun type image to be identified; The adjusting unit includes: the first adjusting subunit is configured to adjust the preset sequence if the image size of the standard gun type image is greater than the image size of the gun type image to be identified, so as to obtain an updated preset sequence; And the second adjusting subunit is used for adjusting the number sequence to obtain an updated number sequence if the image size of the gun type image to be identified is larger than the image size of the standard gun type image.
  8. 8. A vibration control chip of a motor is characterized by comprising a processor and a memory; the memory for storing computer-executable instructions that, when executed by the processor, cause the processor to perform the method of any of claims 1-6.
  9. 9. A computer readable storage medium, characterized in that the computer readable storage medium has stored therein instructions, which when run on a terminal device, cause the terminal device to perform the method of any of claims 1-6.

Description

Vibration control method, device, chip and medium of motor Technical Field The present application relates to the field of control, and in particular, to a method, an apparatus, a chip, and a medium for controlling vibration of a motor. Background Shooting-type games are games in which a user plays a game with other users by controlling the movement and shooting of game characters. In the course of the game, the terminal plays the corresponding sound effect along with the progress of the game. For example, a corresponding gunshot is played as the user fires in order to enhance the user's gaming experience. In addition, the motor vibration can be controlled while the sound is played through the terminal loudspeaker, so that the user obtains multi-dimensional game feedback through the terminal vibration. At present, the vibration mode of a motor in a game is single. For different gun types used by a user in a game, vibration modes during gun firing are the same or similar, the user is difficult to obtain specific corresponding shock feeling based on the specific gun type used, and the game experience is poor. Disclosure of Invention In view of the above, embodiments of the present application provide a method, an apparatus, a chip, and a medium for controlling vibration of a motor, which can implement vibration of a motor according to a vibration mode corresponding to a gun type based on a specific gun type control, thereby improving user experience. In order to solve the above problems, the technical solution provided by the embodiment of the present application is as follows: in a first aspect, the present application provides a vibration control method of a motor, the method comprising: Acquiring a gun type display image from a target game image, and performing image processing on the gun type display image to obtain a gun type image to be identified; Determining a target gun type corresponding to the gun type display image by utilizing the gun type image to be identified; And generating motor vibration control information based on preset vibration information corresponding to the target gun type, wherein the motor vibration control information is used for controlling motor vibration. In one possible implementation manner, the gun-shaped image to be identified consists of black pixels and white pixels; The method for determining the target gun type corresponding to the gun type display image by utilizing the gun type image to be identified comprises the steps of sequentially obtaining the number of target color pixel points of each pixel area in the gun type image to be identified to obtain a number sequence, wherein the pixel areas are pixel rows or pixel columns, and the target color pixel points are white pixel points or black pixel points; selecting a target sequence from a preset sequence according to the number sequence, wherein the preset sequence is a sequence consisting of the number of target color pixel points of each pixel region in a standard gun type image corresponding to a preset gun type; And taking the preset gun type corresponding to the target sequence as a target gun type. In one possible implementation manner, before the selecting the target sequence from the preset sequences according to the number sequence, the method further includes: And if the image size of the standard gun type image is different from the image size of the gun type image to be identified, performing equal-length processing on the number sequence or the preset sequence. In one possible implementation manner, if the image size of the standard gun type image is different from the image size of the gun type image to be identified, performing equal-length processing on the number sequence or the preset sequence includes: If the image size of the standard gun type image is larger than the image size of the gun type image to be identified, adjusting the preset sequence to obtain an updated preset sequence; And if the image size of the gun type image to be identified is larger than the image size of the standard gun type image, adjusting the number sequence to obtain an updated number sequence. In a possible implementation manner, the adjusting the preset sequence to obtain an updated preset sequence includes: Determining a first step size and a first proportion according to the image size of the standard gun type image and the image size of the gun type image to be identified; Determining a first target pixel area in the standard gun-type image according to the first step length; Acquiring the number of target color pixel points in the first target pixel area as a first pixel number; and obtaining an updated preset sequence according to the first pixel number and the first proportion. In one possible implementation manner, the adjusting the number sequence to obtain an updated number sequence includes: Determining a second step size and a second proportion according to the image size of the standard gun type image and