GithubHelp home page GithubHelp logo

Comments (3)

gen2brain avatar gen2brain commented on May 20, 2024

Thanks for suggestion. That looks complicated, what about client, you have example of that? I wanted to switch html to draw images with WebGL by default (there is an option now), that would further complicate everything.

Also, what about CPU usage, that would probably increase it. I guess that in Go Image At() needs to be used to get RGBA values for the pixel etc.

from cam2ip.

isubasinghe avatar isubasinghe commented on May 20, 2024

It isnt really much complicated, it just looks that way because of c++ and opencv library. All you would have to do is have the ability to change the pixel values of a webgl frame(?, sorry i have no idea about webgl).

  1. [Server]: Send the frame size first. store into ->fsize

  2. [Server & Client]: First you would have a initial previous frame in both server and client, say an all black image of size fsize. Store into -> prev

  3. [Server]: fetch next image. store into -> next

  4. [Server]: get the difference in the previous one and and next. Store into -> diff

  5. [Server]: Jpeg compress into a buffer. Store into -> jpegbuff

  6. [Server]: Send jpegbuff to client

  7. [Client]: receive jpegbuff. Sotre into -> jpegbuff

  8. [Client]: uncompress jpegbuff. Store into -> diff

  9. [Client]: Add diff to prev. -> Store in next

  10. [Client]: next is the received frame, print it out in the browser.

  11. Go to 2

CPU usage isnt a worry at all, in my case I have to do an extra 307, 200 integer operations (640x480). This is obviously really tiny compared to what modern computers can do. Lets assume that we have a computer with a clock rate of 1 mega hertz, that is 1, 000, 000 cycles per second, lets also assume this cpu takes 1 cycle to add a 32 bit integer( note we use 8 bit integer in our matrix, meaning ours should be faster), we still can compute the matrix values in 0.3 seconds( Note that even in 1990 cpu speeds were about 25 Mega hertz, meaning back then we could process this in 0.012 seconds).

In conclusion cpu usage is insignificant.

I am actually writing something really similar to your project, i will update with a link after november 14th ( I have my university exams until then)

from cam2ip.

isubasinghe avatar isubasinghe commented on May 20, 2024

@gen2brain The process for multiple clients is actually way more complicated, you need to keep the buffers in sync, I think this approach to save bandwidth is not worth the time. Closing this issue

from cam2ip.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.