ChosunTruck
ChosunTruck copied to clipboard
Should improve lane detection algorithm especially at the curvy lanes
Our lane detection code does not work properly at the very curvy lanes like highway entrance or exit. I'm reading some papers which can improve our lane detection algorithm. https://arxiv.org/pdf/1501.03124.pdf http://research.ijcaonline.org/volume122/number13/pxc3905011.pdf
I changed IPM code. The IPM area changes depending on the steering amount. I think it will reduce noises on the curvy road and make the truck drives better.
I'm confused by this change, there's a lot of repeating code that I see.
For example: https://github.com/bethesirius/ChosunTruck/blob/0351ab86eebb032d2f440aa3ae95d14656c6f840/linux/src/main2.cc#L173
is repeated here: https://github.com/bethesirius/ChosunTruck/blob/0351ab86eebb032d2f440aa3ae95d14656c6f840/linux/src/main2.cc#L257
You also repeated the IPM code here and then again here
I'm not saying this is incorrect, but I believe this repetition of code is the reason why I cannot implement this correctly into our Windows version. Can you explain why these are repeated?
The lane detection process consist of these stages:
- Set the IPM area
- Resize the IPMed area
- Convert the color from RGB to grey
- Sobel filtering and thresholding and we find the lane with the frames which are the result of those screen filtering process.
My code uses move_mouse_pixel variable to change the IPM area. To use this changed IPM area in lane detection, we should do the screen filtering process again, and find the lane with the new frame again. I know the repeating code is bad for the maintanence, so I gonna refactor it soon.
Ok! Just adding a function that performs those steps should make the code look better.
I will try to see if I can get that to work today.
In my latest commit I tried to implement it into the replacing move_mouse_pixel with diffOld, and it doesn't seem to help stabilize the ipm... not sure what is wrong.
I have a better idea for implementing adaptive IPM. I will change the code before Tuesday or Wednesday
OK, a better adaptive IPM area is implemented https://youtu.be/qb99czlIklA