In the video series, you have used Stateflow for developing the logic of the drone.
As the drone is flying at a height of 1.1 m, the large section of the line is below the drone, as we tried to detect the red colour only not line (as shown in the first screenshot).
Therefore, when I run the model, the drone is following the straight line properly but when there is a turn. The drone moves straight as the red colour is in the frame but after 2 seconds the threshold for total white pixels becomes less than 1400 therefore, it won't detect the colour and it will try to turn depending on the algorithm (in my case I've programmed such as it will rotate in a clockwise direction but as it rotates little bit the threshold increase beyond 1400. so it again gives '1' in the output.
To overcome this problem I tried to use 'resize block' but it's showing an error that is shown in the second screenshot.
and one more thing, can you please tell me how can I detect line in the simulation ( image taken from simulation not from camera) ?
Thank you in advance.