<< return to Pixycam.com

User Tools

Site Tools


wiki:v2:teach_pixy_an_object_2

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Next revision
Previous revision
wiki:v2:teach_pixy_an_object_2 [2018/04/09 21:52]
jfrench - Imported by DokuWiki Advanced Plugin
wiki:v2:teach_pixy_an_object_2 [2018/05/23 22:24] (current)
pixycam
Line 3: Line 3:
  
  
-====== Teach Pixy an Object ======+====== Teach Pixy2 an Object ======
  
-Teaching ​Pixy an object is super easy, but first let's talk about which objects will work well with PixyPixy uses a hue-based color filtering algorithm to detect objects. Since Pixy uses hue (color), the object needs to have a distinct hue. Here are some objects that are good because they have good, distinct hues.+Teaching ​Pixy2 an object is super easy, but first let's talk about which objects will work well with Pixy2Pixy2 uses a hue-based color filtering algorithm to detect objects. Since Pixy2 uses hue (color), the object needs to have a distinct hue. Here are some objects that are good because they have good, distinct hues.
  
 {{wiki:​img:​d716651b2ab6faadfca267056faddc41ead7d737.jpg?​100}}\\ {{wiki:​img:​d716651b2ab6faadfca267056faddc41ead7d737.jpg?​100}}\\
Line 15: Line 15:
 {{wiki:​img:​d4e497a0f1f1167bd24e048a6890b187507bc25e.png?​100}} {{wiki:​img:​d4e497a0f1f1167bd24e048a6890b187507bc25e.png?​100}}
  
-Keeping these guidelines in mind, choose an object to teach Pixy. (First, apply power to Pixy via battery or USB cable if you haven'​t already. When you power up Pixy, it will go through a series of LED flashes. Wait for the LED to turn off before teaching ​Pixy an object.) Now, hold down the button on top of Pixy. After about 1 second, the LED will turn on - first white, then red, then other colors - but when it turns red, release the button.+Keeping these guidelines in mind, choose an object to teach Pixy2. (First, apply power to Pixy2 via battery or USB cable if you haven'​t already. When you power up Pixy2, it will go through a series of LED flashes. Wait for the LED to turn off before teaching ​Pixy2 an object.) Now, hold down the button on top of Pixy2. After about 1 second, the LED will turn on - first white, then red, then other colors - but when it turns red, release the button.
  
-When you release the button, ​Pixy will enter what's called "light pipe" mode, where the LED color is the color of the object that Pixy has "​locked"​ onto. Pixy will lock onto objects in the center of its video frame, so hold the object directly in front of Pixy, between 6 and 20 inches from the lens.+When you release the button, ​Pixy2 will enter what's called "light pipe" mode, where the LED color is the color of the object that Pixy2 has "​locked"​ onto. Pixy2 will lock onto objects in the center of its video frame, so hold the object directly in front of Pixy2, between 6 and 20 inches from the lens.
  
-Pixy uses a region growing algorithm to try to determine which pixels are part of your object and which pixels are part of the background. Using these pixels, ​Pixy will try to create a statistical model of your object so it can detect it reliably under different lighting conditions. Use the LED color as feedback to determine if Pixy has a good lock on the object, and use the following guidelines to judge:+Pixy2 uses a region growing algorithm to try to determine which pixels are part of your object and which pixels are part of the background. Using these pixels, ​Pixy2 will try to create a statistical model of your object so it can detect it reliably under different lighting conditions. Use the LED color as feedback to determine if Pixy2 has a good lock on the object, and use the following guidelines to judge:
  
-  1. When Pixy has locked onto your object, the LED color should match the color of your object.+  1. When Pixy2 has locked onto your object, the LED color should match the color of your object.
   2. The brighter the LED, the better the lock. Move the object a little and see if you can maximize the LED brightness.   2. The brighter the LED, the better the lock. Move the object a little and see if you can maximize the LED brightness.
   3. Look at the region-growing grid in the PixyMon window and see how the size of the grid corresponds to the LED color and brightness. A grid that covers more of your object is better than a grid that covers only some of your object and results in a brighter LED. The picture below shows a grid that covers most of the object (good).\\   3. Look at the region-growing grid in the PixyMon window and see how the size of the grid corresponds to the LED color and brightness. A grid that covers more of your object is better than a grid that covers only some of your object and results in a brighter LED. The picture below shows a grid that covers most of the object (good).\\
-{{wiki:img:7db5032b3268d3d135423b3db4c4daf741bb0e91.png?400}}+{{wiki:v2:image_211.png}}
  
-Learning when Pixy has a decent lock by looking at the LED might take a little practice, but once you get the feel of it, you can teach Pixy new objects reliably **without needing to use PixyMon**!+Learning when Pixy2 has a decent lock by looking at the LED might take a little practice, but once you get the feel of it, you can teach Pixy2 new objects reliably **without needing to use PixyMon**!
  
