webgl 著色器_如何使用AI,AR和WebGL著色器來幫助視障人士

webgl 著色器

by Dan Ruta

通過Dan Ruta

如何使用AI,AR和WebGL著色器來幫助視障人士 (How you can use AI, AR, and WebGL shaders to assist the visually impaired)

Today, about 4% of the world’s population is visually impaired. Tasks like simple navigation across a room, or walking down a street pose real dangers they have to face every day. Current technology based solutions are too inaccessible, or difficult to use.

如今,全世界約4%的視力障礙者。 諸如在房間中進行簡單導航或走在街上這樣的任務構成了他們每天必須面對的真正危險。 當前基于技術的解決方案太難以訪問或難以使用。

As part of a university assignment, we (myself, Louis, and Tom) devised and implemented a new solution. We used configurable WebGL shaders to augment a video feed of a user’s surroundings in real-time. We rendered the output in a AR/VR format, with effects such as edge detection and color adjustments. Later, we also added color blindness simulation, for designers to use. We also added some AI experiments.

作為大學任務的一部分,我們( 本人 , 路易斯和湯姆 )設計并實施了一個新的解決方案。 我們使用可配置的WebGL著色器實時增強了用戶周圍環境的視頻饋送。 我們以AR / VR格式渲染輸出,并具有邊緣檢測和顏色調整等效果。 后來,我們還添加了色盲模擬,供設計人員使用。 我們還添加了一些AI實驗。

We did a more in-depth literature review in our original research paper. ACM published a shorter, two page version here. This article focuses more on the technologies used, as well as some of the further uses, and experiments such as AI integration.

我們在原始研究論文中進行了更深入的文獻綜述。 ACM發布較短,兩頁的版本在這里 。 本文將重點介紹所使用的技術以及一些其他用途以及諸如AI集成之類的實驗。

A popular approach we found in our studies of existing solutions was the use of edge detection for detecting obstacles in the environment. Most solutions fell short in terms of usability, or hardware accessibility and portability.

在對現有解決方案的研究中,我們發現一種流行的方法是使用邊緣檢測來檢測環境中的障礙物。 大多數解決方案在可用性,硬件可訪問性和可移植性方面都達不到要求。

The most intuitive approach we could think of as feedback to the user was through the use of a VR headset. While this meant that the system would not be of help to very severely visually impaired people, it would be a much more intuitive system for those with partial sight, especially for those with blurry vision.

我們可以想到的最直觀的方法是通過使用VR頭顯來反饋給用戶。 雖然這意味著該系統對視力嚴重受損的人無濟于事,但對于那些視力不佳的人,尤其是視力模糊的人來說,它將是一個更加直觀的系統。

邊緣檢測 (Edge detection)

Feature detection, such as edges, are best done using 2D convolutions, and are even used in deep learning (convolutional neural networks). Simply put, these are dot products of a grid of image data (pixels) against weights in a kernel/filter. In edge detection, the output is higher (more white) when the pixel values line up with the filter values, representing an edge.

諸如邊緣之類的特征檢測最好使用2D卷積完成,甚至可以用于深度學習( 卷積神經網絡 )中。 簡而言之,這些是圖像數據(像素)網格相對于內核/過濾器中的權重的點積。 在邊緣檢測中,當像素值與代表邊緣的濾鏡值對齊時,輸出較高(更白)。

There are a few available options for edge detection filters. The ones we included as configurations are Frei-chen, and the 3x3 and 5x5 variants of Sobel. They each achieved the same goal, but with slight differences. For example, the 3x3 Sobel filter was sharper than the 5x5 filter, but included more noise, from textures such as fabric:

邊緣檢測過濾器有一些可用的選項。 我們包括為配置的是Frei-chen以及Sobel的3x3和5x5變體。 他們每個人都實現了相同的目標,但略有不同。 例如,3x3的Sobel濾鏡比5x5的濾鏡更清晰,但包含更多的噪波,來自諸如織物的紋理:

