<< return to Pixycam.com

User Tools

Site Tools


wiki:v2:line_pixymon

Line tracking program

This program performs line tracking and is intended for robots that follow lines. More information about this algorithm can be found here.

Line tracking View menu

This menu contains the different views available in PixyMon for the line tracking program. To bring up this menu, you must be running the line_tracking program by selecting it in the Program menu, and then clicking on the View menu in the menubar.

  • Primary features, no background: This view shows a black background with the Vector, intersection, and barcode features shown as separate layers. This view is minimal in its representation of what Pixy2 is detecting and has the advantage that it doesn't slow Pixy2's image processing down much. This view usually allows Pixy2 to process frames at the full 60 frames-per-second. PixyMon will usually display at 60 frames-per-second as well with this view.
  • Primary features: This view shows a black-and-white background layer in addition to Vector, intersection, and barcode features shown as separate layers. This view usually slows down Pixy2's processing because the background layer takes time to transfer over USB.
  • All features: This view is the same as the Primary features view but adds all detected (but filtered) lines and intersections. This view essentially renders all of the data that's returned in getAllFeatures() in the line tracking API. This view further slows down Pixy2's processing because the background layer and extra features take time to transfer over USB.
2018/06/07 14:31 · pixycam

Line tracking Tuning tab

This tab contains all of the most effective parameters for “tuning” the accuracy of the line tracking algorithm. To bring up this tab, you must be running the line_tracking program by selecting it in the Program menu, and then bringing up the Configure Dialog (click on the gear icon or select File➜Configure). Now select the Tuning tab under Pixy Parameters (it should be the first pane you see when you bring up the Configure Dialog.)

  • Edge threshold: Adjusting this parameter determines how inclusive the line detection algorithm is. If the edge threshold is decreased, more potential lines will be detected. If it's increased, less potential lines will be detected. If Pixy2 isn't detecting the lines you want it to detect, this is likely the parameter that needs to be adjusted.
  • Maximum line width: This adjusts the maximum width of the detected lines (in pixels.) Lines that are wider will not be detected.
  • Minimum line width: This adjusts the minimum width of the detected lines (in pixels.) Lines that are narrower will not be detected.
  • White line: Enabling this parameter will change Pixy2's line detection algorithm from dark lines on a light background to light lines on a dark background.
  • Camera brightness: This parameter is in all Tuning tabs regardless of the program that's being run. It sets the exposure setting of Pixy, which controls the brightness of the image. The Camera Brightness setting is important because the correct exposure setting will lead to the best detection accuracy.
2018/06/05 19:43 · pixycam
2018/06/05 22:05 · pixycam

Line tracking Expert tab

This tab contains more advanced parameters for adjusting various line tracking things. To bring up this tab, you must be running the line_tracking program by selecting it in the Program menu, and then bringing up the Configure Dialog (click on the gear icon or select File➜Configure). Now select the Expert tab under Pixy Parameters.

Warning! These are “expert” parameters. Some are used for testing/debugging and furthermore may cause the line tracking algorithm to act strangely for some values. No smoke will pour out of your Pixy2 (that's good) but exercising a little caution is advised!

  • Edge distance: This parameter adjusts the distance (in pixels) between the edge detector. Increasing this value will help detect edges that are less distinct (fuzzier), but increasing will affect the barcode detection and decoding – that is, it will increase the minimum barcode size.
  • Line extraction distance: This parameter is used for testing/debugging and currently has no effect.
  • Maximum line compare: This parameter can be thought of as maximum line velocity parameter for tracking lines between frames. For example, if a line moves from one side of the frame to the other side of the frame in one frame period (i.e. improbably large line velocity), it's probably not the same line, so this parameter is a sanity check for the tracking algorithm. Decreasing this value tells the algorithm to be more restrictive regarding the line velocity. Increasing the value tells the algorithm to be less restrictive regarding line velocity.
  • Maximum merge distance: This parameter determines how far the line tracking algorithm searches for nearby lines that might form an intersection. If the lines you are trying to track are wider, you should increase this parameter until the intersections formed with the wider lines are accurately detected.
  • Minimum line length: This tells the algorithm to throw out lines shorter than this parameter.
  • Line filtering: Increasing this parameter leads to more filtering and can result in less false positive line detections, but with some added latency regarding when new lines are reported.
  • Intersection filtering: Increasing this parameter leads to more filtering and can result in less false positive intersection detections, but with some added latency regarding when new intersections are reported.
  • Barcode filtering: Increasing this parameter leads to more filtering and can result in less false positive barcode detections, but with some added latency regarding when new barcodes are reported.
  • Default turn angle: This parameter sets the path the algorithm takes when encountering an intersection. The algorithm will pick the path that is closest to the specified angle. Turn angles are specified in degrees, with 0 being straight ahead, left being 90 and right being -90 (for example), although any valid angle value can be used. Valid angles are between -180 and 180. This parameter is usually set to 0, which essentially means “go straight at intersections (or pick the straightest path) unless I tell you otherwise.” Telling the algorithm otherwise is done through setNextTurn() in the API.
  • Delayed turn: This parameter tells the algorithm to stop choosing paths at intersections automatically. It requires the client program to indicate the path with setNextTurn() in the API before the intersection goes out of frame. It's an extra expert option. It's included because sometimes you might not know which way to turn at the next intersection until you actually see the intersection (the number of branches and their angles, for example.) It's also useful? fun? to set it because PixyMon will dutifully label the intersections: “3-way intersection”, “4-way intersection”, etc. because it doesn't know which way to turn yet.
  • Manual vector select: When the algorithm initializes, it needs to figure out which line should be the Vector, a.k.a. the line you want to follow. It will automatically choose the Vector based on some characteristics that it thinks are attractive, like a line that intersects the bottom of the frame and/or a line that is close to vertical. You can bypass this selection process by enabling this parameter. The algorithm will then set the Vector based on setVector() calls through the API.
  • Default program: This parameter shows up in all Expert tabs regardless of the program that's currently running. It sets the program that gets executed upon power-up. The available programs are listed in the pulldown menu.
  • Program select on power-up: This parameter shows up in all Expert tabs regardless of the program that's currently running. Enabling this will enable the button program selection upon power-up.
  • Debug: This parameter shows up in all Expert tabs regardless of the program that's currently running. It sets the debug level within Pixy2. Setting the value to 0 means that no debugging information is displayed.
2018/06/05 18:56 · pixycam
2018/06/06 02:40 · pixycam

Barcode Labels tab

The Barcode Labels tab allows you to label barcodes that are detected by Pixy2. To bring up this tab, you must be running the line_tracking program by selecting it in the Program menu, and then bringing up the Configure Dialog (click on the gear icon or select File➜Configure). Now select the Barcode Labels tab under Pixy Parameters.

Note that the barcode labels are stored on Pixy2. So if you set some barcode labels and then plug your Pixy2 into another computer running PixyMon, the labels will be there.

To label a barcode, simply type in the label and click on Apply or OK.

Detected barcodes that match this barcode will then be labeled in PixyMon.

2018/06/05 21:12 · pixycam
wiki/v2/line_pixymon.txt · Last modified: 2018/06/07 14:46 by pixycam