-When you are satisfied, press and release the button on Pixy, like you'd click your mouse. The LED will flash a couple times indicating that Pixy has now "​learned"​ your object. It will now start tracking your object. +When you are satisfied, press and release the button on Pixy2, like you'd click your mouse. The LED will flash a couple times indicating that Pixy2 has now "​learned"​ your object. It will now start tracking your object.
- +
-The video below is a good short "​how-to"​ regarding teaching Pixy objects. +
- +
-{{youtube>​XdQwZi6l9Ns?​480x360)}}+
  
  
 ==== Multiple Signatures ==== ==== Multiple Signatures ====
  
-Pixy can learn up to seven color signatures. We can teach Pixy the 1st color signature by releasing the button when the LED turns red. If we continue to hold down the button, the LED will turn orange, yellow, etc., indicating the remaining color signatures. Here are the signatures in order:+Pixy2 can learn up to seven color signatures. We can teach Pixy2 the 1st color signature by releasing the button when the LED turns red. If we continue to hold down the button, the LED will turn orange, yellow, etc., indicating the remaining color signatures. Here are the signatures in order:
  
   1. Red   1. Red
Line 49: Line 45:
 The color signature number is determined by //when// you release the button. Release the button when the LED is yellow and you're teaching signature 3. Release the button when the LED is blue and you're teaching signature 6. These colors //are not related to the hue of the object//. The colors are used only to indicate the signature number. So, for example, signature 1 can be a yellow object, even though signature 1 is indicated by a red LED, and signature 2 could be a pink object even though signature 2 is indicated by an orange LED. The color signature number is determined by //when// you release the button. Release the button when the LED is yellow and you're teaching signature 3. Release the button when the LED is blue and you're teaching signature 6. These colors //are not related to the hue of the object//. The colors are used only to indicate the signature number. So, for example, signature 1 can be a yellow object, even though signature 1 is indicated by a red LED, and signature 2 could be a pink object even though signature 2 is indicated by an orange LED.
  
-After you teach Pixy a signature, it saves the signature in flash, so when you power cycle your Pixy, it will remember the signatures you taught it and continue to track objects that match these signatures.+After you teach Pixy2 a signature, it saves the signature in flash, so when you power cycle your Pixy2, it will remember the signatures you taught it and continue to track objects that match these signatures.
  
-If you accidentally find yourself teaching signature 2 when you meant to teach signature 1 (i.e. you released the button when it was orange instead of red), for example, ​just hold down the button until the LED turns off. This is how you tell Pixy to cancel teach mode. You can then start over by holding the button down again.+If you accidentally find yourself teaching signature 2 when you meant to teach signature 1 (i.e. you released the button when it was orange instead of red) just hold down the button until the LED turns off. This is how you tell Pixy2 to cancel teach mode. You can then start over by holding the button down again.
  
  
Line 58: Line 54:
 Some types of lighting (such as incandescent) have a reddish hue and others (such as fluorescent) have a bluish hue. The lighting can affect your color signatures. For example, if you teach an object under incandescent lighting and move into a room with fluorescent lighting, the color signatures will likely no longer work as well. You can either re-teach all signatures or you can adjust the white balance. Some types of lighting (such as incandescent) have a reddish hue and others (such as fluorescent) have a bluish hue. The lighting can affect your color signatures. For example, if you teach an object under incandescent lighting and move into a room with fluorescent lighting, the color signatures will likely no longer work as well. You can either re-teach all signatures or you can adjust the white balance.
  
-When you first apply power to Pixy, it will spend the first 5 or so seconds determining the correct white balance to use. It will then disable automatic white balance. If you wish to readjust the white balance, hold down the button until the LED turns white and release. It happens quickly, so be prepared! ​Pixy is now in automatic white balance mode. You can hold a white sheet of paper in front of Pixy so Pixy can adjust the white balance. It only takes 2 or 3 seconds to adjust the white balance, after which you can press and release the button (like a mouse click). The LED will flash, indicating success, and now Pixy is "​rebalanced"​.+When you first apply power to Pixy2, it will spend the first 5 or so seconds determining the correct white balance to use. It will then disable automatic white balance. If you wish to readjust the white balance, hold down the button until the LED turns white and release. It happens quickly, so be prepared! ​Pixy2 is now in automatic white balance mode. You can hold a white sheet of paper in front of Pixy2 so Pixy2 can adjust the white balance. It only takes 2 or 3 seconds to adjust the white balance, after which you can press and release the button (like a mouse click). The LED will flash, indicating success, and now Pixy2 is "​rebalanced"​.
  
  
 ==== Teaching through PixyMon ==== ==== Teaching through PixyMon ====
  
