Localization and dynamic object avoidance

Hello, I am trying to create a robot that avoids barrels and stays within two white lines(One on either side.)
If I were to train models for the barrels, is it possible to localize the lines and barrels to determine the best path to get around?

notice that reading a tf model drops camera frames to just 2-3 per second. is this ok? if not you must find another solution to avoid barrels. the line detection is really fast though!

Would I be able to do line detection and send it to ros? and then use a lidar module and send that information to ros? im trying to find the best way to do this with my limited knowledge right now. I haven’t done anything with Ros before, so I was trying to avoid that.