CN-115531862-B - Vibration control method, device, chip and medium of motor
Abstract
The embodiment of the application discloses a vibration control method, a device, a chip and a medium of a motor, which are used for processing images by displaying the number of bullets in a target game image, the digital image to be identified can be obtained, and the number of the current target bullets corresponding to the bullet number display image can be determined by using the digital image to be identified. The number of bullets display image corresponds to the current number of target bullets which is the number of remaining bullets of the firearm used in the game by the current user. And then utilizing the number of the historical target bullets to generate motor vibration control information. The specific number of the consumed bullets can be determined according to the current number of the target bullets and the historical number of the target bullets, whether the user performs shooting operation and the times of the shooting operation are further determined, motor vibration control information is generated according to the number of the consumed bullets used by the user, and accordingly the motor is controlled to accurately vibrate based on the number of the consumed bullets, the motor can accurately correspond to the operation of the user, and the use experience of the user is improved.
Inventors
- WANG CHENGDONG
- MIAO LILIN
- TONG XIAOBIN
- LI HUI
Assignees
- 上海艾为电子技术股份有限公司
Dates
- Publication Date
- 20260505
- Application Date
- 20210630
Claims (10)
- 1. A vibration control method of a motor, the method comprising: Acquiring bullet quantity display images from target game images, and performing image processing on the bullet quantity display images to obtain digital images to be identified; determining the number of current target bullets corresponding to the bullet number display image by utilizing the digital image to be identified; Generating motor vibration control information based on the current target bullet number and the historical target bullet number, wherein the motor vibration control information is used for controlling motor vibration; The method comprises the steps of obtaining a number sequence by sequentially obtaining the number of target color pixel points of each pixel area in a digital image to be recognized, selecting a target sequence from a preset sequence according to the number sequence, obtaining the current target bullet number corresponding to the bullet number display image according to preset characters corresponding to the target sequence, and correspondingly determining the current target bullet number corresponding to the bullet number display image by utilizing the digital image to be recognized, wherein the preset sequence is a sequence consisting of the number of the target color pixel points of each pixel area in a standard digital image corresponding to the preset characters; Before the target sequence is selected from the preset sequence according to the number sequence, the method further comprises the steps of carrying out equal-length processing on the number sequence or the preset sequence if the image size of the standard digital image is different from the image size of the digital image to be identified, specifically, adjusting the preset sequence to obtain an updated preset sequence if the image size of the standard digital image is larger than the image size of the digital image to be identified, and adjusting the number sequence to obtain the updated number sequence if the image size of the digital image to be identified is larger than the image size of the standard digital image.
- 2. The method of claim 1, wherein the pixel area is a pixel row or a pixel column, and the target color pixel is a white pixel or a black pixel.
- 3. 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 digital image and the image size of the digital image to be identified; Determining a first target pixel area in the standard digital 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.
- 4. 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 digital image and the image size of the digital image to be identified; determining a second target pixel area in the digital 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.
- 5. The method according to claim 2, 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.
- 6. The method of claim 1, wherein prior to said capturing the bullet count display image from the target game image, the method further comprises: If the image acquisition conditions are met, sequentially acquiring original game images according to preset time intervals, and recognizing digital display identifiers of the original game images; and if the original game image has the digital display mark, taking the original game image as a game image to be processed.
- 7. The method of claim 1, wherein the obtaining the bullet quantity display image from the target game image, and performing image processing on the bullet quantity display image to obtain the digital image to be identified, comprises: Obtaining bullet quantity display images from target game images, and carrying out graying and binarization treatment on the bullet quantity display images to obtain black-and-white digital images, wherein the black-and-white digital images consist of black pixel points and white pixel points; And dividing the black-and-white digital image according to the area where each character pattern is located in the black-and-white digital image to obtain the digital image to be identified.
- 8. A vibration control device of a motor, the device comprising: The first acquisition unit is used for acquiring bullet quantity display images from the target game images, and performing image processing on the bullet quantity display images to obtain digital images to be identified; a first determining unit, configured to determine, using the digital image to be identified, a current target bullet number corresponding to the bullet number display image; a generation unit configured to generate motor drive control information based on the current number of target bullets and the historical number of target bullets, the motor drive control information being used to control motor vibration; Wherein the digital image to be identified is composed of black pixels and white pixels, and correspondingly, the first determining unit includes: The first acquisition subunit is used for sequentially acquiring the number of the target color pixel points of each pixel area in the digital image to be identified to obtain a number sequence; the selecting subunit is used for selecting a target sequence from a preset sequence according to the number sequence, wherein the preset sequence is a sequence formed by the number of the target color pixel points of each pixel region in the standard digital image corresponding to the preset character; The second acquisition subunit is used for acquiring the current target bullet quantity corresponding to the bullet quantity display image according to the preset characters corresponding to the target sequence; The device further comprises an adjusting unit, wherein 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 digital image is different from the image size of the digital image to be identified, the preset sequence is adjusted to obtain an updated preset sequence if the image size of the standard digital image is larger than the image size of the digital image to be identified, and the number sequence is adjusted to obtain the updated number sequence if the image size of the digital image to be identified is larger than the image size of the standard digital image.
- 9. A vibration control chip of a motor is characterized by comprising a processor and a memory; the memory is used for storing computer execution instructions; the instructions, when executed by the processor, cause the processor to perform the method of any of claims 1-7.
- 10. 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-7.
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, when a user fires or other game player fires, the corresponding gunshot is played to enhance the user's game experience. In addition, when the user shoots at a gun, the motor vibration is controlled while the sound is played through the terminal loudspeaker, so that the user obtains multidimensional game feedback through the sound and the terminal vibration. At present, when a user plays a game, the terminal plays gun sound when shooting by self or shooting by other players with closer distances. It is difficult to determine from the played sound whether the user has fired himself or herself or not, and the number of times the user has fired his or her particular gun. Accordingly, it is difficult to control the vibration of the motor in the terminal according to the gunshot, so that the vibration of the motor is disordered, and the number of vibrations of the terminal cannot be matched with the operation of the user. 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 control the motor to vibrate for a corresponding number of times according to the number of bullets used by a user, so as to control vibration of the motor more accurately. 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 bullet quantity display images from target game images, and performing image processing on the bullet quantity display images to obtain digital images to be identified; determining the number of current target bullets corresponding to the bullet number display image by utilizing the digital image to be identified; And generating motor vibration control information based on the current target bullet number and the historical target bullet number, wherein the motor vibration control information is used for controlling motor vibration. In one possible implementation manner, the digital image to be identified is composed of black pixels and white pixels; The determining the current target bullet number corresponding to the bullet number display image by using the digital image to be identified comprises the following steps: Sequentially obtaining the number of target color pixel points of each pixel area in the digital 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 formed by the number of the target color pixel points of each pixel region in a standard digital image corresponding to a preset character; taking a preset character corresponding to the target sequence as a target number of the digital image to be identified; And obtaining target numbers of the digital images to be identified according to preset characters corresponding to the target sequences, and determining the current target bullet number corresponding to the bullet number display images. In one possible implementation manner, after 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 digital image is different from the image size of the digital 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 digital image is different from the image size of the digital image to be identified, performing equal-length processing on the number sequence or the preset sequence includes: if the image size of the standard digital image is larger than the image size of the digital image to be identified, adjusting the preset sequence to obtain an updated preset sequence; and if the image size of the digital image to be identified is larger than the image size of the standard digital 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