To receive notifications about scheduled maintenance, please subscribe to the mailing-list gitlab-operations@sympa.ethz.ch. You can subscribe to the mailing-list at https://sympa.ethz.ch

Commit 4c1c3e36 authored by widmerl's avatar widmerl

Update CrazyCamera.py

parent d11ade88
#!/usr/bin/env python
# -*- coding: utf-8 -*-
'''
================================================================================
Finding Marker Balls, labeling them and calculating distance and angle estimates
================================================================================
Using HSV Color Masks this finds the four biggest green balls, detects their positions and
measures distance to the camera (dist) as well as the two angles that define the position
of the camera in the frame of the Marker. Zero is perpendicular to the Marker Plane.
phi_ud for up/down and phi_lr for left/right. The Output Values are filtered by a kalman filter.
Constants:
WIDTH should contain the Width of the Video Frame
BLURR defines the Size of the Gaussian Blurr filter. Should be between 5 and 30
ACT_SIZE defines the distance between the centres of the Markers in mm
FOV defines the field ov view of the camera.
#!/usr/bin/env python
# -*- coding: utf-8 -*-
Marker Structure:
ACT_SIZE at least 100mm
diameter at least 30mm
G means coloured in Green
ACT_SIZE
|----------|
___ ___
/ G \ / G \
\___/ \___/ -
|
|ACT_SIZE
___ ___ |
/ G \ / G \ |
\___/ \___/ -
|---|
diameter
Usage:
q to quit
c to change color, then type "lower h +10" to the Terminal to increase the lower bound of the h value
Copyright 2019 Lars Widmer
'''
======================================================================
Detecting Markers and Pose Estimation using Aruco Publishing them using ROS
======================================================================
This ROS-node looks at a USB connected Image Stream and looks for an Aruco-marker in it.
If it finds one it estimates its pose, filters the pose using a PMKF (Point Mass Kalman Filter)
and publishes it as a ROS-message.
Copyright 2019 Omid Shams, Andrew Irvine and Lars Widmer
'''
#ros stuff import
import roslib; roslib.load_manifest('dfall_pkg')
import rospy
......@@ -294,7 +268,46 @@ if TEXT_OUTPUT:
outr1.close()
outr2.close()
'''
================================================================================
Finding Marker Balls, labeling them and calculating distance and angle estimates
================================================================================
Using HSV Color Masks this finds the four biggest green balls, detects their positions and
measures distance to the camera (dist) as well as the two angles that define the position
of the camera in the frame of the Marker. Zero is perpendicular to the Marker Plane.
phi_ud for up/down and phi_lr for left/right. The Output Values are filtered by a kalman filter.
Constants:
WIDTH should contain the Width of the Video Frame
BLURR defines the Size of the Gaussian Blurr filter. Should be between 5 and 30
ACT_SIZE defines the distance between the centres of the Markers in mm
FOV defines the field ov view of the camera.
Marker Structure:
ACT_SIZE at least 100mm
diameter at least 30mm
G means coloured in Green
ACT_SIZE
|----------|
___ ___
/ G \ / G \
\___/ \___/ -
|
|ACT_SIZE
___ ___ |
/ G \ / G \ |
\___/ \___/ -
|---|
diameter
Usage:
q to quit
c to change color, then type "lower h +10" to the Terminal to increase the lower bound of the h value
'''
# args = vars()
# define the lower and upper boundaries of the "green"
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment