Page 1 of 2

How to detect active weapon in Pubg using CV?

PostPosted: Wed Jul 21, 2021 3:37 pm
by Tahsin
Hi
i've just asked in my preview thread to help me finding a CV script for Pubg but no one respond to me
so i try to build my own script but i need your help
im trying to detect active weapons in Pubg but i don't know how to use the code in CV
can someone write me example ore a basic code to use
thank you :smile0201:

Re: How to detect active weapon in Pubg using CV?

PostPosted: Wed Jul 21, 2021 5:21 pm
by Tahsin
Why no one respond to me ?
did you make the Computer Vision only for Apex Legends ? there are other games needs scripts not all gamers plays Apex Legends
so why we don't find any script for other games after one year of CV release is is dificault to make a script ?
if you try to sell your scripts just tell me i will buy it so just leave a comment let me know what is the problem

Re: How to detect active weapon in Pubg using CV?

PostPosted: Wed Jul 21, 2021 6:28 pm
by Scachi
Depending on the game, its not easy at all to detect the weapons.
The HUD in Apex Legends is full color, no background shining through. And the weapon text is shown all the time on the HUD. This makes it easy to detect the weapon in use.

Pubg has transparent HUD so the color of the weapons shown is different depending on the current background, no weapon text shown, that makes it hard to detect the weapon in use via the normal HUD.

Re: How to detect active weapon in Pubg using CV?

PostPosted: Wed Jul 21, 2021 8:41 pm
by Tahsin
Thanks for the comment Schachi
but you can detect active weapon it's white color you can detect weapon using object tracking
using weapon images the selected weapon is white and the other on is grey look at image :)

Re: How to detect active weapon in Pubg using CV?

PostPosted: Wed Jul 21, 2021 9:48 pm
by Scachi
It might be red too when its out of ammo.

Re: How to detect active weapon in Pubg using CV?

PostPosted: Wed Jul 21, 2021 10:09 pm
by Tahsin
Scachi wrote:It might be red too when its out of ammo.

I agree but you don't need antirecoil when your weapon is out of ammo
so when the weapon color back to white it while be detected again
:smile0201:

Re: How to detect active weapon in Pubg using CV?

PostPosted: Thu Jul 22, 2021 5:09 am
by Scachi
Do you want to check for the active weapon slot only (primary/secondary) or identify the weapon too ?

Re: How to detect active weapon in Pubg using CV?

PostPosted: Thu Jul 22, 2021 8:31 am
by Tahsin
Scachi wrote:Do you want to check for the active weapon slot only (primary/secondary) or identify the weapon too ?

Iwant to identify only the active weapon for example if i have to weapon it while detect only active weapon
But if i change from primary to secondary it while detect the secondary too
Édite:
I want to identify the weapon name so i can make antirecoil for every weapon

Re: How to detect active weapon in Pubg using CV?

PostPosted: Wed Jul 28, 2021 3:02 pm
by Tahsin
Is there any news are you working on this script ?

@Scachi
Thanks in advance

Re: How to detect active weapon in Pubg using CV?

PostPosted: Sat Jul 31, 2021 8:57 pm
by Scachi
No, I don't work on this script as its a lot of work for an unknown result. It may not work reliable at all at the end as I said the background of the hud where the weapon image is shown needs to be fully opaque for fast, simple and reliable detection.
Pickup the biggest weapon in game as all weapon images to compare should have the same width and height.
Now compare that rectangle area with the same area in your current screenshot.
you will see the background changes it colors depending on where you do the screenshot.