網絡平臺 (The web platform)

The primary reason we chose the web as a platform was its wide availability, and compatibility across almost all mobile devices. It also benefits from easier access, compared to native apps. However, this trade-off came with a few issues, mostly in terms of necessary set-up steps that a user would need to take:

我們選擇網絡作為平臺的主要原因是其廣泛的可用性以及幾乎所有移動設備的兼容性。 與本地應用程序相比,它還受益于更輕松的訪問。 但是,這種權衡會帶來一些問題,主要是用戶需要采取的必要設置步驟:

  1. Ensure network connectivity

    確保網絡連接
  2. Navigate to the web page

    導航到網頁
  3. Turn the device to landscape mode

    將設備轉到橫向模式
  4. Configure the effect

    配置效果
  5. Enable VR mode

    啟用VR模式
  6. Activate full screen mode (by tapping the screen)

    激活全屏模式(通過點擊屏幕)
  7. Slot the phone into a VR headset

    將手機插入VR耳機

To avoid confusing a non-technical user, we created the website as a PWA (progressive web app), allowing the user to save it to their Android home screen. This ensures it always starts on the correct page, landscape mode is forced on, the app is always full screen, and not reliant on a network connection.

為避免混淆非技術用戶,我們將網站創建為PWA( 漸進式Web應用程序 ),允許用戶將其保存到Android主屏幕。 這樣可以確保它始終在正確的頁面上啟動,強制使用橫向模式,應用始終處于全屏狀態并且不依賴于網絡連接。

性能 (Performance)

Early JavaScript prototypes ran nowhere near our 60fps target, due to the very expensive convolution operations. We suspected that the bottleneck was JavaScript itself. We attempted a WebAssembly version. The resulting prototype ran even slower. This was most likely due to the overhead in passing the video frame data to the WebAssembly code, and back.

由于非常昂貴的卷積運算,早期JavaScript原型無法達到我們的60fps目標。 我們懷疑瓶頸是JavaScript本身。 我們嘗試了WebAssembly版本。 最終的原型運行得更慢。 這最有可能是由于將視頻幀數據傳遞到WebAssembly代碼并返回的開銷。

So instead, we turned to WebGL shaders. Shaders are awesome because of their extreme parallelization of a bit of code (the shader) across the texture (video feed) pixels. To maintain high performance, while keeping a high level of customization, the shader code had to be spliced together and re-compiled at run-time, as configurations changed, but with this, we managed to stay within the 16.7ms frame budget needed for 60fps.

因此,我們改為使用WebGL著色器。 著色器之所以出色,是因為它們在紋理(視頻饋送)像素上對代碼(著色器)具有極高的并行度。 為了保持高性能,同時保持較高的自定義級別,必須將著色器代碼拼接在一起并在運行時重新編譯,因為配置會發生變化,但是與此同時,我們設法將著色器代碼保持在16.7ms的幀預算內60fps。

反饋 (Feedback)

We carried out some user testing. We tested some basic tasks like navigation, and collected some qualitative feedback. This included adjustments to the UI, a suggestion to add an option to configure the colors of the edges and surfaces, and a remark that the field of view (FoV) was too low.

我們進行了一些用戶測試。 我們測試了一些基本任務,例如導航,并收集了一些定性反饋。 其中包括對UI的調整,建議添加用于配置邊緣和表面顏色的選項的建議,以及關于視野(FoV)太低的說明。

Both software improvement suggestions were applied. The FoV was not something which could have been fixed through software, due to camera hardware limitations. However, we managed to find a solution for this in the form of cheaply available phone-camera fish-eye lenses. The lenses expanded the FoV optically, instead of digitally.

兩種軟件改進建議均已應用。 由于攝像機硬件的限制,FoV不能通過軟件修復。 但是,我們設法找到了一種價格便宜的手機相機魚眼鏡頭的解決方案。 鏡頭通過光學而非數字方式擴展了FoV。