-You can also teach Pixy an object through PixyMon. This may be useful if the object you want to teach is small, or if you want more control over which pixels are used for teaching. Begin by plugging in the USB cable between ​Pixy and your computer and running PixyMon.+You can also teach Pixy2 an object through PixyMon. This may be useful if the object you want to teach is small, or if you want more control over which pixels are used for teaching. Begin by plugging in the USB cable between ​Pixy2 and your computer and running PixyMon.
  
-Now hold the object you want to teach in front of Pixy and select **Action➜Set signature 1** from the pulldown menu.+Now hold the object you want to teach in front of Pixy2 and select **Action➜Set signature 1** from the pulldown menu.
  
-{{wiki:img:9741abb6ffca0398ca19b8787d768391cad30e4f.jpg?400}}+{{wiki:v2:image_216.png}}
  
-Using the mouse, click and drag to select the region you want Pixy to use to learn the object.+Using the mouse, click and drag to select the region you want Pixy2 to use to learn the object.
  
-{{wiki:img:bd4d93961009ff69dc6e2c3694c03030f4d936fc.jpg?400}}+{{wiki:v2:image_212.png}}
  
-That's it! After you select the region, ​Pixy will "​learn"​ the object and automatically ​go into "​cooked"​ video mode so you can verify how well your color signature is working.+That's it! After you select the region, ​Pixy2 will "​learn"​ the object and automatically ​and start tracking it.
  
-{{wiki:img:7ac22cd97d695677accc67aa254a703bf5337d90.jpg?400}}+{{wiki:v2:image_214.png}}
  
  
 ==== Signature tuning ==== ==== Signature tuning ====
  
-Sometimes the color signatures you teach Pixy need to be "​tweaked"​ -- that is, you are getting some false positives (Pixy is detecting objects that aren't the objects that you intended) or false negatives (Pixy isn't detecting the object you just taught it, or it's detecting the object intermittently.) You can tweak things by bringing up the Configure dialog (click on the gear icon or select **File➜Configure**). Select the **Signature ​Tuning** pane under **Pixy Parameters**.+Sometimes the color signatures you teach Pixy2 need to be "​tweaked"​ -- that is, you are getting some false positives (Pixy2 is detecting objects that aren't the objects that you intended) or false negatives (Pixy2 isn't detecting the object you just taught it, or it's detecting the object intermittently.) You can tweak things by bringing up the Configure dialog (click on the gear icon or select **File➜Configure**). Select the **Tuning** pane under **Pixy2 Parameters**.
  
-{{wiki:img:5da46fa93bdaa8eaf21ecf2c7e420168ae2c3fb2.jpg?400|Signature ​Tuning pane}}+{{wiki:v2:image_226.png|Tuning pane}}
  
 Use the slider for **Signature 1 range** to adjust the inclusiveness of signature 1 (assuming it's signature 1 you're wanting to adjust). Slide it to the left if you want to be less inclusive (i.e. if you're seeing false positives, like the picture below): Use the slider for **Signature 1 range** to adjust the inclusiveness of signature 1 (assuming it's signature 1 you're wanting to adjust). Slide it to the left if you want to be less inclusive (i.e. if you're seeing false positives, like the picture below):
  
-{{wiki:img:117233991728b5aa18b48dc39c9a0a74ff42d55f.jpg?400}}+{{wiki:v2:image_219.png}}
  
 or slide it to the right if you want to be more inclusive (i.e. you're seeing false negatives) or the detection is intermittent or sparse (like in the picture below): or slide it to the right if you want to be more inclusive (i.e. you're seeing false negatives) or the detection is intermittent or sparse (like in the picture below):
  
-{{wiki:img:96f668332d6d1f87a375a66f9096881faf767d79.jpg?400}}+{{wiki:v2:image_222.png}}
  
 Choose a slider value that provides good strong detection, like the picture below: Choose a slider value that provides good strong detection, like the picture below:
  
-{{wiki:img:2de53156e5b89711f854a6329c2c5f569952f7cb.jpg?400}}+{{wiki:v2:image_223.png}}
  
 You can adjust all seven color signatures this way to maximize detection accuracy for all signatures. Be sure to press **Apply** or **OK** to save the slider ranges! The adjusted values won't be saved if you press **Cancel** or dismiss the dialog. You can adjust all seven color signatures this way to maximize detection accuracy for all signatures. Be sure to press **Apply** or **OK** to save the slider ranges! The adjusted values won't be saved if you press **Cancel** or dismiss the dialog.
wiki/v2/teach_pixy_an_object_2.1523310722.txt.gz · Last modified: 2018/04/09 21:52 by jfrench