SimpleBlobDetector: Generated configuration in Java template differs from configuration used in GUI #811

Closed
mfkahn opened this Issue Jan 29, 2017 · 2 comments

Projects

None yet

3 participants

@mfkahn
mfkahn commented Jan 29, 2017

Our team could not figure out why a pipeline that appeared to generate a particular blob detection in the GRIP GUI did not generate the same results when used in the generated VisionPipeline java class. We used the exact same static input image and produced two completely different blob arrays.

I dug into the generated (Java) code and the OpenCV defaults, and here's the issue:

The generated code writes the following in the XML configuration:

			config.append("<filterByInertia>0</filterByInertia>\n");
			config.append("<filterByConvexity>0</filterByConvexity>\n");

In order to be identical to the SimpleBlobDetector instance used in the GRIP GUI (which uses the OpenCV parameter defaults), the template should be:

                        config.append("<filterByInertia>1</filterByInertia>\n");
			config.append("<minInertiaRatio>0.1</minInertiaRatio>\n");
			config.append("<maxInertiaRatio>" + Integer.MAX_VALUE + "</maxInertiaRatio>\n");
			config.append("<filterByConvexity>1</filterByConvexity>\n");
			config.append("<minConvexity>0.95</minConvexity>\n");
			config.append("<maxConvexity>" + Integer.MAX_VALUE + "</maxConvexity>\n");
@mfkahn mfkahn added a commit to FRCTeam3543/Code-2016-17 that referenced this issue Jan 29, 2017
@mfkahn mfkahn Vision pipeline corrections and tests
Refactored the vision pipeline for gear drop detection so the entire
codebase is in a separate/testable package independent of WPILIB. Added
a GripPipelineTest to operate on a known image and product the same
output as the GRIP GUI.  Added workaround in the Generated code to deal
with WPIRoboticsProjects/GRIP#811 which I
logged.