Other than that, the system surpassed initial expectations, but fell short on reading text. This was due to there being two sets of edges for each character. Low light performance was also usable, despite the introduction of more noise.

除此之外,該系統超出了最初的預期,但是在閱讀文本方面卻不盡人意。 這是因為每個字符都有兩組邊緣。 盡管引入了更多的噪音,但低光性能還是可用的。

Some other configurations we included was the radius of the effect, its intensity, and color inversion.

我們包括的其他一些配置是效果的半徑,其強度和顏色反轉。

其他用例 (Other use cases)

An idea we had was to add shader effects to simulate various types of color blindness, providing an easy way for designers to detect color blindness related accessibility issues in their products, be they software or otherwise.

我們的想法是添加著色器效果以模擬各種類型的色盲,為設計人員提供了一種簡便的方法來檢測產品中與色盲有關的可訪問性問題,無論是軟件還是其他方式。

Using RGB ratio values found here, and turning off edge detection, we were able to add basic simulations of all major types of color blindness through extra, toggle-able components in the shaders.

使用此處找到的RGB比率值并關閉邊緣檢測,我們能夠通過著色器中額外的可切換組件添加所有主要色盲類型的基本模擬。

人工智能與未來工作 (AI and future work)

Although it’s an experiment, still in its very early stages, higher level object detection can be done using tensorflowjs and tfjs-yolo-tiny, a tensorflowjs port of tiny-yolo, a smaller and faster version of the YOLO object detection model.

盡管這是一個實驗,但仍處于早期階段,可以使用tensorflowjs和tfjs-yolo-tiny ( tiny-yolo的tensorflowjs端口)進行更高級的對象檢測,后者是YOLO對象檢測模型的更小更快的版本。

The next step is to get instance segmentation working in a browser, with something similar to mask rcnn (though, it may need to be smaller, like tiny-yolo), and add it to WebSight, to highlight items with a color mask, instead of boxes with labels.

下一步是使實例分段在瀏覽器中工作,并使用類似于mask rcnn的方法 (盡管它可能需要更小一些,例如tiny-yolo),然后將其添加到WebSight中,以突出顯示帶有顏色掩碼的項目,而不是有標簽的盒子。

The GitHub repo is here, and a live demo can be found at https://websight.danruta.co.uk. Do note that until Apple provides support for the camera API in browsers, it might not work on Apple phones.

GitHub倉庫在這里 ,可以在https://websight.danruta.co.uk上找到實時演示。 請注意,除非Apple在瀏覽器中提供對相機API的支持,否則它可能無法在Apple手機上使用。

Of course, I had some extra fun with this as well. Being able to edit what you can see around you in real time opens up a world of opportunities.

當然,我對此也有一些額外的樂趣。 能夠實時編輯您在周圍看到的東西,打開了一個充滿機遇的世界。

For example, using a Matrix shader, you can feel like The One.

例如,使用Matrix著色器 ,您會感覺像The One。

Or maybe you just enjoy watching the world burn.

或者,也許您只是喜歡看世界燃燒 。

You can tweet more shader ideas at me here: @DanRuta

您可以在這里向我發送更多著色器提示:@DanRuta

翻譯自: https://www.freecodecamp.org/news/how-you-can-use-ai-ar-and-webgl-shaders-to-assist-the-visually-impaired-3df5bdf3b3e2/

webgl 著色器

本文來自互聯網用戶投稿,該文觀點僅代表作者本人,不代表本站立場。本站僅提供信息存儲空間服務,不擁有所有權,不承擔相關法律責任。
如若轉載,請注明出處:http://www.pswp.cn/news/393631.shtml
繁體地址,請注明出處:http://hk.pswp.cn/news/393631.shtml
英文地址,請注明出處:http://en.pswp.cn/news/393631.shtml

如若內容造成侵權/違法違規/事實不符,請聯系多彩編程網進行投訴反饋email:809451989@qq.com,一經查實,立即刪除!

相關文章

計算機語言乍么設置,電腦如何設置語言

