admin
|
There are two parts to the problem - 1. an obstacle detection algorithm that uses sensors and processing 2. a motion control algorithm that applies the results of obstacle detection The main issue with reflected laser light is that it can be confused with other light sources. If you are confident that the reflected laser light will produce the brightest pixels with the camera, then you can search directly for laser pixels. Otherwise, the most certain way to resolve this is to capture a frame with the lasers off and compare it with a frame with the lasers on. As long as the robot or background scene isn't moving, the only image left after subtraction should be the reflected laser light. A good way to test this is to use the SRV1Test application to sample different color ranges and visually observe the results. From the SRV1Test command window, send 'l' (lower case L) to turn on lasers 'g1' to view color segmentation results 'vc0250255100150100200' to set color bin #0 to Y [250-255], U [100-150], V[100-200] If you only see laser light reflection and no other noise, then you've created a good range of colors. You can confirm by running the blob command 'vb0' and you'll see the coordinates of the reflected light color blobs. You can perform the same functions in the C interpreter. laser(3); // turns on both lasers vcolor(0, 250, 255, 100, 150, 100, 200); // sets up color bin #0 as above vcap(); // grabs a video frame vblob(0,0); // searches for the largest blob matching the color bin #0 vblob() actually returns a value which is the number of blobs it finds. Generally, we're interested in the largest blob, but with two lasers, we should get two blobs, so you might want to look at the details of both blobs. The results of the blob search are stored in global variables blobcnt (number of pixels in the blob) blobx1 (left-most x coordinate) blobx2 (right-most x coordinate) bloby1 (top y coordinate - 0 is the top row) bloby2 (bottom y coordinate) With that information, you have your blob location, so then you have to decide what action to take. For starters, we should put together a small program that just turns on lasers, does a blob search, and dumps the result.
|