Changes between Version 89 and Version 90 of Other/Summer/2023/Latency
- Timestamp:
- Aug 5, 2025, 11:48:45 PM (7 days ago)
Legend:
- Unmodified
- Added
- Removed
- Modified
-
Other/Summer/2023/Latency
v89 v90 10 10 **Project Goal:** To find the method(s) of reducing latency to a minimum in a unicast camera to computer connection over a network. 11 11 == Project Design 12 [[Image(https:// drive.google.com/uc?id=1Dx2j0asE0AsblTYqTj8qi3STBbWDbmOi)]]12 [[Image(https://www.dropbox.com/scl/fi/mqe53ss7ng4j7y0ff276a/ProjectSetup.png?rlkey=9imm2l5nk9lsi5i8eifnqecow&st=izign9cw&raw=1)]] 13 13 14 14 Our camera and LED light is sealed in a box with minimal light.\\ … … 16 16 17 17 18 [[Image(https:// cdn.discordapp.com/attachments/840223980811714590/1138531408663552152/TM1000-e1490300173183_reszied.png)]]18 [[Image(https://www.dropbox.com/scl/fi/bqh7wuerkovib7qzwoq13/TimeMachine.png?rlkey=v4cz7e6m5p697acfl1m2i4ebi&st=3cu4olv1&raw=1)]] 19 19 20 20 The Time Machine is equipped with a GPS and uses PPS (Pulse Per Second) and PTP (Precision Time Protocol). \\PPS sends a precise voltage that turns the LED light on at the start of every second. … … 27 27 28 28 29 [[Image(https://cdn.discordapp.com/attachments/840223980811714590/1138860049666678825/test_area.png)]][[Image(https://cdn.discordapp.com/attachments/840223980811714590/1138860900296699954/camera_light.png)]] 29 [[Image(https://www.dropbox.com/scl/fi/bbrmx18n50t8au3dg1fo3/CameraSetup.png?rlkey=la5ggtycj6bm9lcjwsqq9uqhl&st=hfsq996a&raw=1)]] 30 31 32 [[Image(https://www.dropbox.com/scl/fi/jqmcukixw1fqt8qok11nl/CameraLight.png?rlkey=at3nkxf4a5pb8v53yfsry6mwa&st=rm4oz2h3&raw=1)]] 30 33 31 34 == Tools Used … … 46 49 - Configured the camera and computer’s network settings to communicate on the same IP address as the camera. 47 50 48 [[Image(https:// cdn.discordapp.com/attachments/750525976105975828/1138910624181653615/Screenshot_2023-08-09_145059.png)]]51 [[Image(https://www.dropbox.com/scl/fi/aiu4s0ui4ns37rgysn5oz/Packets.png?rlkey=i49xng7elzzqix5yzc0ajyyd4&st=t1hhbp62&raw=1)]] 49 52 50 53 Packets Shown Above 51 52 **Week 1 presentation: [https://docs.google.com/presentation/d/1WgLttl-gL1IPvtBatBWwfke9rf4txnYGf04_Hy7mANE/edit#slide=id.p]**53 54 55 **Week 2 presentation: [https://docs.google.com/presentation/d/1rk4QhjhJOKQ2Q0PooV-JtUru1SGpYBeEUab7y3EtSyQ/edit#slide=id.p]**56 54 57 55 == Week 3-4 … … 61 59 - We then encountered a problem of packet data being obscured by camera noise, thus when the LED light turned off, it was impossible to distinguish the packets that made up video footage with no light. 62 60 - We then continued creating an environment so that the camera would capture intervals of pitch darkness and the LED’s light. 63 64 [[Image(https://cdn.discordapp.com/attachments/750525976105975828/1138906157164003348/Screenshot_2023-08-09_144607.png)]]65 66 **Week 3 presentation: [https://docs.google.com/presentation/d/1PPJB0SCb0Y8G04pPQRvMS-2uoILxmxJBSVdZgO7B73c/edit#slide=id.p]**67 61 68 62 == Week 5 … … 84 78 This week was shortened to a considerable margin to the point where we couldn't make much progress. However, we were able to plan for the following weeks by creating many artificial videos of varying amounts of noise as well as a plan to create histogram to plot the number of occurrences each hex byte appeared in order to visualize how noise affects packets using the Python library Matplotlib. 85 79 86 **Week 6 presentation: [https://docs.google.com/presentation/d/1IwPrkkpvbTHO3LuBZ2Umuxp5rz9jwKTqmml3EoJ7wAA/edit]**87 88 80 == Weeks 7-8 89 81 **Summary … … 98 90 Following up on our plan from week 6, we worked on plotting histograms of the hex byte data. This had a rough start as when uploading the artificial videos to the node, the node ended up corrupting the video, making it impossible to use. As a result, we uploaded frames from the video to the node in order to compute it. After this, several histogram scripts were developed, each functioning in a different way. Ultimately, we decided upon creating three separate graphs for each color (RGB) of how often certain values occurred. After testing these with the JPEG images, we then used it on the camera where we changed LED setup to take up more of the camera’s view as well as used FFMPEG to get video into one MJPEG or many JPEG files. The resulting histograms were the following: 99 91 100 [[Image(https://cdn.discordapp.com/attachments/840223980811714590/1138851957713412226/red_values_resized.png)]] 101 [[Image(https://cdn.discordapp.com/attachments/840223980811714590/1138852476502691840/green_values_resized.png)]] 102 [[Image(https://cdn.discordapp.com/attachments/840223980811714590/1138852959699083394/blue_values_resized.png)]] 92 [[Image(https://www.dropbox.com/scl/fi/kesssgcue020okb6fga5w/RedHistogram.png?rlkey=rpb8at1a64mxkb6o67f82tm12&st=dio31y9p&raw=1)]] 103 93 104 **Noise Histogram** 94 [[Image(https://www.dropbox.com/scl/fi/kesssgcue020okb6fga5w/GreenHistogram.png?rlkey=rpb8at1a64mxkb6o67f82tm12&st=4ihfcpq8&raw=1)]] 105 95 106 [[Image(https:// cdn.discordapp.com/attachments/840223980811714590/1138853467121782784/noise_histogram_resized.png)]]96 [[Image(https://www.dropbox.com/scl/fi/hjuzbi151ay8jrearglmf/BlueHistogram.png?rlkey=prjcru8knn7a9dplwuomrzb50&st=gfatiyyi&raw=1)]] 107 97 108 98 These histograms show the number of occurrences in the 5-sec camera footage for each type of colored pixel value with no noise. … … 112 102 - The occurrences of blue pixel values is significantly higher because the LED emits blue light. 113 103 114 The RGB histograms were made without noise, compared to the histogram on the bottom when there was significant amount of noise present. These results show that the amount of noise in our camera can heavily affect our data set. 115 116 **Week 7 presentation: [https://docs.google.com/presentation/d/1oPe0z3FzBUPzzFf-zcCJgz43jQIHqMHRg1BsnYJdaCU/edit]** 117 118 **Week 8 presentation: [https://docs.google.com/presentation/d/1qZLdapSWYrYTItAQqAmdhgF34x_hxIMOjZ_adv8LDIg/edit]** 104 The RGB histograms were made without noise, showing that the amount of noise in our camera can heavily affect our data set. 119 105 120 106 == Week 9 … … 127 113 During this week, we decided to take a step back to understand what the values in the JPEG hex values meant. Once analyzing the hex files from the video, it was quickly discovered there were certain indicators present, being FFD8 and FFD9. FFD8 represented the start of frame while FFD9 represented the end of the frame, while everything inside containing the frame contents. Knowing this, we were then able to isolate specific frames via these indicators via a Python script. 128 114 129 [[Image(https:// cdn.discordapp.com/attachments/750525976105975828/1138556198992494683/Hexdata.png)]]115 [[Image(https://www.dropbox.com/scl/fi/qzkasgiccwcepr8lbcl1t/HexFrameValues.png?rlkey=px8ewjontnvg8ndavguhkgumn&st=6zwvh9pa&raw=1)]] 130 116 131 117 After this step, we were finally able to calculate latency. By comparing the frame data to the packet data, we could find what exact packet correlates to the frame. By using the timestamp of the packet, we can then be able to find the latency. … … 142 128 **Week Run-through 143 129 144 When it came down to our final week of the project, it mainly revolved around finalizing thepresentation and poster.130 When it came down to our final week of the project, it mainly revolved around finalizing our final presentation and poster. 145 131 146 132 **Week 10 presentation: [https://docs.google.com/presentation/d/1si5gw012hevYePNOeTQiqYPRlw_s4Ao4pM_46wUkApk/edit#slide=id.p]** … … 149 135 **Artificial Video Maker (Needs OpenCV and numpy)** 150 136 151 [[Image(https:// cdn.discordapp.com/attachments/750525976105975828/1160958133091450930/Screenshot_2023-10-08_121414.png?ex=65368d84&is=65241884&hm=8df6f0af9e582ef9e82b94be89ca13a12c37d6da43880b9627ea2d05378a0ba3&)]]137 [[Image(https://www.dropbox.com/scl/fi/6ohvt40byznxhjegwuh5c/ArtificalVideoMaker.png?rlkey=jmoxv9ybw6h1rikc3rlq0ff8d&st=duhx5gmx&raw=1)]] 152 138 153 139 **Frame Collector (Needs OpenCV, OS, Shutil, and numpy)** 154 140 155 [[Image(https:// cdn.discordapp.com/attachments/750525976105975828/1160958134165188799/Screenshot_2023-10-08_123014.png?ex=65368d84&is=65241884&hm=a5762a9b6f87531edfd46cce8362097377d433d27c74ffcbaa97795aafdb294b&)]]141 [[Image(https://www.dropbox.com/scl/fi/poriu59x10b1nbn6ym66v/FrameCollector.png?rlkey=dkd2mac14lbc0ib1e4lh8fgzk&st=vgnp6zus&raw=1)]] 156 142 157 143 **Histogram Code (Needs OpenCV, numpy, and Matplotlib)** 158 144 159 [[Image(https:// cdn.discordapp.com/attachments/750525976105975828/1160958133871591434/Screenshot_2023-10-08_122714.png?ex=65368d84&is=65241884&hm=0a09fc89f87ea4a525f1db17d24a643771040f77638140cee75827a4c30cb2fd&)]]145 [[Image(https://www.dropbox.com/scl/fi/7ff36l642d7h30y47sw63/HistogramCode.png?rlkey=betupkn7zvhtvxjn175m9ctyx&st=u6g2oa3z&raw=1)]] 160 146 161 147 **Framefinder** 162 148 163 [[Image(https:// cdn.discordapp.com/attachments/750525976105975828/1160958134479765666/Screenshot_2023-10-08_123207.png?ex=65368d84&is=65241884&hm=91662810f3b2035947084d46dd1653b3e628a252469a1c2e0cf28ec85a2abdf8&)]]149 [[Image(https://www.dropbox.com/scl/fi/lekmsfzf72xw5covj8kmg/Framefinder.png?rlkey=p6ar9pbx98ooq9dcbnaa21t61&st=oauqi1pg&raw=1)]] 164 150 165 151 **Frame and Packet Comparison** 166 152 167 [[Image(https:// cdn.discordapp.com/attachments/750525976105975828/1160958133536043069/Screenshot_2023-10-08_122421.png?ex=65368d84&is=65241884&hm=1ac20f07b0d8da615ced98e1d70c1a994bcfd8196af5b58ae7553eb08cd583ca&)]]153 [[Image(https://www.dropbox.com/scl/fi/k3ctv8px7uy9ti5uagy48/FramePacketComparison.png?rlkey=ud0228iz20drd0wa1e8kc8k6p&st=qyuesngv&raw=1)]]