Simple line following executed on an android camera phone?
I am trying to implement simple line following on a robot that uses an android camera as its sensor. My idea is to take any given frame and search only a horizontal strip for the color black, then get information on how far left/right that black is from center. For example, if the input frame is this:
then the program should search some thin horizontal strip (like the blue one in the picture) for black. When it finds it it reports that the black line is to the right of center by x amount.
I think that this should be written into the onCameraFrame() method, but i am not sure where to go from there. Specifically i need to know how to search a submat for a concentration of black and report its position.
A suggestion
So houghlines is another common approach i saw but i wasnt sure how to implement it. Do you know any good examples that show it being implemented in javaCV? I have an input frame (from the onCameraFrame() method) so i will research how to threshold that image.
What do you mean by define the distance between two following line segments? are you saying compare 2 results from the houghline approach? So like if one the following line is an inch to the right of the previous line then you know you need to turn to the right to follow it?
JavaCV is not an official distribution of the openCV library, so support here is limited. Houghlines returns a set of points that defines lines. You can calculate a distance between lines right? I suggest putting your question here