Git Product home page Git Product logo

Comments (11)

t-oster avatar t-oster commented on August 30, 2024

While you're at it: it may be more convenient to try detecting lines (with hough transform), find lines which form a rectangle (of cause a skewed one) and use the corners for the homography, so no markers are necessary. Every laser-bed will be kind of rectangular and if the user can specify regions of interest for the corners it may be enough for robust detection.

from visicam.

peteruithoven avatar peteruithoven commented on August 30, 2024

"While you're at it... " is quite a pitfall ;) When it works it's easy to improve upon so I would get it working first.

It's also important to check how long each step takes. Maybe it issn't even the opencv step in Java.

from visicam.

peteruithoven avatar peteruithoven commented on August 30, 2024

Interesting read:
http://www.raspberrypi.org/phpBB3/viewtopic.php?t=45758&p=361535
specifying the -t (Time (in ms) before takes picture and shuts down) makes it much faster (default is 5s)
Also storing it on RAM memory should make it faster, and it should be better for the SD card.
This makes raspistill take 2 seconds instead of 8.

from visicam.

peteruithoven avatar peteruithoven commented on August 30, 2024

First speed test.
Using the following settings:

  • InputWidth: 720
  • InputHeight: 576
  • OutputWidth: 720
  • OutputHeight: 576
  • Check "CustomCapture"
  • CaptureCommand: raspistill -t 500 -n -w %w -h %h -o %f -vf -hf
  • CaptureResult: /run/shm/capture.jpg

It outputs the following, the numbers are milliseconds.

start
Taking Snapshot...
snapshot taken: 2851
Finding markers...
  start finding markers: 2855
  found marker: 0: 6287
  start finding markers: 6289
  found marker: 1: 6559
  start finding markers: 6561
  found marker: 2: 6811
  start finding markers: 6813
  found marker: 3: 7081
Found 4/4 markers
Applying transformation...
  CvMat src created: 52
  put markers: 62
  CvMat dst created: 64
  put something else: 67
  CvMat h created: 70
  cvFindHomography: 1085
  created IplImage: 13275
  warped perspecive: 13659
  applied homography: 33983
done: 35397
done

So that means:

  • Taking the snapshot: 2.8 seconds
  • Finding the first marker: 3.3 seconds
  • Finding all the markers: 3.9
  • Applying homography: 28.3 seconds of which:
    • cvFindHomography: 1 second
    • creating IplImage: 12.2 seconds
    • applying homography: 20.3 seconds
  • Serving jpeg: 1.4 seconds

from visicam.

t-oster avatar t-oster commented on August 30, 2024

so... next question is how long it takes to apply the homography via a littel C/C++ program.. maybe we can just source this out. Just a litte tool accepting two filenames and 4 coordinate paris via parameters and does the homography...

from visicam.

renebohne avatar renebohne commented on August 30, 2024

We are also having a look at this now.

  1. We are using raspimjpeg for capturing
  2. I am trying to optimize some parts in Java.

My first idea is to buffer the markers, the matrix src, the matrix dst, and the holography h. I created a fork here:
https://github.com/renebohne/VisiCam/tree/feature-bufferedHomography

For the Pi Cam, I am also thinking about writing a tool that utilises the gpu... but not sure if homography is something that can be done with the pi gpu... here is a first pointer:
http://robotblogging.blogspot.de/2013/10/gpu-accelerated-camera-processing-on.html

from visicam.

peteruithoven avatar peteruithoven commented on August 30, 2024

Really nice that you guys are looking into this.

from visicam.

FroChr123 avatar FroChr123 commented on August 30, 2024

Hi, I am currently working on this as well and I try to move some of the stuff to C++ / GPU computations and to use some Raspberry Pi 2 hardware specific acceleration.

@peteruithoven : Which Java version do you use? Just recently I had to reinstall some of the stuff on a Raspberry Pi 2 and there was a notable difference between older and newer Java versions regarding the performance. If I remember correctly, it needed something around 20s on a JDK 6 and it decreased to ~ 8s with a JDK 8.

from visicam.

fabrikationslabor avatar fabrikationslabor commented on August 30, 2024

FroChr123 is my student... he writes his bachelor thesis that will add QR Codes to VisiCut. They will be used for two things: physical file sharing and augmented reality markers. For the second part, he will need to make VisiCam as fast as possible (real time!).

from visicam.

FroChr123 avatar FroChr123 commented on August 30, 2024

The Raspberry Pi 2 / GPU application is located here:
https://github.com/FroChr123/visicamRPiGPU

This part should nearly be finished. Of course VisiCam needs to be modified a bit to support it correctly, this will be done in the next few days I think.

Both applications need to work together to use the speed boost of the hardware acceleration. Basically the image capturing and the very slow image processing are outsourced from VisiCam to visicamRPiGPU.

VisiCam:
Configuration, networking, marker detection
Homography matrix computation based on original image (input for GPU application, every x seconds)

visicamRPiGPU:
Capture original image (input for VisiCam -> Homography computation, every x seconds)
Compute processed image (input for VisiCam -> Result for network requests)

from visicam.

mgmax avatar mgmax commented on August 30, 2024

Would it be possible to update the wiki page https://github.com/t-oster/VisiCam/wiki/Raspberry-Pi-installation-on-Raspbian and then close this issue?

from visicam.

Related Issues (16)

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.