設置語言欄其實語言欄是用來進行輸入法的切換的。當你需要在Windows中進行文字輸入的時候,就需要用語言欄了,因為Windows的默認輸入語言是英文,在這種情況下,你用鍵盤在文本里輸入的文字會是英文字母,所以作為中國人的我們要想在Windows里輸入中文的話,就需要語言欄的幫助了。試…

hive 初認識

結構Hive 是建立在hadoop上的數據倉庫架構,它提供了一系列的工具,可以進行數據提取轉換加載(這個過程叫做ETL),這是一種可以存儲,查詢和分析存儲在hadoop中的大規模數據的機制.Hive定義了簡單的類SQL查詢語句 成為hql,他允許數據SQL的用戶查詢數據.同時 這個語言也允許數據mapr…

git使用(2)

1.遠程倉庫 a SSHKEY 第1步:創建SSH Key。在用戶主目錄下,看看有沒有.ssh目錄,如果有,再看看這個目錄下有沒有id_rsa和id_rsa.pub這兩個文件,如果已經有了,可直接跳到下一步。如果沒有,打開Shel…

郵件中的商務英語

一、常見縮寫 CC carbon copy:抄送 FYI for your information:供你參考 EOD end of the day BTW By the way:順便提一下 COB close of the business 這兩個詞都是指下班前。需要催促某人在下班前給到回復的時候可以用用它們。 eg: Ple…

vue 橫向菜單滾動定位_使用vue組件+iscroll實現一個橫向菜單,不能正確滑動

使用vue組件iscroll實現一個橫向菜單,可是卻不能滑動,給父元素ul寫死一個寬度可以滑動。但是,我在computed里計算寬度,直接路由進去不能滑動,當我進入別的組件(切換路由)回來又可以滑動了示例地址:http://o…

leetcode1353. 最多可以參加的會議數目(貪心算法)

給你一個數組 events&#xff0c;其中 events[i] [startDayi, endDayi] &#xff0c;表示會議 i 開始于 startDayi &#xff0c;結束于 endDayi 。 你可以在滿足 startDayi < d < endDayi 中的任意一天 d 參加會議 i 。注意&#xff0c;一天只能參加一個會議。 請你返…

計算機組成原理實驗讀r1,計算機組成原理實驗一

計算機組成原理實驗一 (5頁)本資源提供全文預覽&#xff0c;點擊全文預覽即可全文預覽,如果喜歡文檔就下載吧&#xff0c;查找使用更方便哦&#xff01;8.90 積分計算機組成原理實驗計算機組成原理實驗第一章、TEC-5 計算機組成實驗箱簡介運算器運算器74181通用寄存器通用寄存器…

如何使用Kotlin構建具有在線狀態的Android Messenger應用

by Neo Ighodaro由新Ighodaro When building a chat application, it is essential to have an online presence feature. It is essential because your users will like to know when their friends are online, and are more likely to respond to their messages in real …

Spark常見問題解決辦法

以下是在學習和使用spark過程中遇到的一些問題&#xff0c;記錄下來。 1、首先來說說spark任務運行完后查錯最常用的一個命令&#xff0c;那就是把任務運行日志down下來。 程序存在錯誤&#xff0c;將日志down下來查看具體原因!down日志命令&#xff1a;yarn logs -application…

linux下安裝php的swoole擴展模塊(安裝后php加載不出來?)

應開發同事要求&#xff0c;需要安裝php的擴展模塊swoole。 swoole是一種PHP高級Web開發框架&#xff0c;框架不是為了提升網站的性能&#xff0c;而是為了提升網站的開發效率&#xff0c;以最少的性能損耗&#xff0c;換取最大的開發效率。 假設服務器上php服務版本為php5.6.2…

autosar工具鏈_Autosar開發與手寫代碼開發的區別

Autosar開發流程1.BSW開發主要應用工具鏈&#xff08;Vector等工具&#xff0c;具體可以百度搜索Autosar配置工具&#xff09;來配置&#xff0c;復雜驅動的代碼需要手寫&#xff0c;但是也要符合Autosar的接口標準&#xff0c;主要包括&#xff0c;CAN通信配置、數字輸入配置、…

