Jump to content
Sign in to follow this  
pnn

Finding pixel locations of an object

Recommended Posts

Hello,

I am new to Arma Scripting  and I'm trying to detect an object in a *png file. This is the script I'm trying to get to work.

 

_screenPos = worldToScreen position pickup_truck;
_screenX = _screenPos select 0;
_screenY = _screenPos select 1;
_myX = (_screenX - safeZoneXAbs) / (safeZoneWAbs);
_myY = (_screenY - safeZoneY) / (safeZoneH);
diag_log format [ "X: %1 Y: %2", round (_myX * (getResolution select 0)), round (_myY * (getResolution select 1)) ];

 

Now when I look at the Image( testFile.png) at pixel location (_myX,_myY) I dont see the truck.

The truck is at around (421,612) but the output I get from the script is (619,542).

https://www.dropbox.com/s/fgbdo1156k8ci3p/testFile.png?dl=0

Any leads as to why this is happening will be highly appreciated.

 

Thanks,

-P

 

 

 


screenshot "testFile.png";

Share this post


Link to post
Share on other sites

Please sign in to comment

You will be able to leave a comment after signing in



Sign In Now
Sign in to follow this  

×