gestom / CosPhi

Artificial pheromone system
31 stars 14 forks source link

generating occupancy grid from the image between the 4 terminal patterns #8

Open gemad opened 8 years ago

gemad commented 8 years ago

i want to create a ros node to generate an occupancy grid from the camera feed so i need to get the coordinates of the center of each of the 4 terminal patterns then crop the image and pass it to a processing node .

what is the best way to get those coordinates (related to the image pixels ), thanks in advance

gestom commented 8 years ago

To get the coordinates of the 4 terminal patterns, check the autocalibration() function in src/main/swarmcon.cpp. This function takes the four outermost detected patterns and passes their known positions to functions that establish mappings between the camera (pixel) coordinates and positions of the robots.

However, do you really need to calculate the occupancy grid using image coordinates? After the auto-calibration, the system already gives you positions of all robots in the coordinate frame defined by the four outermost circles, which should be perfectly fine as an input to your occupancy grid. I mean that the system does the transformation for you.