Vision library

Index:

Functions:

start-video-server

start-video-server

Synopsis
Starts a video server.
Usage
(start-video-server
  "port" => port
  "camera" => camera
  "resolution" => resolution
)
Returns
result
Where
  • port is number[0..1]: the port to listen for connections.
  • camera is string[0..1]: the name of the camera to select. If not specified, the default camera of the system is selected.
  • resolution is string[0..1]: the name of the resolution to use (QVGA, VGA, SVGA, HD, FHD, etc).
  • result is string[0..1]: a message indicating the listening port and camera resolution of the server. It will be null if the server can not be started.
Description
Starts a video server on the specified port. It will serve the image from the given camera at the specified resolution in MJPEG format (Motion JPEG).
Examples
(start-video-server)
"video server listening on port 8080, resolution: VGA 640x480 (4:3)"
(start-video-server
  "port" => 9090
  "resolution" => "QVGA"
)
"video server listening on port 9090, resolution: VGA 320x240 (4:3)"
stop-video-server

stop-video-server

Synopsis
Stops a video server.
Usage
(stop-video-server "port" => port)
Returns
result
Where
  • port is number[0..1]: the port where the server is listening for connections.
  • result is string[0..1]: a message indicating that the server was stopped. It will be null if the server can not be stopped.
Description
Stops the video server running on the specified port.
Examples
(stop-video-server)
"video server on port 8080 stopped."
(stop-video-server "port" => 9090)
"video server on port 9090 stopped."
video-cameras

video-cameras

Synopsis
List the video cameras available in the system.
Usage
(video-cameras)
Returns
(camera ... camera)
Where
  • camera is (
      "name" => name
      "resolutions" => (resolution ... resolution)
      "device" => device
      "fps" => fps
    )
    [0..N]
  • name is string: the name of the camera.
  • device is string: the camera device description.
  • fps is number[0..1]: the maximum frames per second supported by the camera.
  • resolution is (width height)[1..N]: a supported camera resolution.
  • width is number: the width in pixels of the resolution.
  • height is number: the height in pixels of the resolution.
Description
Retuns a list that contains for each available camera a sublist describing its features.
Examples
(video-cameras)
(
  (
    "name" =>
    "Cámara FaceTime HD (integrada) 0x1a11000005ac8510"
    "device" =>
    "Cámara FaceTime HD (integrada) 0x1a11000005ac8510"
    "resolutions" =>
    ((176 144) (320 240) (640 480))
  )
)
vision-fiducials

vision-fiducials

Synopsis
Detects fiducials of an image.
Usage
(vision-fiducials
  url
  "camera-parameters" => camera_parameters
)
Returns
(
  "size" => (width height)
  "detections" => (detection ... detection)
)
Where
  • url is string: the url of the image to process. If url do not start with a protocol scheme (*://), url is assumed to be a path in the local file system.
  • camera_parameters is (cx cy fx fy)[0..1]: the camera parameters.
  • width is number: the width in pixels of the processed image.
  • height is number: the height in pixels of the processed image.
  • detection is (
      "id" => id
      "origin" => (ox oy)
      "x-axis" => (x y)
      "y-axis" => (x y)
      "z-axis" => (x y)
      "normal" => (nx ny nz)
    )
    [0..N]: a fiducial detection data structure.
  • id is number: the id that encodes the fiducial.
  • ox is number: the x coordinate in pixels of the origin of the fiducial.
  • oy is number: the y coordinate of pixels of the origin of the fiducial.
  • x is number: the x coordinate of the axis.
  • y is number: the y coordinate of the axis.
  • nx is number: the x coordinate of the normal vector of the fiducial.
  • ny is number: the y coordinate of the normal vector of the fiducial.
  • nz is number: the z coordinate of the normal vector of the fiducial.
  • cx is number: the CameraPinhole.cx (see http://boofcv.org).
  • cy is number: the CameraPinhole.cy (see http://boofcv.org).
  • fx is number: the CameraPinhole.fx (see http://boofcv.org).
  • fy is number: the CameraPinhole.fy (see http://boofcv.org).
Description
This function returns a list of all fiducials detected in the given image. For each of these fiducials, the fiducial id, its position and orientation are provided.
Examples
(vision-fiducials
  "http://localhost:8080/photo.jpg"
)
(
  "size" => (640 480)
  "detections" =>
  (
    (
      "id" => 45
      "origin" => (230 240)
      "x-axis" => (120 20)
      "y-axis" => (12 110)
      "z-axis" => (1 2)
      "normal" => (0 0 1)
    )
  )
)
Top