山東計算機類好的民辦大學,2021年山東所有民辦大學名單及排名(教育部)

高考考上一個好的大學&#xff0c;是每位考生和家長的一個夢想,但是選擇一個適合自己的大學也非常重要。本文高考助手網幫各位考生整理了關于山東本地區所有的民辦大學名單、山東所有的民辦大學分數線排名、山東民辦大學文理科投檔線等相關知識&#xff0c;各位考生在填報志愿的…

leetcode1536. 排布二進制網格的最少交換次數(貪心算法)

給你一個 n x n 的二進制網格 grid&#xff0c;每一次操作中&#xff0c;你可以選擇網格的 相鄰兩行 進行交換。 一個符合要求的網格需要滿足主對角線以上的格子全部都是 0 。 請你返回使網格滿足要求的最少操作次數&#xff0c;如果無法使網格符合要求&#xff0c;請你返回 …

xml文檔包含html代碼_為什么文檔很重要,以及為什么應將其包含在代碼中

xml文檔包含html代碼There are a plethora of acronyms when it comes to software development. KISS, DRY, SOLID… and so on and so forth. But, when it comes to documenting or commenting your code, there is no simple catchphrase.關于軟件開發&#xff0c;有很多首…

python 版本分布式鎖

此文章&#xff0c;實現python 版本的分布式鎖&#xff0c;java版本的可以使用curator很容易實現&#xff0c;python版本如下在做分布式系統開發的時候&#xff0c;分布式鎖可以說是必需的一個組件。最近做了一些調研和嘗試&#xff0c;經過對比&#xff0c;基于ZooKeeper的分布…

JavaScript數組(2)---遍歷/迭代方法 8種

最近工作中經常涉及到數據的處理&#xff0c;數組尤其常見&#xff0c;經常需要對其進行遍歷、轉換操作&#xff0c;網上的文章零零散散&#xff0c;不得已自己又找出紅寶書來翻出來看&#xff0c;順便記一筆&#xff0c;便于以后查詢。 數組常用的方法 ECMAScript5為數組定義了…

用例設計:思維導圖orExcel

一、 某次緊急發版時使用思維導圖來進行了用例的設計&#xff0c;很被導圖多分支羅列、在單一分支上層層遞進設計模式的吸引&#xff0c;最終看到由版本主題開枝散葉衍發出的結構性用例時非常開心。從此&#xff0c;幾個版本的迭代都使用思維導圖進行用例設計。 然而部門制度關…

class對象和class文件_Class文件格式

我們知道Java是一門跨平臺的語言&#xff0c;我們編寫的Java代碼會被編譯成中間class文件以讓Java虛擬機解析運行。而Java虛擬機規范僅僅描述了抽象的Java虛擬機&#xff0c;在實現具體的Java虛擬機時&#xff0c;僅指出了設計規范。Java虛擬機的實現必須體現規范中的內容&…

2018計算機應用基礎考試6,2018結構工程師《計算機應用基礎》試題(6)

大家做好準備迎接2018考試了嗎?出國留學網為您整理了“2018結構工程師《計算機應用基礎》試題(6)”&#xff0c;跟著出國留學網來了解一下吧。要相信只要自己有足夠的實力&#xff0c;無論考什么都不會害怕!2018結構工程師《計算機應用基礎》試題(6)1、下列存儲器中&#xff0…

leetcode1282. 用戶分組(貪心算法)

有 n 位用戶參加活動&#xff0c;他們的 ID 從 0 到 n - 1&#xff0c;每位用戶都 恰好 屬于某一用戶組。給你一個長度為 n 的數組 groupSizes&#xff0c;其中包含每位用戶所處的用戶組的大小&#xff0c;請你返回用戶分組情況&#xff08;存在的用戶組以及每個組中用戶的 ID&…