Added legacy camera and segment code and main logic to finalize the demo code for the project.