DO NOT regenerate the GripPipeline from GRIP until this issue is fixed
or the blob detection will break!
8bb469c
@mfkahn mfkahn added a commit to FRCTeam3543/Code-2016-17 that referenced this issue Jan 29, 2017
@mfkahn mfkahn Merge fixes to vision pipeline (#15)
* Created RobotPy Experiment

* Testing github/slack integration

* Added sample python-based robot using RobotPy

* Basic RobotPy example working

* Added pip requirements, Dockerfile

* Editing README to simplify tings

* Updated README

* Removed unused files

* More README updates

* README edits

* Generic layout for creating robot commands  using the python sdk

* Updated README based on user testing with Ronan

* Added sensor inventory doc, updated readme with link

* Reorganized experiment to import package
Added frc-simulate etc to make running experiments easier

* Updated README

* Cleanup and start of new experiment

* Sort-of working example robot

* Added full robotpy experiment
Shows use of subsystems, commands and command groups, navigates the pygame simulator maze

* updated requirements

* Updated README to offer native Windows instructions

* Added link to GitHub Desktop for windows

* fixed typo

* testing small change

* Cleaned up sample robot

* Added robot.yaml from RobotBuilder

* Added vision pipeline to detect gear depot

* First draft of gear drop detection in VisionSubsystem

* Regenerated vision pipeline

* Work in progress - gear drop detection

* First (untested) attempt at an approach algorithm

* Work in progress on vision

* Added some debug tools onto the SmartDashboard

* Vision pipeline corrections and tests

Refactored the vision pipeline for gear drop detection so the entire
codebase is in a separate/testable package independent of WPILIB. Added
a GripPipelineTest to operate on a known image and product the same
output as the GRIP GUI.  Added workaround in the Generated code to deal
with WPIRoboticsProjects/GRIP#811 which I
logged.

DO NOT regenerate the GripPipeline from GRIP until this issue is fixed
or the blob detection will break!
def2990
@mfkahn mfkahn added a commit to FRCTeam3543/Code-2016-17 that referenced this issue Jan 29, 2017
@mfkahn mfkahn Merge vision detection (#16)
* Created RobotPy Experiment

* Testing github/slack integration

* Added sample python-based robot using RobotPy

* Basic RobotPy example working

* Added pip requirements, Dockerfile

* Editing README to simplify tings

* Updated README

* Removed unused files

* More README updates

* README edits

* Generic layout for creating robot commands  using the python sdk

* Updated README based on user testing with Ronan

* Added sensor inventory doc, updated readme with link

* Reorganized experiment to import package
Added frc-simulate etc to make running experiments easier

* Updated README

* Cleanup and start of new experiment

* Sort-of working example robot

* Added full robotpy experiment
Shows use of subsystems, commands and command groups, navigates the pygame simulator maze

* updated requirements

* Updated README to offer native Windows instructions

* Added link to GitHub Desktop for windows

* fixed typo

* testing small change

* Cleaned up sample robot

* Added robot.yaml from RobotBuilder

* Added vision pipeline to detect gear depot

* First draft of gear drop detection in VisionSubsystem

* Regenerated vision pipeline

* Work in progress - gear drop detection

* First (untested) attempt at an approach algorithm

* Work in progress on vision

* Added some debug tools onto the SmartDashboard

* Vision pipeline corrections and tests

Refactored the vision pipeline for gear drop detection so the entire
codebase is in a separate/testable package independent of WPILIB. Added
a GripPipelineTest to operate on a known image and product the same
output as the GRIP GUI.  Added workaround in the Generated code to deal
with WPIRoboticsProjects/GRIP#811 which I
logged.

DO NOT regenerate the GripPipeline from GRIP until this issue is fixed
or the blob detection will break!

* Tweaks to ApproachGearDrop command based on new GearDrop detection
8b79973
@SamCarlberg SamCarlberg added a commit to SamCarlberg/GRIP that referenced this issue Jan 29, 2017
@SamCarlberg SamCarlberg Fix generated Java blob detection
Closes #811
fc60d03
@SamCarlberg SamCarlberg closed this in #812 Jan 30, 2017
@mfkahn mfkahn added a commit to FRCTeam3543/Code-2016-17 that referenced this issue Jan 30, 2017
@mfkahn mfkahn Added 2 servos to BallPickupSubsystem (#17)
* Created RobotPy Experiment

* Testing github/slack integration

* Added sample python-based robot using RobotPy

* Basic RobotPy example working

* Added pip requirements, Dockerfile

* Editing README to simplify tings

* Updated README

* Removed unused files

* More README updates

* README edits

* Generic layout for creating robot commands  using the python sdk

* Updated README based on user testing with Ronan

* Added sensor inventory doc, updated readme with link

* Reorganized experiment to import package
Added frc-simulate etc to make running experiments easier

* Updated README

* Cleanup and start of new experiment

* Sort-of working example robot

* Added full robotpy experiment
Shows use of subsystems, commands and command groups, navigates the pygame simulator maze

* updated requirements

* Updated README to offer native Windows instructions

* Added link to GitHub Desktop for windows

* fixed typo

* testing small change

* Cleaned up sample robot

* Added robot.yaml from RobotBuilder

* Added vision pipeline to detect gear depot

* First draft of gear drop detection in VisionSubsystem

* Regenerated vision pipeline

* Work in progress - gear drop detection

* First (untested) attempt at an approach algorithm

* Work in progress on vision

* Added some debug tools onto the SmartDashboard

* Vision pipeline corrections and tests

Refactored the vision pipeline for gear drop detection so the entire
codebase is in a separate/testable package independent of WPILIB. Added
a GripPipelineTest to operate on a known image and product the same
output as the GRIP GUI.  Added workaround in the Generated code to deal
with WPIRoboticsProjects/GRIP#811 which I
logged.

DO NOT regenerate the GripPipeline from GRIP until this issue is fixed
or the blob detection will break!

* Tweaks to ApproachGearDrop command based on new GearDrop detection

* Added two servos to BallPickupSubsystem

Added two servos to the ball pickup system.   setServo1Angle() and
setServo2Angle() on the subsystem can be used to set the angle.
1d2be9a
@nightpool

@SamCarlberg could this possibly also be the cause of #806?

@SamCarlberg
Member

No, that's using contour detection. No blobs.

@mfkahn mfkahn added a commit to FRCTeam3543/Code-2016-17 that referenced this issue Jan 31, 2017
@mfkahn mfkahn Merge ball hopper raise/lower commands (#18)
* Created RobotPy Experiment

* Testing github/slack integration

* Added sample python-based robot using RobotPy

* Basic RobotPy example working

* Added pip requirements, Dockerfile

* Editing README to simplify tings

* Updated README

* Removed unused files

* More README updates

* README edits

* Generic layout for creating robot commands  using the python sdk

* Updated README based on user testing with Ronan

* Added sensor inventory doc, updated readme with link

* Reorganized experiment to import package
Added frc-simulate etc to make running experiments easier

* Updated README

* Cleanup and start of new experiment

* Sort-of working example robot

* Added full robotpy experiment
Shows use of subsystems, commands and command groups, navigates the pygame simulator maze

* updated requirements

* Updated README to offer native Windows instructions

* Added link to GitHub Desktop for windows

* fixed typo

* testing small change

* Cleaned up sample robot

* Added robot.yaml from RobotBuilder

* Added vision pipeline to detect gear depot

* First draft of gear drop detection in VisionSubsystem

* Regenerated vision pipeline

* Work in progress - gear drop detection

* First (untested) attempt at an approach algorithm

* Work in progress on vision

* Added some debug tools onto the SmartDashboard

* Vision pipeline corrections and tests

Refactored the vision pipeline for gear drop detection so the entire
codebase is in a separate/testable package independent of WPILIB. Added
a GripPipelineTest to operate on a known image and product the same
output as the GRIP GUI.  Added workaround in the Generated code to deal
with WPIRoboticsProjects/GRIP#811 which I
logged.

DO NOT regenerate the GripPipeline from GRIP until this issue is fixed
or the blob detection will break!

* Tweaks to ApproachGearDrop command based on new GearDrop detection

* Added two servos to BallPickupSubsystem

Added two servos to the ball pickup system.   setServo1Angle() and
setServo2Angle() on the subsystem can be used to set the angle.

* Tweaks to vision subsystem

* Added commands to manipulate the ball chute

Added two commands RaiseBallChuteCommand and LowerBallChuteCommand using
RobotBuilder.  Both require the BallDropSubsystem.  @Michael3543 you can
add the actual code in the command execute() methods to operate the
servos.
b8544ac
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment