Fix errors in Vision examples.
Change-Id: I752a99ff7b8872a0fc8926e3633c2b521383bbd0
@@ -9,6 +9,8 @@
|
||||
* To use a USB camera instead, see the IntermediateVision example for details
|
||||
* on using the USB camera. To use an Axis Camera, see the AxisCamera example for details on
|
||||
* using an Axis Camera.
|
||||
*
|
||||
* Sample images can be found here: http://wp.wpi.edu/wpilib/2015/01/16/sample-images-for-vision-projects/
|
||||
*/
|
||||
class VisionColor2015Sample : public SampleRobot
|
||||
{
|
||||
@@ -69,7 +71,7 @@ public:
|
||||
void Autonomous() override {
|
||||
while (IsAutonomous() && IsEnabled())
|
||||
{
|
||||
//read file in from disk. For this example to run you need to copy image20.jpg from the SampleImages folder in this project to the
|
||||
//read file in from disk. For this example to run you need to copy image20.jpg from the SampleImages folder to the
|
||||
//directory shown below using FTP or SFTP: http://wpilib.screenstepslive.com/s/4485/m/24166/l/282299-roborio-ftp
|
||||
imaqError = imaqReadFile(frame, "//home//lvuser//SampleImages//image20.jpg", NULL, NULL);
|
||||
|
||||
@@ -115,9 +117,9 @@ public:
|
||||
imaqMeasureParticle(binaryFrame, particleIndex, 0, IMAQ_MT_BOUNDING_RECT_LEFT, &(par.BoundingRectLeft));
|
||||
imaqMeasureParticle(binaryFrame, particleIndex, 0, IMAQ_MT_BOUNDING_RECT_BOTTOM, &(par.BoundingRectBottom));
|
||||
imaqMeasureParticle(binaryFrame, particleIndex, 0, IMAQ_MT_BOUNDING_RECT_RIGHT, &(par.BoundingRectRight));
|
||||
particles.push_back(*par);
|
||||
particles.push_back(par);
|
||||
}
|
||||
sort(particles->begin(), particles->end(), CompareParticleSizes);
|
||||
sort(particles.begin(), particles.end(), CompareParticleSizes);
|
||||
|
||||
//This example only scores the largest particle. Extending to score all particles and choosing the desired one is left as an exercise
|
||||
//for the reader. Note that the long and short side scores expect a single tote and will not work for a stack of 2 or more totes.
|
||||
@@ -157,7 +159,7 @@ public:
|
||||
if(error < ERR_SUCCESS) {
|
||||
DriverStation::ReportError("Send To Dashboard error: " + std::to_string((long)imaqError) + "\n");
|
||||
} else {
|
||||
CameraServer::GetInstance()->SetImage(binaryFrame);
|
||||
CameraServer::GetInstance()->SetImage(image);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -9,6 +9,8 @@
|
||||
* To use a USB camera instead, see the IntermediateVision example for details
|
||||
* on using the USB camera. To use an Axis Camera, see the AxisCamera example for details on
|
||||
* using an Axis Camera.
|
||||
*
|
||||
* Sample images can be found here: http://wp.wpi.edu/wpilib/2015/01/16/sample-images-for-vision-projects/
|
||||
*/
|
||||
class VisionRetro2015Sample : public SampleRobot
|
||||
{
|
||||
@@ -66,7 +68,7 @@ public:
|
||||
void Autonomous() override {
|
||||
while (IsAutonomous() && IsEnabled())
|
||||
{
|
||||
//read file in from disk. For this example to run you need to copy image.jpg from the SampleImages folder in this project to the
|
||||
//read file in from disk. For this example to run you need to copy image.jpg from the SampleImages folder to the
|
||||
//directory shown below using FTP or SFTP: http://wpilib.screenstepslive.com/s/4485/m/24166/l/282299-roborio-ftp
|
||||
imaqError = imaqReadFile(frame, "//home//lvuser//SampleImages//image.jpg", NULL, NULL);
|
||||
|
||||
|
||||
|
Before Width: | Height: | Size: 364 KiB |
|
Before Width: | Height: | Size: 10 KiB |
|
Before Width: | Height: | Size: 19 KiB |
|
Before Width: | Height: | Size: 18 KiB |
|
Before Width: | Height: | Size: 14 KiB |
|
Before Width: | Height: | Size: 17 KiB |
|
Before Width: | Height: | Size: 12 KiB |
|
Before Width: | Height: | Size: 12 KiB |
|
Before Width: | Height: | Size: 32 KiB |
|
Before Width: | Height: | Size: 32 KiB |
|
Before Width: | Height: | Size: 37 KiB |
|
Before Width: | Height: | Size: 31 KiB |
|
Before Width: | Height: | Size: 12 KiB |
|
Before Width: | Height: | Size: 40 KiB |
|
Before Width: | Height: | Size: 39 KiB |
|
Before Width: | Height: | Size: 11 KiB |
|
Before Width: | Height: | Size: 16 KiB |
|
Before Width: | Height: | Size: 10 KiB |
|
Before Width: | Height: | Size: 11 KiB |
|
Before Width: | Height: | Size: 12 KiB |
|
Before Width: | Height: | Size: 24 KiB |
|
Before Width: | Height: | Size: 16 KiB |
@@ -349,53 +349,10 @@
|
||||
</tags>
|
||||
<packages>
|
||||
<package>src</package>
|
||||
<package>SampleImages</package>
|
||||
</packages>
|
||||
<files>
|
||||
<file source="examples/2015Vision/Color_src/Robot.cpp"
|
||||
destination="src/Robot.cpp"></file>
|
||||
<file source="examples/2015Vision/SampleImages/image.jpg"
|
||||
destination="SampleImages/image.jpg"></file>
|
||||
<file source="examples/2015Vision/SampleImages/image2.jpg"
|
||||
destination="SampleImages/image2.jpg"></file>
|
||||
<file source="examples/2015Vision/SampleImages/image3.jpg"
|
||||
destination="SampleImages/image3.jpg"></file>
|
||||
<file source="examples/2015Vision/SampleImages/image4.jpg"
|
||||
destination="SampleImages/image4.jpg"></file>
|
||||
<file source="examples/2015Vision/SampleImages/image5.jpg"
|
||||
destination="SampleImages/image5.jpg"></file>
|
||||
<file source="examples/2015Vision/SampleImages/image6.jpg"
|
||||
destination="SampleImages/image6.jpg"></file>
|
||||
<file source="examples/2015Vision/SampleImages/image7.jpg"
|
||||
destination="SampleImages/image7.jpg"></file>
|
||||
<file source="examples/2015Vision/SampleImages/image8.jpg"
|
||||
destination="SampleImages/image8.jpg"></file>
|
||||
<file source="examples/2015Vision/SampleImages/image9.jpg"
|
||||
destination="SampleImages/image9.jpg"></file>
|
||||
<file source="examples/2015Vision/SampleImages/image10.jpg"
|
||||
destination="SampleImages/image10.jpg"></file>
|
||||
<file source="examples/2015Vision/SampleImages/image11.jpg"
|
||||
destination="SampleImages/image11.jpg"></file>
|
||||
<file source="examples/2015Vision/SampleImages/image12.jpg"
|
||||
destination="SampleImages/image12.jpg"></file>
|
||||
<file source="examples/2015Vision/SampleImages/image13.jpg"
|
||||
destination="SampleImages/image13.jpg"></file>
|
||||
<file source="examples/2015Vision/SampleImages/image14.jpg"
|
||||
destination="SampleImages/image14.jpg"></file>
|
||||
<file source="examples/2015Vision/SampleImages/image15.jpg"
|
||||
destination="SampleImages/image15.jpg"></file>
|
||||
<file source="examples/2015Vision/SampleImages/image16.jpg"
|
||||
destination="SampleImages/image16.jpg"></file>
|
||||
<file source="examples/2015Vision/SampleImages/image17.jpg"
|
||||
destination="SampleImages/image17.jpg"></file>
|
||||
<file source="examples/2015Vision/SampleImages/image18.jpg"
|
||||
destination="SampleImages/image18.jpg"></file>
|
||||
<file source="examples/2015Vision/SampleImages/image19.jpg"
|
||||
destination="SampleImages/image19.jpg"></file>
|
||||
<file source="examples/2015Vision/SampleImages/image20.jpg"
|
||||
destination="SampleImages/image20.jpg"></file>
|
||||
<file source="examples/2015Vision/SampleImages/IMG_1800.png"
|
||||
destination="SampleImages/IMG_1800.png"></file>
|
||||
</files>
|
||||
</example>
|
||||
|
||||
@@ -412,53 +369,10 @@
|
||||
</tags>
|
||||
<packages>
|
||||
<package>src</package>
|
||||
<package>SampleImages</package>
|
||||
</packages>
|
||||
<files>
|
||||
<file source="examples/2015Vision/Retro_src/Robot.cpp"
|
||||
destination="src/Robot.cpp"></file>
|
||||
<file source="examples/2015Vision/SampleImages/image.jpg"
|
||||
destination="SampleImages/image.jpg"></file>
|
||||
<file source="examples/2015Vision/SampleImages/image2.jpg"
|
||||
destination="SampleImages/image2.jpg"></file>
|
||||
<file source="examples/2015Vision/SampleImages/image3.jpg"
|
||||
destination="SampleImages/image3.jpg"></file>
|
||||
<file source="examples/2015Vision/SampleImages/image4.jpg"
|
||||
destination="SampleImages/image4.jpg"></file>
|
||||
<file source="examples/2015Vision/SampleImages/image5.jpg"
|
||||
destination="SampleImages/image5.jpg"></file>
|
||||
<file source="examples/2015Vision/SampleImages/image6.jpg"
|
||||
destination="SampleImages/image6.jpg"></file>
|
||||
<file source="examples/2015Vision/SampleImages/image7.jpg"
|
||||
destination="SampleImages/image7.jpg"></file>
|
||||
<file source="examples/2015Vision/SampleImages/image8.jpg"
|
||||
destination="SampleImages/image8.jpg"></file>
|
||||
<file source="examples/2015Vision/SampleImages/image9.jpg"
|
||||
destination="SampleImages/image9.jpg"></file>
|
||||
<file source="examples/2015Vision/SampleImages/image10.jpg"
|
||||
destination="SampleImages/image10.jpg"></file>
|
||||
<file source="examples/2015Vision/SampleImages/image11.jpg"
|
||||
destination="SampleImages/image11.jpg"></file>
|
||||
<file source="examples/2015Vision/SampleImages/image12.jpg"
|
||||
destination="SampleImages/image12.jpg"></file>
|
||||
<file source="examples/2015Vision/SampleImages/image13.jpg"
|
||||
destination="SampleImages/image13.jpg"></file>
|
||||
<file source="examples/2015Vision/SampleImages/image14.jpg"
|
||||
destination="SampleImages/image14.jpg"></file>
|
||||
<file source="examples/2015Vision/SampleImages/image15.jpg"
|
||||
destination="SampleImages/image15.jpg"></file>
|
||||
<file source="examples/2015Vision/SampleImages/image16.jpg"
|
||||
destination="SampleImages/image16.jpg"></file>
|
||||
<file source="examples/2015Vision/SampleImages/image17.jpg"
|
||||
destination="SampleImages/image17.jpg"></file>
|
||||
<file source="examples/2015Vision/SampleImages/image18.jpg"
|
||||
destination="SampleImages/image18.jpg"></file>
|
||||
<file source="examples/2015Vision/SampleImages/image19.jpg"
|
||||
destination="SampleImages/image19.jpg"></file>
|
||||
<file source="examples/2015Vision/SampleImages/image20.jpg"
|
||||
destination="SampleImages/image20.jpg"></file>
|
||||
<file source="examples/2015Vision/SampleImages/IMG_1800.png"
|
||||
destination="SampleImages/IMG_1800.png"></file>
|
||||
</files>
|
||||
</example>
|
||||
|
||||
|
||||