Skip to content

FindObjectsWithWebcam

matlabbe edited this page May 20, 2015 · 5 revisions

Introduction

This tutorial will show how to add an object using your webcam. Note that version 0.4 is used here.

Details

  1. Open Find-Object application.

  1. If it is the first use of Find-Object, go to next step; otherwise, restore all default settings (menu "Edit->Restore all default settings")

  1. Press space to start the webcam. Note that by default, the view is mirrored (you can change this with a right-click on the scene or by changing the parameter "General/mirrorView" using menu "View->parameters").

  1. Open "Edit" menu and select "Add object from scene...".

  1. Place an object in front of the camera and press "Take picture".

  1. Select the region representing the object.

  1. Press next to verify your selection. Then press "End".

  1. Back to main window, you should see the object in the side pane.

  1. Put your object back in front of the camera to see the detection.

  • If the scene doesn't have many features, there may have some bad detections like below. If your scene doesn't contain many features, try General/InvertedSearch mode. For the next, this mode is used.
![](https://raw.githubusercontent.com/wiki/introlab/find-object/doc/tutorial1/9b.png)

![](https://raw.githubusercontent.com/wiki/introlab/find-object/doc/tutorial1/9c.png)
  1. You can add more objects if you want.

  1. You can also right-click on the camera view and uncheck "Show features".

TCP information

Find-Object 0.4.3 required

Some information about objects detected like ID and position are sent over TCP on a port.

  • Publish detected objects (with position, rotation, scale and shear), formatted as [ObjectId1, objectWidth, objectHeight, h11, h12, h13, h21, h22, h23, h31, h32, h33, ObjectId2...] where h## is a 3x3 homography matrix (h31 = dx and h32 = dy, see QTransform). Example handling the message (TcpClient.cpp, TcpClient.h and main.cpp).

  • Raw format: [quint16 (size in bytes of the following QVector<float>) QVector<float>]. The QVector<float> should have a size of 12 float X number of objects.

  • Note that parameter Homography/homographyComputed must be true (default true) in order to publish the topic.

  • Parameter General/mirrorView would be false in order to visualize correctly the homography values returned.

  • You can set manually a port, see parameter General/port.

  • On ROS, a topic named "/objects" containing the same data is sent. See here.

Clone this wiki locally