You can't feed a radar image to a bunch of if/elif/elif/else statements.
You don't need to input the image. You just need to input call sign, latitude, longitude, altitude, heading, speed, and emergency status (none, pan pan, or mayday) for each aircraft on radar.
The ATC will set the last one based on radio communications but the rest are either directly from or can be calculated from their transponders.