Comments (11)
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.
"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.
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.
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.
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.
We are also having a look at this now.
- We are using raspimjpeg for capturing
- 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.
Really nice that you guys are looking into this.
from visicam.
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.
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.
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.
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)
- OpenCV Capture or Webcam Capture ? HOT 9
- Raspberry Pi installation HOT 2
- "libjniopencv_core.so: cannot open shared object file: No such file or directory" HOT 13
- Installing VisiCam on Raspberry Pi running Arch Linux HOT 4
- Easier installation on Raspberry Pi? HOT 7
- Size and position configuration HOT 4
- return error image when marker not detected HOT 5
- run as system service HOT 3
- Replace Round markers by Line-Detection of Laser-Bed edges HOT 1
- cache response for concurrent requests
- Config does not save when Raspi integration disabled HOT 2
- Update HOT 1
- Please enable travis-ci
- Raspberry Pi GPU Integration broken?
- Visicam still broken HOT 2
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from visicam.