Thread: [Robotvision-commit] SF.net SVN: robotvision:[13] vision
Brought to you by:
phildavidson
From: <phi...@us...> - 2010-05-20 01:00:18
|
Revision: 13 http://robotvision.svn.sourceforge.net/robotvision/?rev=13&view=rev Author: phildavidson Date: 2010-05-20 01:00:10 +0000 (Thu, 20 May 2010) Log Message: ----------- pipe 90% done Added Paths: ----------- vision/.cproject vision/.project vision/images/ vision/images/3dballs.jpg vision/images/pic1.png vision/images/pic2.png vision/images/pic3.png vision/images/pic4.png vision/images/pic5.png vision/images/pic6.png vision/images/pipe.PNG vision/images/pipethresh.png vision/src/ vision/src/squares.c vision/src/test.cpp vision/src/test2.cpp vision/testimg.png vision/videos/ vision/videos/ets2007buoy.avi vision/videos/ets2007pipe.avi vision/videos/pipe3.avi Added: vision/.cproject =================================================================== --- vision/.cproject (rev 0) +++ vision/.cproject 2010-05-20 01:00:10 UTC (rev 13) @@ -0,0 +1,1172 @@ +<?xml version="1.0" encoding="UTF-8" standalone="no"?> +<?fileVersion 4.0.0?> + +<cproject storage_type_id="org.eclipse.cdt.core.XmlProjectDescriptionStorage"> +<storageModule moduleId="org.eclipse.cdt.core.settings"> +<cconfiguration id="cdt.managedbuild.config.gnu.mingw.exe.debug.1794257183"> +<storageModule buildSystemId="org.eclipse.cdt.managedbuilder.core.configurationDataProvider" id="cdt.managedbuild.config.gnu.mingw.exe.debug.1794257183" moduleId="org.eclipse.cdt.core.settings" name="Debug"> +<externalSettings/> +<extensions> +<extension id="org.eclipse.cdt.core.PE" point="org.eclipse.cdt.core.BinaryParser"/> +<extension id="org.eclipse.cdt.core.GCCErrorParser" point="org.eclipse.cdt.core.ErrorParser"/> +<extension id="org.eclipse.cdt.core.GASErrorParser" point="org.eclipse.cdt.core.ErrorParser"/> +<extension id="org.eclipse.cdt.core.GLDErrorParser" point="org.eclipse.cdt.core.ErrorParser"/> +</extensions> +</storageModule> +<storageModule moduleId="cdtBuildSystem" version="4.0.0"> +<configuration artifactName="vision" buildArtefactType="org.eclipse.cdt.build.core.buildArtefactType.exe" buildProperties="org.eclipse.cdt.build.core.buildType=org.eclipse.cdt.build.core.buildType.debug,org.eclipse.cdt.build.core.buildArtefactType=org.eclipse.cdt.build.core.buildArtefactType.exe" cleanCommand="rm -rf" description="" id="cdt.managedbuild.config.gnu.mingw.exe.debug.1794257183" name="Debug" parent="cdt.managedbuild.config.gnu.mingw.exe.debug"> +<folderInfo id="cdt.managedbuild.config.gnu.mingw.exe.debug.1794257183." name="/" resourcePath=""> +<toolChain id="cdt.managedbuild.toolchain.gnu.mingw.exe.debug.630271631" name="MinGW GCC" superClass="cdt.managedbuild.toolchain.gnu.mingw.exe.debug"> +<targetPlatform id="cdt.managedbuild.target.gnu.platform.mingw.exe.debug.2026977244" name="Debug Platform" superClass="cdt.managedbuild.target.gnu.platform.mingw.exe.debug"/> +<builder buildPath="${workspace_loc:/vision/Debug}" id="cdt.managedbuild.tool.gnu.builder.mingw.base.1674458609" keepEnvironmentInBuildfile="false" managedBuildOn="true" name="CDT Internal Builder" superClass="cdt.managedbuild.tool.gnu.builder.mingw.base"/> +<tool id="cdt.managedbuild.tool.gnu.assembler.mingw.exe.debug.261759773" name="GCC Assembler" superClass="cdt.managedbuild.tool.gnu.assembler.mingw.exe.debug"> +<inputType id="cdt.managedbuild.tool.gnu.assembler.input.737547003" superClass="cdt.managedbuild.tool.gnu.assembler.input"/> +</tool> +<tool id="cdt.managedbuild.tool.gnu.archiver.mingw.base.1390554830" name="GCC Archiver" superClass="cdt.managedbuild.tool.gnu.archiver.mingw.base"/> +<tool id="cdt.managedbuild.tool.gnu.cpp.compiler.mingw.exe.debug.690373895" name="GCC C++ Compiler" superClass="cdt.managedbuild.tool.gnu.cpp.compiler.mingw.exe.debug"> +<option id="gnu.cpp.compiler.mingw.exe.debug.option.optimization.level.1831407888" name="Optimization Level" superClass="gnu.cpp.compiler.mingw.exe.debug.option.optimization.level" value="gnu.cpp.compiler.optimization.level.none" valueType="enumerated"/> +<option id="gnu.cpp.compiler.mingw.exe.debug.option.debugging.level.523974820" name="Debug Level" superClass="gnu.cpp.compiler.mingw.exe.debug.option.debugging.level" value="gnu.cpp.compiler.debugging.level.max" valueType="enumerated"/> +<option id="gnu.cpp.compiler.option.include.paths.1983097712" name="Include paths (-I)" superClass="gnu.cpp.compiler.option.include.paths" valueType="includePath"> +<listOptionValue builtIn="false" value=""C:\OpenCV2.1\include\opencv""/> +</option> +<inputType id="cdt.managedbuild.tool.gnu.cpp.compiler.input.881392952" superClass="cdt.managedbuild.tool.gnu.cpp.compiler.input"/> +</tool> +<tool id="cdt.managedbuild.tool.gnu.c.compiler.mingw.exe.debug.1406350564" name="GCC C Compiler" superClass="cdt.managedbuild.tool.gnu.c.compiler.mingw.exe.debug"> +<option defaultValue="gnu.c.optimization.level.none" id="gnu.c.compiler.mingw.exe.debug.option.optimization.level.1766779643" name="Optimization Level" superClass="gnu.c.compiler.mingw.exe.debug.option.optimization.level" valueType="enumerated"/> +<option id="gnu.c.compiler.mingw.exe.debug.option.debugging.level.852285159" name="Debug Level" superClass="gnu.c.compiler.mingw.exe.debug.option.debugging.level" value="gnu.c.debugging.level.max" valueType="enumerated"/> +<option id="gnu.c.compiler.option.include.paths.1287588982" name="Include paths (-I)" superClass="gnu.c.compiler.option.include.paths" valueType="includePath"> +<listOptionValue builtIn="false" value=""C:\OpenCV2.1\include\opencv""/> +</option> +<inputType id="cdt.managedbuild.tool.gnu.c.compiler.input.2072174392" superClass="cdt.managedbuild.tool.gnu.c.compiler.input"/> +</tool> +<tool id="cdt.managedbuild.tool.gnu.c.linker.mingw.exe.debug.1458068716" name="MinGW C Linker" superClass="cdt.managedbuild.tool.gnu.c.linker.mingw.exe.debug"/> +<tool id="cdt.managedbuild.tool.gnu.cpp.linker.mingw.exe.debug.1280962527" name="MinGW C++ Linker" superClass="cdt.managedbuild.tool.gnu.cpp.linker.mingw.exe.debug"> +<option id="gnu.cpp.link.option.libs.1732101261" name="Libraries (-l)" superClass="gnu.cpp.link.option.libs" valueType="libs"> +<listOptionValue builtIn="false" value="cv210"/> +<listOptionValue builtIn="false" value="cvaux210"/> +<listOptionValue builtIn="false" value="cxcore210"/> +<listOptionValue builtIn="false" value="highgui210"/> +<listOptionValue builtIn="false" value="ml210"/> +</option> +<option id="gnu.cpp.link.option.paths.1959014800" name="Library search path (-L)" superClass="gnu.cpp.link.option.paths" valueType="libPaths"> +<listOptionValue builtIn="false" value=""C:\OpenCV2.1\bin""/> +</option> +<inputType id="cdt.managedbuild.tool.gnu.cpp.linker.input.599977798" superClass="cdt.managedbuild.tool.gnu.cpp.linker.input"> +<additionalInput kind="additionalinputdependency" paths="$(USER_OBJS)"/> +<additionalInput kind="additionalinput" paths="$(LIBS)"/> +</inputType> +</tool> +</toolChain> +</folderInfo> +<sourceEntries> +<entry excluding="src" flags="VALUE_WORKSPACE_PATH|RESOLVED" kind="sourcePath" name=""/> +<entry flags="VALUE_WORKSPACE_PATH|RESOLVED" kind="sourcePath" name="src"/> +</sourceEntries> +</configuration> +</storageModule> +<storageModule moduleId="scannerConfiguration"> +<autodiscovery enabled="true" problemReportingEnabled="true" selectedProfileId="org.eclipse.cdt.make.core.GCCStandardMakePerProjectProfile"/> +<profile id="org.eclipse.cdt.make.core.GCCStandardMakePerProjectProfile"> +<buildOutputProvider> +<openAction enabled="true" filePath=""/> +<parser enabled="true"/> +</buildOutputProvider> +<scannerInfoProvider id="specsFile"> +<runAction arguments="-E -P -v -dD ${plugin_state_location}/${specs_file}" command="gcc" useDefault="true"/> +<parser enabled="true"/> +</scannerInfoProvider> +</profile> +<profile id="org.eclipse.cdt.make.core.GCCStandardMakePerFileProfile"> +<buildOutputProvider> +<openAction enabled="true" filePath=""/> +<parser enabled="true"/> +</buildOutputProvider> +<scannerInfoProvider id="makefileGenerator"> +<runAction arguments="-f ${project_name}_scd.mk" command="make" useDefault="true"/> +<parser enabled="true"/> +</scannerInfoProvider> +</profile> +<profile id="org.eclipse.cdt.managedbuilder.core.GCCManagedMakePerProjectProfile"> +<buildOutputProvider> +<openAction enabled="true" filePath=""/> +<parser enabled="true"/> +</buildOutputProvider> +<scannerInfoProvider id="specsFile"> +<runAction arguments="-E -P -v -dD ${plugin_state_location}/${specs_file}" command="gcc" useDefault="true"/> +<parser enabled="true"/> +</scannerInfoProvider> +</profile> +<profile id="org.eclipse.cdt.managedbuilder.core.GCCManagedMakePerProjectProfileCPP"> +<buildOutputProvider> +<openAction enabled="true" filePath=""/> +<parser enabled="true"/> +</buildOutputProvider> +<scannerInfoProvider id="specsFile"> +<runAction arguments="-E -P -v -dD ${plugin_state_location}/specs.cpp" command="g++" useDefault="true"/> +<parser enabled="true"/> +</scannerInfoProvider> +</profile> +<profile id="org.eclipse.cdt.managedbuilder.core.GCCManagedMakePerProjectProfileC"> +<buildOutputProvider> +<openAction enabled="true" filePath=""/> +<parser enabled="true"/> +</buildOutputProvider> +<scannerInfoProvider id="specsFile"> +<runAction arguments="-E -P -v -dD ${plugin_state_location}/specs.c" command="gcc" useDefault="true"/> +<parser enabled="true"/> +</scannerInfoProvider> +</profile> +<profile id="org.eclipse.cdt.managedbuilder.core.GCCWinManagedMakePerProjectProfile"> +<buildOutputProvider> +<openAction enabled="true" filePath=""/> +<parser enabled="true"/> +</buildOutputProvider> +<scannerInfoProvider id="specsFile"> +<runAction arguments="-c 'gcc -E -P -v -dD "${plugin_state_location}/${specs_file}"'" command="sh" useDefault="true"/> +<parser enabled="true"/> +</scannerInfoProvider> +</profile> +<profile id="org.eclipse.cdt.managedbuilder.core.GCCWinManagedMakePerProjectProfileCPP"> +<buildOutputProvider> +<openAction enabled="true" filePath=""/> +<parser enabled="true"/> +</buildOutputProvider> +<scannerInfoProvider id="specsFile"> +<runAction arguments="-c 'g++ -E -P -v -dD "${plugin_state_location}/specs.cpp"'" command="sh" useDefault="true"/> +<parser enabled="true"/> +</scannerInfoProvider> +</profile> +<profile id="org.eclipse.cdt.managedbuilder.core.GCCWinManagedMakePerProjectProfileC"> +<buildOutputProvider> +<openAction enabled="true" filePath=""/> +<parser enabled="true"/> +</buildOutputProvider> +<scannerInfoProvider id="specsFile"> +<runAction arguments="-c 'gcc -E -P -v -dD "${plugin_state_location}/specs.c"'" command="sh" useDefault="true"/> +<parser enabled="true"/> +</scannerInfoProvider> +</profile> +<profile id="org.eclipse.cdt.managedbuilder.xlc.core.XLCManagedMakePerProjectProfile"> +<buildOutputProvider> +<openAction enabled="false" filePath=""/> +<parser enabled="false"/> +</buildOutputProvider> +<scannerInfoProvider id="specsFile"> +<runAction arguments="-E -v ${plugin_state_location}/${specs_file}" command="${XL_compilerRoot}/xlc" useDefault="true"/> +<parser enabled="true"/> +</scannerInfoProvider> +</profile> +<profile id="org.eclipse.cdt.managedbuilder.xlc.core.XLCManagedMakePerProjectProfileCPP"> +<buildOutputProvider> +<openAction enabled="false" filePath=""/> +<parser enabled="false"/> +</buildOutputProvider> +<scannerInfoProvider id="specsFile"> +<runAction arguments="-E -v ${plugin_state_location}/${specs_file}" command="${XL_compilerRoot}/xlC" useDefault="true"/> +<parser enabled="true"/> +</scannerInfoProvider> +</profile> +<scannerConfigBuildInfo instanceId="cdt.managedbuild.config.gnu.mingw.exe.release.369958126;cdt.managedbuild.config.gnu.mingw.exe.release.369958126.;cdt.managedbuild.tool.gnu.c.compiler.mingw.exe.release.1960648874;cdt.managedbuild.tool.gnu.c.compiler.input.425612201"> +<autodiscovery enabled="true" problemReportingEnabled="true" selectedProfileId="org.eclipse.cdt.managedbuilder.core.GCCManagedMakePerProjectProfileC"/> +<profile id="org.eclipse.cdt.make.core.GCCStandardMakePerProjectProfile"> +<buildOutputProvider> +<openAction enabled="true" filePath=""/> +<parser enabled="true"/> +</buildOutputProvider> +<scannerInfoProvider id="specsFile"> +<runAction arguments="-E -P -v -dD ${plugin_state_location}/${specs_file}" command="gcc" useDefault="true"/> +<parser enabled="true"/> +</scannerInfoProvider> +</profile> +<profile id="org.eclipse.cdt.make.core.GCCStandardMakePerFileProfile"> +<buildOutputProvider> +<openAction enabled="true" filePath=""/> +<parser enabled="true"/> +</buildOutputProvider> +<scannerInfoProvider id="makefileGenerator"> +<runAction arguments="-f ${project_name}_scd.mk" command="make" useDefault="true"/> +<parser enabled="true"/> +</scannerInfoProvider> +</profile> +<profile id="org.eclipse.cdt.managedbuilder.core.GCCManagedMakePerProjectProfile"> +<buildOutputProvider> +<openAction enabled="true" filePath=""/> +<parser enabled="true"/> +</buildOutputProvider> +<scannerInfoProvider id="specsFile"> +<runAction arguments="-E -P -v -dD ${plugin_state_location}/${specs_file}" command="gcc" useDefault="true"/> +<parser enabled="true"/> +</scannerInfoProvider> +</profile> +<profile id="org.eclipse.cdt.managedbuilder.core.GCCManagedMakePerProjectProfileCPP"> +<buildOutputProvider> +<openAction enabled="true" filePath=""/> +<parser enabled="true"/> +</buildOutputProvider> +<scannerInfoProvider id="specsFile"> +<runAction arguments="-E -P -v -dD ${plugin_state_location}/specs.cpp" command="g++" useDefault="true"/> +<parser enabled="true"/> +</scannerInfoProvider> +</profile> +<profile id="org.eclipse.cdt.managedbuilder.core.GCCManagedMakePerProjectProfileC"> +<buildOutputProvider> +<openAction enabled="true" filePath=""/> +<parser enabled="true"/> +</buildOutputProvider> +<scannerInfoProvider id="specsFile"> +<runAction arguments="-E -P -v -dD ${plugin_state_location}/specs.c" command="gcc" useDefault="true"/> +<parser enabled="true"/> +</scannerInfoProvider> +</profile> +<profile id="org.eclipse.cdt.managedbuilder.core.GCCWinManagedMakePerProjectProfile"> +<buildOutputProvider> +<openAction enabled="true" filePath=""/> +<parser enabled="true"/> +</buildOutputProvider> +<scannerInfoProvider id="specsFile"> +<runAction arguments="-c 'gcc -E -P -v -dD "${plugin_state_location}/${specs_file}"'" command="sh" useDefault="true"/> +<parser enabled="true"/> +</scannerInfoProvider> +</profile> +<profile id="org.eclipse.cdt.managedbuilder.core.GCCWinManagedMakePerProjectProfileCPP"> +<buildOutputProvider> +<openAction enabled="true" filePath=""/> +<parser enabled="true"/> +</buildOutputProvider> +<scannerInfoProvider id="specsFile"> +<runAction arguments="-c 'g++ -E -P -v -dD "${plugin_state_location}/specs.cpp"'" command="sh" useDefault="true"/> +<parser enabled="true"/> +</scannerInfoProvider> +</profile> +<profile id="org.eclipse.cdt.managedbuilder.core.GCCWinManagedMakePerProjectProfileC"> +<buildOutputProvider> +<openAction enabled="true" filePath=""/> +<parser enabled="true"/> +</buildOutputProvider> +<scannerInfoProvider id="specsFile"> +<runAction arguments="-c 'gcc -E -P -v -dD "${plugin_state_location}/specs.c"'" command="sh" useDefault="true"/> +<parser enabled="true"/> +</scannerInfoProvider> +</profile> +<profile id="org.eclipse.cdt.managedbuilder.xlc.core.XLCManagedMakePerProjectProfile"> +<buildOutputProvider> +<openAction enabled="false" filePath=""/> +<parser enabled="false"/> +</buildOutputProvider> +<scannerInfoProvider id="specsFile"> +<runAction arguments="-E -v ${plugin_state_location}/${specs_file}" command="${XL_compilerRoot}/xlc" useDefault="true"/> +<parser enabled="true"/> +</scannerInfoProvider> +</profile> +<profile id="org.eclipse.cdt.managedbuilder.xlc.core.XLCManagedMakePerProjectProfileCPP"> +<buildOutputProvider> +<openAction enabled="false" filePath=""/> +<parser enabled="false"/> +</buildOutputProvider> +<scannerInfoProvider id="specsFile"> +<runAction arguments="-E -v ${plugin_state_location}/${specs_file}" command="${XL_compilerRoot}/xlC" useDefault="true"/> +<parser enabled="true"/> +</scannerInfoProvider> +</profile> +</scannerConfigBuildInfo> +<scannerConfigBuildInfo instanceId="cdt.managedbuild.config.gnu.mingw.exe.debug.1794257183;cdt.managedbuild.config.gnu.mingw.exe.debug.1794257183.;cdt.managedbuild.tool.gnu.cpp.compiler.mingw.exe.debug.690373895;cdt.managedbuild.tool.gnu.cpp.compiler.input.881392952"> +<autodiscovery enabled="true" problemReportingEnabled="true" selectedProfileId="org.eclipse.cdt.managedbuilder.core.GCCManagedMakePerProjectProfileCPP"/> +<profile id="org.eclipse.cdt.make.core.GCCStandardMakePerProjectProfile"> +<buildOutputProvider> +<openAction enabled="true" filePath=""/> +<parser enabled="true"/> +</buildOutputProvider> +<scannerInfoProvider id="specsFile"> +<runAction arguments="-E -P -v -dD ${plugin_state_location}/${specs_file}" command="gcc" useDefault="true"/> +<parser enabled="true"/> +</scannerInfoProvider> +</profile> +<profile id="org.eclipse.cdt.make.core.GCCStandardMakePerFileProfile"> +<buildOutputProvider> +<openAction enabled="true" filePath=""/> +<parser enabled="true"/> +</buildOutputProvider> +<scannerInfoProvider id="makefileGenerator"> +<runAction arguments="-f ${project_name}_scd.mk" command="make" useDefault="true"/> +<parser enabled="true"/> +</scannerInfoProvider> +</profile> +<profile id="org.eclipse.cdt.managedbuilder.core.GCCManagedMakePerProjectProfile"> +<buildOutputProvider> +<openAction enabled="true" filePath=""/> +<parser enabled="true"/> +</buildOutputProvider> +<scannerInfoProvider id="specsFile"> +<runAction arguments="-E -P -v -dD ${plugin_state_location}/${specs_file}" command="gcc" useDefault="true"/> +<parser enabled="true"/> +</scannerInfoProvider> +</profile> +<profile id="org.eclipse.cdt.managedbuilder.core.GCCManagedMakePerProjectProfileCPP"> +<buildOutputProvider> +<openAction enabled="true" filePath=""/> +<parser enabled="true"/> +</buildOutputProvider> +<scannerInfoProvider id="specsFile"> +<runAction arguments="-E -P -v -dD ${plugin_state_location}/specs.cpp" command="g++" useDefault="true"/> +<parser enabled="true"/> +</scannerInfoProvider> +</profile> +<profile id="org.eclipse.cdt.managedbuilder.core.GCCManagedMakePerProjectProfileC"> +<buildOutputProvider> +<openAction enabled="true" filePath=""/> +<parser enabled="true"/> +</buildOutputProvider> +<scannerInfoProvider id="specsFile"> +<runAction arguments="-E -P -v -dD ${plugin_state_location}/specs.c" command="gcc" useDefault="true"/> +<parser enabled="true"/> +</scannerInfoProvider> +</profile> +<profile id="org.eclipse.cdt.managedbuilder.core.GCCWinManagedMakePerProjectProfile"> +<buildOutputProvider> +<openAction enabled="true" filePath=""/> +<parser enabled="true"/> +</buildOutputProvider> +<scannerInfoProvider id="specsFile"> +<runAction arguments="-c 'gcc -E -P -v -dD "${plugin_state_location}/${specs_file}"'" command="sh" useDefault="true"/> +<parser enabled="true"/> +</scannerInfoProvider> +</profile> +<profile id="org.eclipse.cdt.managedbuilder.core.GCCWinManagedMakePerProjectProfileCPP"> +<buildOutputProvider> +<openAction enabled="true" filePath=""/> +<parser enabled="true"/> +</buildOutputProvider> +<scannerInfoProvider id="specsFile"> +<runAction arguments="-c 'g++ -E -P -v -dD "${plugin_state_location}/specs.cpp"'" command="sh" useDefault="true"/> +<parser enabled="true"/> +</scannerInfoProvider> +</profile> +<profile id="org.eclipse.cdt.managedbuilder.core.GCCWinManagedMakePerProjectProfileC"> +<buildOutputProvider> +<openAction enabled="true" filePath=""/> +<parser enabled="true"/> +</buildOutputProvider> +<scannerInfoProvider id="specsFile"> +<runAction arguments="-c 'gcc -E -P -v -dD "${plugin_state_location}/specs.c"'" command="sh" useDefault="true"/> +<parser enabled="true"/> +</scannerInfoProvider> +</profile> +<profile id="org.eclipse.cdt.managedbuilder.xlc.core.XLCManagedMakePerProjectProfile"> +<buildOutputProvider> +<openAction enabled="false" filePath=""/> +<parser enabled="false"/> +</buildOutputProvider> +<scannerInfoProvider id="specsFile"> +<runAction arguments="-E -v ${plugin_state_location}/${specs_file}" command="${XL_compilerRoot}/xlc" useDefault="true"/> +<parser enabled="true"/> +</scannerInfoProvider> +</profile> +<profile id="org.eclipse.cdt.managedbuilder.xlc.core.XLCManagedMakePerProjectProfileCPP"> +<buildOutputProvider> +<openAction enabled="false" filePath=""/> +<parser enabled="false"/> +</buildOutputProvider> +<scannerInfoProvider id="specsFile"> +<runAction arguments="-E -v ${plugin_state_location}/${specs_file}" command="${XL_compilerRoot}/xlC" useDefault="true"/> +<parser enabled="true"/> +</scannerInfoProvider> +</profile> +</scannerConfigBuildInfo> +<scannerConfigBuildInfo instanceId="cdt.managedbuild.config.gnu.mingw.exe.release.369958126;cdt.managedbuild.config.gnu.mingw.exe.release.369958126.;cdt.managedbuild.tool.gnu.cpp.compiler.mingw.exe.release.1039220343;cdt.managedbuild.tool.gnu.cpp.compiler.input.394920570"> +<autodiscovery enabled="true" problemReportingEnabled="true" selectedProfileId="org.eclipse.cdt.managedbuilder.core.GCCManagedMakePerProjectProfileCPP"/> +<profile id="org.eclipse.cdt.make.core.GCCStandardMakePerProjectProfile"> +<buildOutputProvider> +<openAction enabled="true" filePath=""/> +<parser enabled="true"/> +</buildOutputProvider> +<scannerInfoProvider id="specsFile"> +<runAction arguments="-E -P -v -dD ${plugin_state_location}/${specs_file}" command="gcc" useDefault="true"/> +<parser enabled="true"/> +</scannerInfoProvider> +</profile> +<profile id="org.eclipse.cdt.make.core.GCCStandardMakePerFileProfile"> +<buildOutputProvider> +<openAction enabled="true" filePath=""/> +<parser enabled="true"/> +</buildOutputProvider> +<scannerInfoProvider id="makefileGenerator"> +<runAction arguments="-f ${project_name}_scd.mk" command="make" useDefault="true"/> +<parser enabled="true"/> +</scannerInfoProvider> +</profile> +<profile id="org.eclipse.cdt.managedbuilder.core.GCCManagedMakePerProjectProfile"> +<buildOutputProvider> +<openAction enabled="true" filePath=""/> +<parser enabled="true"/> +</buildOutputProvider> +<scannerInfoProvider id="specsFile"> +<runAction arguments="-E -P -v -dD ${plugin_state_location}/${specs_file}" command="gcc" useDefault="true"/> +<parser enabled="true"/> +</scannerInfoProvider> +</profile> +<profile id="org.eclipse.cdt.managedbuilder.core.GCCManagedMakePerProjectProfileCPP"> +<buildOutputProvider> +<openAction enabled="true" filePath=""/> +<parser enabled="true"/> +</buildOutputProvider> +<scannerInfoProvider id="specsFile"> +<runAction arguments="-E -P -v -dD ${plugin_state_location}/specs.cpp" command="g++" useDefault="true"/> +<parser enabled="true"/> +</scannerInfoProvider> +</profile> +<profile id="org.eclipse.cdt.managedbuilder.core.GCCManagedMakePerProjectProfileC"> +<buildOutputProvider> +<openAction enabled="true" filePath=""/> +<parser enabled="true"/> +</buildOutputProvider> +<scannerInfoProvider id="specsFile"> +<runAction arguments="-E -P -v -dD ${plugin_state_location}/specs.c" command="gcc" useDefault="true"/> +<parser enabled="true"/> +</scannerInfoProvider> +</profile> +<profile id="org.eclipse.cdt.managedbuilder.core.GCCWinManagedMakePerProjectProfile"> +<buildOutputProvider> +<openAction enabled="true" filePath=""/> +<parser enabled="true"/> +</buildOutputProvider> +<scannerInfoProvider id="specsFile"> +<runAction arguments="-c 'gcc -E -P -v -dD "${plugin_state_location}/${specs_file}"'" command="sh" useDefault="true"/> +<parser enabled="true"/> +</scannerInfoProvider> +</profile> +<profile id="org.eclipse.cdt.managedbuilder.core.GCCWinManagedMakePerProjectProfileCPP"> +<buildOutputProvider> +<openAction enabled="true" filePath=""/> +<parser enabled="true"/> +</buildOutputProvider> +<scannerInfoProvider id="specsFile"> +<runAction arguments="-c 'g++ -E -P -v -dD "${plugin_state_location}/specs.cpp"'" command="sh" useDefault="true"/> +<parser enabled="true"/> +</scannerInfoProvider> +</profile> +<profile id="org.eclipse.cdt.managedbuilder.core.GCCWinManagedMakePerProjectProfileC"> +<buildOutputProvider> +<openAction enabled="true" filePath=""/> +<parser enabled="true"/> +</buildOutputProvider> +<scannerInfoProvider id="specsFile"> +<runAction arguments="-c 'gcc -E -P -v -dD "${plugin_state_location}/specs.c"'" command="sh" useDefault="true"/> +<parser enabled="true"/> +</scannerInfoProvider> +</profile> +<profile id="org.eclipse.cdt.managedbuilder.xlc.core.XLCManagedMakePerProjectProfile"> +<buildOutputProvider> +<openAction enabled="false" filePath=""/> +<parser enabled="false"/> +</buildOutputProvider> +<scannerInfoProvider id="specsFile"> +<runAction arguments="-E -v ${plugin_state_location}/${specs_file}" command="${XL_compilerRoot}/xlc" useDefault="true"/> +<parser enabled="true"/> +</scannerInfoProvider> +</profile> +<profile id="org.eclipse.cdt.managedbuilder.xlc.core.XLCManagedMakePerProjectProfileCPP"> +<buildOutputProvider> +<openAction enabled="false" filePath=""/> +<parser enabled="false"/> +</buildOutputProvider> +<scannerInfoProvider id="specsFile"> +<runAction arguments="-E -v ${plugin_state_location}/${specs_file}" command="${XL_compilerRoot}/xlC" useDefault="true"/> +<parser enabled="true"/> +</scannerInfoProvider> +</profile> +</scannerConfigBuildInfo> +<scannerConfigBuildInfo instanceId="cdt.managedbuild.config.gnu.mingw.exe.debug.1794257183;cdt.managedbuild.config.gnu.mingw.exe.debug.1794257183.;cdt.managedbuild.tool.gnu.c.compiler.mingw.exe.debug.1406350564;cdt.managedbuild.tool.gnu.c.compiler.input.2072174392"> +<autodiscovery enabled="true" problemReportingEnabled="true" selectedProfileId="org.eclipse.cdt.managedbuilder.core.GCCManagedMakePerProjectProfileC"/> +<profile id="org.eclipse.cdt.make.core.GCCStandardMakePerProjectProfile"> +<buildOutputProvider> +<openAction enabled="true" filePath=""/> +<parser enabled="true"/> +</buildOutputProvider> +<scannerInfoProvider id="specsFile"> +<runAction arguments="-E -P -v -dD ${plugin_state_location}/${specs_file}" command="gcc" useDefault="true"/> +<parser enabled="true"/> +</scannerInfoProvider> +</profile> +<profile id="org.eclipse.cdt.make.core.GCCStandardMakePerFileProfile"> +<buildOutputProvider> +<openAction enabled="true" filePath=""/> +<parser enabled="true"/> +</buildOutputProvider> +<scannerInfoProvider id="makefileGenerator"> +<runAction arguments="-f ${project_name}_scd.mk" command="make" useDefault="true"/> +<parser enabled="true"/> +</scannerInfoProvider> +</profile> +<profile id="org.eclipse.cdt.managedbuilder.core.GCCManagedMakePerProjectProfile"> +<buildOutputProvider> +<openAction enabled="true" filePath=""/> +<parser enabled="true"/> +</buildOutputProvider> +<scannerInfoProvider id="specsFile"> +<runAction arguments="-E -P -v -dD ${plugin_state_location}/${specs_file}" command="gcc" useDefault="true"/> +<parser enabled="true"/> +</scannerInfoProvider> +</profile> +<profile id="org.eclipse.cdt.managedbuilder.core.GCCManagedMakePerProjectProfileCPP"> +<buildOutputProvider> +<openAction enabled="true" filePath=""/> +<parser enabled="true"/> +</buildOutputProvider> +<scannerInfoProvider id="specsFile"> +<runAction arguments="-E -P -v -dD ${plugin_state_location}/specs.cpp" command="g++" useDefault="true"/> +<parser enabled="true"/> +</scannerInfoProvider> +</profile> +<profile id="org.eclipse.cdt.managedbuilder.core.GCCManagedMakePerProjectProfileC"> +<buildOutputProvider> +<openAction enabled="true" filePath=""/> +<parser enabled="true"/> +</buildOutputProvider> +<scannerInfoProvider id="specsFile"> +<runAction arguments="-E -P -v -dD ${plugin_state_location}/specs.c" command="gcc" useDefault="true"/> +<parser enabled="true"/> +</scannerInfoProvider> +</profile> +<profile id="org.eclipse.cdt.managedbuilder.core.GCCWinManagedMakePerProjectProfile"> +<buildOutputProvider> +<openAction enabled="true" filePath=""/> +<parser enabled="true"/> +</buildOutputProvider> +<scannerInfoProvider id="specsFile"> +<runAction arguments="-c 'gcc -E -P -v -dD "${plugin_state_location}/${specs_file}"'" command="sh" useDefault="true"/> +<parser enabled="true"/> +</scannerInfoProvider> +</profile> +<profile id="org.eclipse.cdt.managedbuilder.core.GCCWinManagedMakePerProjectProfileCPP"> +<buildOutputProvider> +<openAction enabled="true" filePath=""/> +<parser enabled="true"/> +</buildOutputProvider> +<scannerInfoProvider id="specsFile"> +<runAction arguments="-c 'g++ -E -P -v -dD "${plugin_state_location}/specs.cpp"'" command="sh" useDefault="true"/> +<parser enabled="true"/> +</scannerInfoProvider> +</profile> +<profile id="org.eclipse.cdt.managedbuilder.core.GCCWinManagedMakePerProjectProfileC"> +<buildOutputProvider> +<openAction enabled="true" filePath=""/> +<parser enabled="true"/> +</buildOutputProvider> +<scannerInfoProvider id="specsFile"> +<runAction arguments="-c 'gcc -E -P -v -dD "${plugin_state_location}/specs.c"'" command="sh" useDefault="true"/> +<parser enabled="true"/> +</scannerInfoProvider> +</profile> +<profile id="org.eclipse.cdt.managedbuilder.xlc.core.XLCManagedMakePerProjectProfile"> +<buildOutputProvider> +<openAction enabled="false" filePath=""/> +<parser enabled="false"/> +</buildOutputProvider> +<scannerInfoProvider id="specsFile"> +<runAction arguments="-E -v ${plugin_state_location}/${specs_file}" command="${XL_compilerRoot}/xlc" useDefault="true"/> +<parser enabled="true"/> +</scannerInfoProvider> +</profile> +<profile id="org.eclipse.cdt.managedbuilder.xlc.core.XLCManagedMakePerProjectProfileCPP"> +<buildOutputProvider> +<openAction enabled="false" filePath=""/> +<parser enabled="false"/> +</buildOutputProvider> +<scannerInfoProvider id="specsFile"> +<runAction arguments="-E -v ${plugin_state_location}/${specs_file}" command="${XL_compilerRoot}/xlC" useDefault="true"/> +<parser enabled="true"/> +</scannerInfoProvider> +</profile> +</scannerConfigBuildInfo> +</storageModule> +<storageModule moduleId="org.eclipse.cdt.core.externalSettings"/> +<storageModule moduleId="org.eclipse.cdt.core.language.mapping"/> +<storageModule moduleId="org.eclipse.cdt.internal.ui.text.commentOwnerProjectMappings"/> +<storageModule moduleId="org.eclipse.cdt.make.core.buildtargets"/> +</cconfiguration> +<cconfiguration id="cdt.managedbuild.config.gnu.mingw.exe.release.369958126"> +<storageModule buildSystemId="org.eclipse.cdt.managedbuilder.core.configurationDataProvider" id="cdt.managedbuild.config.gnu.mingw.exe.release.369958126" moduleId="org.eclipse.cdt.core.settings" name="Release"> +<externalSettings/> +<extensions> +<extension id="org.eclipse.cdt.core.PE" point="org.eclipse.cdt.core.BinaryParser"/> +<extension id="org.eclipse.cdt.core.GCCErrorParser" point="org.eclipse.cdt.core.ErrorParser"/> +<extension id="org.eclipse.cdt.core.GASErrorParser" point="org.eclipse.cdt.core.ErrorParser"/> +<extension id="org.eclipse.cdt.core.GLDErrorParser" point="org.eclipse.cdt.core.ErrorParser"/> +</extensions> +</storageModule> +<storageModule moduleId="cdtBuildSystem" version="4.0.0"> +<configuration artifactName="vision" buildArtefactType="org.eclipse.cdt.build.core.buildArtefactType.exe" buildProperties="org.eclipse.cdt.build.core.buildType=org.eclipse.cdt.build.core.buildType.release,org.eclipse.cdt.build.core.buildArtefactType=org.eclipse.cdt.build.core.buildArtefactType.exe" cleanCommand="rm -rf" description="" id="cdt.managedbuild.config.gnu.mingw.exe.release.369958126" name="Release" parent="cdt.managedbuild.config.gnu.mingw.exe.release"> +<folderInfo id="cdt.managedbuild.config.gnu.mingw.exe.release.369958126." name="/" resourcePath=""> +<toolChain id="cdt.managedbuild.toolchain.gnu.mingw.exe.release.888375786" name="MinGW GCC" superClass="cdt.managedbuild.toolchain.gnu.mingw.exe.release"> +<targetPlatform id="cdt.managedbuild.target.gnu.platform.mingw.exe.release.1315511489" name="Debug Platform" superClass="cdt.managedbuild.target.gnu.platform.mingw.exe.release"/> +<builder buildPath="${workspace_loc:/vision/Release}" id="cdt.managedbuild.tool.gnu.builder.mingw.base.110972834" keepEnvironmentInBuildfile="false" managedBuildOn="true" name="CDT Internal Builder" superClass="cdt.managedbuild.tool.gnu.builder.mingw.base"/> +<tool command="as" commandLinePattern="${COMMAND} ${FLAGS} ${OUTPUT_FLAG}${OUTPUT_PREFIX}${OUTPUT} ${INPUTS}" id="cdt.managedbuild.tool.gnu.assembler.mingw.exe.release.2086243688" name="GCC Assembler" superClass="cdt.managedbuild.tool.gnu.assembler.mingw.exe.release"> +<inputType id="cdt.managedbuild.tool.gnu.assembler.input.1712840500" superClass="cdt.managedbuild.tool.gnu.assembler.input"/> +</tool> +<tool id="cdt.managedbuild.tool.gnu.archiver.mingw.base.651087879" name="GCC Archiver" superClass="cdt.managedbuild.tool.gnu.archiver.mingw.base"/> +<tool id="cdt.managedbuild.tool.gnu.cpp.compiler.mingw.exe.release.1039220343" name="GCC C++ Compiler" superClass="cdt.managedbuild.tool.gnu.cpp.compiler.mingw.exe.release"> +<option id="gnu.cpp.compiler.mingw.exe.release.option.optimization.level.630178120" name="Optimization Level" superClass="gnu.cpp.compiler.mingw.exe.release.option.optimization.level" value="gnu.cpp.compiler.optimization.level.most" valueType="enumerated"/> +<option id="gnu.cpp.compiler.mingw.exe.release.option.debugging.level.1662296820" name="Debug Level" superClass="gnu.cpp.compiler.mingw.exe.release.option.debugging.level" value="gnu.cpp.compiler.debugging.level.none" valueType="enumerated"/> +<option id="gnu.cpp.compiler.option.include.paths.1558332788" superClass="gnu.cpp.compiler.option.include.paths" valueType="includePath"> +<listOptionValue builtIn="false" value=""C:\OpenCV2.1\include\opencv""/> +</option> +<inputType id="cdt.managedbuild.tool.gnu.cpp.compiler.input.394920570" superClass="cdt.managedbuild.tool.gnu.cpp.compiler.input"/> +</tool> +<tool id="cdt.managedbuild.tool.gnu.c.compiler.mingw.exe.release.1960648874" name="GCC C Compiler" superClass="cdt.managedbuild.tool.gnu.c.compiler.mingw.exe.release"> +<option defaultValue="gnu.c.optimization.level.most" id="gnu.c.compiler.mingw.exe.release.option.optimization.level.201552392" name="Optimization Level" superClass="gnu.c.compiler.mingw.exe.release.option.optimization.level" valueType="enumerated"/> +<option id="gnu.c.compiler.mingw.exe.release.option.debugging.level.89770317" name="Debug Level" superClass="gnu.c.compiler.mingw.exe.release.option.debugging.level" value="gnu.c.debugging.level.none" valueType="enumerated"/> +<option id="gnu.c.compiler.option.include.paths.1683514941" superClass="gnu.c.compiler.option.include.paths" valueType="includePath"> +<listOptionValue builtIn="false" value=""C:\OpenCV2.1\include\opencv""/> +</option> +<inputType id="cdt.managedbuild.tool.gnu.c.compiler.input.425612201" superClass="cdt.managedbuild.tool.gnu.c.compiler.input"/> +</tool> +<tool id="cdt.managedbuild.tool.gnu.c.linker.mingw.exe.release.1609582156" name="MinGW C Linker" superClass="cdt.managedbuild.tool.gnu.c.linker.mingw.exe.release"/> +<tool id="cdt.managedbuild.tool.gnu.cpp.linker.mingw.exe.release.1364150050" name="MinGW C++ Linker" superClass="cdt.managedbuild.tool.gnu.cpp.linker.mingw.exe.release"> +<option id="gnu.cpp.link.option.libs.1043700432" superClass="gnu.cpp.link.option.libs" valueType="libs"> +<listOptionValue builtIn="false" value="cv210"/> +<listOptionValue builtIn="false" value="cvaux210"/> +<listOptionValue builtIn="false" value="cxcore210"/> +<listOptionValue builtIn="false" value="highgui210"/> +<listOptionValue builtIn="false" value="ml210"/> +</option> +<option id="gnu.cpp.link.option.paths.452181845" superClass="gnu.cpp.link.option.paths" valueType="libPaths"> +<listOptionValue builtIn="false" value=""C:\OpenCV2.1\bin""/> +</option> +<inputType id="cdt.managedbuild.tool.gnu.cpp.linker.input.162577737" superClass="cdt.managedbuild.tool.gnu.cpp.linker.input"> +<additionalInput kind="additionalinputdependency" paths="$(USER_OBJS)"/> +<additionalInput kind="additionalinput" paths="$(LIBS)"/> +</inputType> +</tool> +</toolChain> +</folderInfo> +<sourceEntries> +<entry excluding="src" flags="VALUE_WORKSPACE_PATH|RESOLVED" kind="sourcePath" name=""/> +<entry flags="VALUE_WORKSPACE_PATH|RESOLVED" kind="sourcePath" name="src"/> +</sourceEntries> +</configuration> +</storageModule> +<storageModule moduleId="scannerConfiguration"> +<autodiscovery enabled="true" problemReportingEnabled="true" selectedProfileId="org.eclipse.cdt.make.core.GCCStandardMakePerProjectProfile"/> +<profile id="org.eclipse.cdt.make.core.GCCStandardMakePerProjectProfile"> +<buildOutputProvider> +<openAction enabled="true" filePath=""/> +<parser enabled="true"/> +</buildOutputProvider> +<scannerInfoProvider id="specsFile"> +<runAction arguments="-E -P -v -dD ${plugin_state_location}/${specs_file}" command="gcc" useDefault="true"/> +<parser enabled="true"/> +</scannerInfoProvider> +</profile> +<profile id="org.eclipse.cdt.make.core.GCCStandardMakePerFileProfile"> +<buildOutputProvider> +<openAction enabled="true" filePath=""/> +<parser enabled="true"/> +</buildOutputProvider> +<scannerInfoProvider id="makefileGenerator"> +<runAction arguments="-f ${project_name}_scd.mk" command="make" useDefault="true"/> +<parser enabled="true"/> +</scannerInfoProvider> +</profile> +<profile id="org.eclipse.cdt.managedbuilder.core.GCCManagedMakePerProjectProfile"> +<buildOutputProvider> +<openAction enabled="true" filePath=""/> +<parser enabled="true"/> +</buildOutputProvider> +<scannerInfoProvider id="specsFile"> +<runAction arguments="-E -P -v -dD ${plugin_state_location}/${specs_file}" command="gcc" useDefault="true"/> +<parser enabled="true"/> +</scannerInfoProvider> +</profile> +<profile id="org.eclipse.cdt.managedbuilder.core.GCCManagedMakePerProjectProfileCPP"> +<buildOutputProvider> +<openAction enabled="true" filePath=""/> +<parser enabled="true"/> +</buildOutputProvider> +<scannerInfoProvider id="specsFile"> +<runAction arguments="-E -P -v -dD ${plugin_state_location}/specs.cpp" command="g++" useDefault="true"/> +<parser enabled="true"/> +</scannerInfoProvider> +</profile> +<profile id="org.eclipse.cdt.managedbuilder.core.GCCManagedMakePerProjectProfileC"> +<buildOutputProvider> +<openAction enabled="true" filePath=""/> +<parser enabled="true"/> +</buildOutputProvider> +<scannerInfoProvider id="specsFile"> +<runAction arguments="-E -P -v -dD ${plugin_state_location}/specs.c" command="gcc" useDefault="true"/> +<parser enabled="true"/> +</scannerInfoProvider> +</profile> +<profile id="org.eclipse.cdt.managedbuilder.core.GCCWinManagedMakePerProjectProfile"> +<buildOutputProvider> +<openAction enabled="true" filePath=""/> +<parser enabled="true"/> +</buildOutputProvider> +<scannerInfoProvider id="specsFile"> +<runAction arguments="-c 'gcc -E -P -v -dD "${plugin_state_location}/${specs_file}"'" command="sh" useDefault="true"/> +<parser enabled="true"/> +</scannerInfoProvider> +</profile> +<profile id="org.eclipse.cdt.managedbuilder.core.GCCWinManagedMakePerProjectProfileCPP"> +<buildOutputProvider> +<openAction enabled="true" filePath=""/> +<parser enabled="true"/> +</buildOutputProvider> +<scannerInfoProvider id="specsFile"> +<runAction arguments="-c 'g++ -E -P -v -dD "${plugin_state_location}/specs.cpp"'" command="sh" useDefault="true"/> +<parser enabled="true"/> +</scannerInfoProvider> +</profile> +<profile id="org.eclipse.cdt.managedbuilder.core.GCCWinManagedMakePerProjectProfileC"> +<buildOutputProvider> +<openAction enabled="true" filePath=""/> +<parser enabled="true"/> +</buildOutputProvider> +<scannerInfoProvider id="specsFile"> +<runAction arguments="-c 'gcc -E -P -v -dD "${plugin_state_location}/specs.c"'" command="sh" useDefault="true"/> +<parser enabled="true"/> +</scannerInfoProvider> +</profile> +<profile id="org.eclipse.cdt.managedbuilder.xlc.core.XLCManagedMakePerProjectProfile"> +<buildOutputProvider> +<openAction enabled="false" filePath=""/> +<parser enabled="false"/> +</buildOutputProvider> +<scannerInfoProvider id="specsFile"> +<runAction arguments="-E -v ${plugin_state_location}/${specs_file}" command="${XL_compilerRoot}/xlc" useDefault="true"/> +<parser enabled="true"/> +</scannerInfoProvider> +</profile> +<profile id="org.eclipse.cdt.managedbuilder.xlc.core.XLCManagedMakePerProjectProfileCPP"> +<buildOutputProvider> +<openAction enabled="false" filePath=""/> +<parser enabled="false"/> +</buildOutputProvider> +<scannerInfoProvider id="specsFile"> +<runAction arguments="-E -v ${plugin_state_location}/${specs_file}" command="${XL_compilerRoot}/xlC" useDefault="true"/> +<parser enabled="true"/> +</scannerInfoProvider> +</profile> +<scannerConfigBuildInfo instanceId="cdt.managedbuild.config.gnu.mingw.exe.release.369958126;cdt.managedbuild.config.gnu.mingw.exe.release.369958126.;cdt.managedbuild.tool.gnu.c.compiler.mingw.exe.release.1960648874;cdt.managedbuild.tool.gnu.c.compiler.input.425612201"> +<autodiscovery enabled="true" problemReportingEnabled="true" selectedProfileId="org.eclipse.cdt.managedbuilder.core.GCCManagedMakePerProjectProfileC"/> +<profile id="org.eclipse.cdt.make.core.GCCStandardMakePerProjectProfile"> +<buildOutputProvider> +<openAction enabled="true" filePath=""/> +<parser enabled="true"/> +</buildOutputProvider> +<scannerInfoProvider id="specsFile"> +<runAction arguments="-E -P -v -dD ${plugin_state_location}/${specs_file}" command="gcc" useDefault="true"/> +<parser enabled="true"/> +</scannerInfoProvider> +</profile> +<profile id="org.eclipse.cdt.make.core.GCCStandardMakePerFileProfile"> +<buildOutputProvider> +<openAction enabled="true" filePath=""/> +<parser enabled="true"/> +</buildOutputProvider> +<scannerInfoProvider id="makefileGenerator"> +<runAction arguments="-f ${project_name}_scd.mk" command="make" useDefault="true"/> +<parser enabled="true"/> +</scannerInfoProvider> +</profile> +<profile id="org.eclipse.cdt.managedbuilder.core.GCCManagedMakePerProjectProfile"> +<buildOutputProvider> +<openAction enabled="true" filePath=""/> +<parser enabled="true"/> +</buildOutputProvider> +<scannerInfoProvider id="specsFile"> +<runAction arguments="-E -P -v -dD ${plugin_state_location}/${specs_file}" command="gcc" useDefault="true"/> +<parser enabled="true"/> +</scannerInfoProvider> +</profile> +<profile id="org.eclipse.cdt.managedbuilder.core.GCCManagedMakePerProjectProfileCPP"> +<buildOutputProvider> +<openAction enabled="true" filePath=""/> +<parser enabled="true"/> +</buildOutputProvider> +<scannerInfoProvider id="specsFile"> +<runAction arguments="-E -P -v -dD ${plugin_state_location}/specs.cpp" command="g++" useDefault="true"/> +<parser enabled="true"/> +</scannerInfoProvider> +</profile> +<profile id="org.eclipse.cdt.managedbuilder.core.GCCManagedMakePerProjectProfileC"> +<buildOutputProvider> +<openAction enabled="true" filePath=""/> +<parser enabled="true"/> +</buildOutputProvider> +<scannerInfoProvider id="specsFile"> +<runAction arguments="-E -P -v -dD ${plugin_state_location}/specs.c" command="gcc" useDefault="true"/> +<parser enabled="true"/> +</scannerInfoProvider> +</profile> +<profile id="org.eclipse.cdt.managedbuilder.core.GCCWinManagedMakePerProjectProfile"> +<buildOutputProvider> +<openAction enabled="true" filePath=""/> +<parser enabled="true"/> +</buildOutputProvider> +<scannerInfoProvider id="specsFile"> +<runAction arguments="-c 'gcc -E -P -v -dD "${plugin_state_location}/${specs_file}"'" command="sh" useDefault="true"/> +<parser enabled="true"/> +</scannerInfoProvider> +</profile> +<profile id="org.eclipse.cdt.managedbuilder.core.GCCWinManagedMakePerProjectProfileCPP"> +<buildOutputProvider> +<openAction enabled="true" filePath=""/> +<parser enabled="true"/> +</buildOutputProvider> +<scannerInfoProvider id="specsFile"> +<runAction arguments="-c 'g++ -E -P -v -dD "${plugin_state_location}/specs.cpp"'" command="sh" useDefault="true"/> +<parser enabled="true"/> +</scannerInfoProvider> +</profile> +<profile id="org.eclipse.cdt.managedbuilder.core.GCCWinManagedMakePerProjectProfileC"> +<buildOutputProvider> +<openAction enabled="true" filePath=""/> +<parser enabled="true"/> +</buildOutputProvider> +<scannerInfoProvider id="specsFile"> +<runAction arguments="-c 'gcc -E -P -v -dD "${plugin_state_location}/specs.c"'" command="sh" useDefault="true"/> +<parser enabled="true"/> +</scannerInfoProvider> +</profile> +<profile id="org.eclipse.cdt.managedbuilder.xlc.core.XLCManagedMakePerProjectProfile"> +<buildOutputProvider> +<openAction enabled="false" filePath=""/> +<parser enabled="false"/> +</buildOutputProvider> +<scannerInfoProvider id="specsFile"> +<runAction arguments="-E -v ${plugin_state_location}/${specs_file}" command="${XL_compilerRoot}/xlc" useDefault="true"/> +<parser enabled="true"/> +</scannerInfoProvider> +</profile> +<profile id="org.eclipse.cdt.managedbuilder.xlc.core.XLCManagedMakePerProjectProfileCPP"> +<buildOutputProvider> +<openAction enabled="false" filePath=""/> +<parser enabled="false"/> +</buildOutputProvider> +<scannerInfoProvider id="specsFile"> +<runAction arguments="-E -v ${plugin_state_location}/${specs_file}" command="${XL_compilerRoot}/xlC" useDefault="true"/> +<parser enabled="true"/> +</scannerInfoProvider> +</profile> +</scannerConfigBuildInfo> +<scannerConfigBuildInfo instanceId="cdt.managedbuild.config.gnu.mingw.exe.debug.1794257183;cdt.managedbuild.config.gnu.mingw.exe.debug.1794257183.;cdt.managedbuild.tool.gnu.cpp.compiler.mingw.exe.debug.690373895;cdt.managedbuild.tool.gnu.cpp.compiler.input.881392952"> +<autodiscovery enabled="true" problemReportingEnabled="true" selectedProfileId="org.eclipse.cdt.managedbuilder.core.GCCManagedMakePerProjectProfileCPP"/> +<profile id="org.eclipse.cdt.make.core.GCCStandardMakePerProjectProfile"> +<buildOutputProvider> +<openAction enabled="true" filePath=""/> +<parser enabled="true"/> +</buildOutputProvider> +<scannerInfoProvider id="specsFile"> +<runAction arguments="-E -P -v -dD ${plugin_state_location}/${specs_file}" command="gcc" useDefault="true"/> +<parser enabled="true"/> +</scannerInfoProvider> +</profile> +<profile id="org.eclipse.cdt.make.core.GCCStandardMakePerFileProfile"> +<buildOutputProvider> +<openAction enabled="true" filePath=""/> +<parser enabled="true"/> +</buildOutputProvider> +<scannerInfoProvider id="makefileGenerator"> +<runAction arguments="-f ${project_name}_scd.mk" command="make" useDefault="true"/> +<parser enabled="true"/> +</scannerInfoProvider> +</profile> +<profile id="org.eclipse.cdt.managedbuilder.core.GCCManagedMakePerProjectProfile"> +<buildOutputProvider> +<openAction enabled="true" filePath=""/> +<parser enabled="true"/> +</buildOutputProvider> +<scannerInfoProvider id="specsFile"> +<runAction arguments="-E -P -v -dD ${plugin_state_location}/${specs_file}" command="gcc" useDefault="true"/> +<parser enabled="true"/> +</scannerInfoProvider> +</profile> +<profile id="org.eclipse.cdt.managedbuilder.core.GCCManagedMakePerProjectProfileCPP"> +<buildOutputProvider> +<openAction enabled="true" filePath=""/> +<parser enabled="true"/> +</buildOutputProvider> +<scannerInfoProvider id="specsFile"> +<runAction arguments="-E -P -v -dD ${plugin_state_location}/specs.cpp" command="g++" useDefault="true"/> +<parser enabled="true"/> +</scannerInfoProvider> +</profile> +<profile id="org.eclipse.cdt.managedbuilder.core.GCCManagedMakePerProjectProfileC"> +<buildOutputProvider> +<openAction enabled="true" filePath=""/> +<parser enabled="true"/> +</buildOutputProvider> +<scannerInfoProvider id="specsFile"> +<runAction arguments="-E -P -v -dD ${plugin_state_location}/specs.c" command="gcc" useDefault="true"/> +<parser enabled="true"/> +</scannerInfoProvider> +</profile> +<profile id="org.eclipse.cdt.managedbuilder.core.GCCWinManagedMakePerProjectProfile"> +<buildOutputProvider> +<openAction enabled="true" filePath=""/> +<parser enabled="true"/> +</buildOutputProvider> +<scannerInfoProvider id="specsFile"> +<runAction arguments="-c 'gcc -E -P -v -dD "${plugin_state_location}/${specs_file}"'" command="sh" useDefault="true"/> +<parser enabled="true"/> +</scannerInfoProvider> +</profile> +<profile id="org.eclipse.cdt.managedbuilder.core.GCCWinManagedMakePerProjectProfileCPP"> +<buildOutputProvider> +<openAction enabled="true" filePath=""/> +<parser enabled="true"/> +</buildOutputProvider> +<scannerInfoProvider id="specsFile"> +<runAction arguments="-c 'g++ -E -P -v -dD "${plugin_state_location}/specs.cpp"'" command="sh" useDefault="true"/> +<parser enabled="true"/> +</scannerInfoProvider> +</profile> +<profile id="org.eclipse.cdt.managedbuilder.core.GCCWinManagedMakePerProjectProfileC"> +<buildOutputProvider> +<openAction enabled="true" filePath=""/> +<parser enabled="true"/> +</buildOutputProvider> +<scannerInfoProvider id="specsFile"> +<runAction arguments="-c 'gcc -E -P -v -dD "${plugin_state_location}/specs.c"'" command="sh" useDefault="true"/> +<parser enabled="true"/> +</scannerInfoProvider> +</profile> +<profile id="org.eclipse.cdt.managedbuilder.xlc.core.XLCManagedMakePerProjectProfile"> +<buildOutputProvider> +<openAction enabled="false" filePath=""/> +<parser enabled="false"/> +</buildOutputProvider> +<scannerInfoProvider id="specsFile"> +<runAction arguments="-E -v ${plugin_state_location}/${specs_file}" command="${XL_compilerRoot}/xlc" useDefault="true"/> +<parser enabled="true"/> +</scannerInfoProvider> +</profile> +<profile id="org.eclipse.cdt.managedbuilder.xlc.core.XLCManagedMakePerProjectProfileCPP"> +<buildOutputProvider> +<openAction enabled="false" filePath=""/> +<parser enabled="false"/> +</buildOutputProvider> +<scannerInfoProvider id="specsFile"> +<runAction arguments="-E -v ${plugin_state_location}/${specs_file}" command="${XL_compilerRoot}/xlC" useDefault="true"/> +<parser enabled="true"/> +</scannerInfoProvider> +</profile> +</scannerConfigBuildInfo> +<scannerConfigBuildInfo instanceId="cdt.managedbuild.config.gnu.mingw.exe.release.369958126;cdt.managedbuild.config.gnu.mingw.exe.release.369958126.;cdt.managedbuild.tool.gnu.cpp.compiler.mingw.exe.release.1039220343;cdt.managedbuild.tool.gnu.cpp.compiler.input.394920570"> +<autodiscovery enabled="true" problemReportingEnabled="true" selectedProfileId="org.eclipse.cdt.managedbuilder.core.GCCManagedMakePerProjectProfileCPP"/> +<profile id="org.eclipse.cdt.make.core.GCCStandardMakePerProjectProfile"> +<buildOutputProvider> +<openAction enabled="true" filePath=""/> +<parser enabled="true"/> +</buildOutputProvider> +<scannerInfoProvider id="specsFile"> +<runAction arguments="-E -P -v -dD ${plugin_state_location}/${specs_file}" command="gcc" useDefault="true"/> +<parser enabled="true"/> +</scannerInfoProvider> +</profile> +<profile id="org.eclipse.cdt.make.core.GCCStandardMakePerFileProfile"> +<buildOutputProvider> +<openAction enabled="true" filePath=""/> +<parser enabled="true"/> +</buildOutputProvider> +<scannerInfoProvider id="makefileGenerator"> +<runAction arguments="-f ${project_name}_scd.mk" command="make" useDefault="true"/> +<parser enabled="true"/> +</scannerInfoProvider> +</profile> +<profile id="org.eclipse.cdt.managedbuilder.core.GCCManagedMakePerProjectProfile"> +<buildOutputProvider> +<openAction enabled="true" filePath=""/> +<parser enabled="true"/> +</buildOutputProvider> +<scannerInfoProvider id="specsFile"> +<runAction arguments="-E -P -v -dD ${plugin_state_location}/${specs_file}" command="gcc" useDefault="true"/> +<parser enabled="true"/> +</scannerInfoProvider> +</profile> +<profile id="org.eclipse.cdt.managedbuilder.core.GCCManagedMakePerProjectProfileCPP"> +<buildOutputProvider> +<openAction enabled="true" filePath=""/> +<parser enabled="true"/> +</buildOutputProvider> +<scannerInfoProvider id="specsFile"> +<runAction arguments="-E -P -v -dD ${plugin_state_location}/specs.cpp" command="g++" useDefault="true"/> +<parser enabled="true"/> +</scannerInfoProvider> +</profile> +<profile id="org.eclipse.cdt.managedbuilder.core.GCCManagedMakePerProjectProfileC"> +<buildOutputProvider> +<openAction enabled="true" filePath=""/> +<parser enabled="true"/> +</buildOutputProvider> +<scannerInfoProvider id="specsFile"> +<runAction arguments="-E -P -v -dD ${plugin_state_location}/specs.c" command="gcc" useDefault="true"/> +<parser enabled="true"/> +</scannerInfoProvider> +</profile> +<profile id="org.eclipse.cdt.managedbuilder.core.GCCWinManagedMakePerProjectProfile"> +<buildOutputProvider> +<openAction enabled="true" filePath=""/> +<parser enabled="true"/> +</buildOutputProvider> +<scannerInfoProvider id="specsFile"> +<runAction arguments="-c 'gcc -E -P -v -dD "${plugin_state_location}/${specs_file}"'" command="sh" useDefault="true"/> +<parser enabled="true"/> +</scannerInfoProvider> +</profile> +<profile id="org.eclipse.cdt.managedbuilder.core.GCCWinManagedMakePerProjectProfileCPP"> +<buildOutputProvider> +<openAction enabled="true" filePath=""/> +<parser enabled="true"/> +</buildOutputProvider> +<scannerInfoProvider id="specsFile"> +<runAction arguments="-c 'g++ -E -P -v -dD "${plugin_state_location}/specs.cpp"'" command="sh" useDefault="true"/> +<parser enabled="true"/> +</scannerInfoProvider> +</profile> +<profile id="org.eclipse.cdt.managedbuilder.core.GCCWinManagedMakePerProjectProfileC"> +<buildOutputProvider> +<openAction enabled="true" filePath=""/> +<parser enabled="true"/> +</buildOutputProvider> +<scannerInfoProvider id="specsFile"> +<runAction arguments="-c 'gcc -E -P -v -dD "${plugin_state_location}/specs.c"'" command="sh" useDefault="true"/> +<parser enabled="true"/> +</scannerInfoProvider> +</profile> +<profile id="org.eclipse.cdt.managedbuilder.xlc.core.XLCManagedMakePerProjectProfile"> +<buildOutputProvider> +<openAction enabled="false" filePath=""/> +<parser enabled="false"/> +</buildOutputProvider> +<scannerInfoProvider id="specsFile"> +<runAction arguments="-E -v ${plugin_state_location}/${specs_file}" command="${XL_compilerRoot}/xlc" useDefault="true"/> +<parser enabled="true"/> +</scannerInfoProvider> +</profile> +<profile id="org.eclipse.cdt.managedbuilder.xlc.core.XLCManagedMakePerProjectProfileCPP"> +<buildOutputProvider> +<openAction enabled="false" filePath=""/> +<parser enabled="false"/> +</buildOutputProvider> +<scannerInfoProvider id="specsFile"> +<runAction arguments="-E -v ${plugin_state_location}/${specs_file}" command="${XL_compilerRoot}/xlC" useDefault="true"/> +<parser enabled="true"/> +</scannerInfoProvider> +</profile> +</scannerConfigBuildInfo> +<scannerConfigBuildInfo instanceId="cdt.managedbuild.config.gnu.mingw.exe.debug.1794257183;cdt.managedbuild.config.gnu.mingw.exe.debug.1794257183.;cdt.managedbuild.tool.gnu.c.compiler.mingw.exe.debug.1406350564;cdt.managedbuild.tool.gnu.c.compiler.input.2072174392"> +<autodiscovery enabled="true" problemReportingEnabled="true" selectedProfileId="org.eclipse.cdt.managedbuilder.core.GCCManagedMakePerProjectProfileC"/> +<profile id="org.eclipse.cdt.make.core.GCCStandardMakePerProjectProfile"> +<buildOutputProvider> +<openAction enabled="true" filePath=""/> +<parser enabled="true"/> +</buildOutputProvider> +<scannerInfoProvider id="specsFile"> +<runAction arguments="-E -P -v -dD ${plugin_state_location}/${specs_file}" command="gcc" useDefault="true"/> +<parser enabled="true"/> +</scannerInfoProvider> +</profile> +<profile id="org.eclipse.cdt.make.core.GCCStandardMakePerFileProfile"> +<buildOutputProvider> +<openAction enabled="true" filePath=""/> +<parser enabled="true"/> +</buildOutputProvider> +<scannerInfoProvider id="makefileGenerator"> +<runAction arguments="-f ${project_name}_scd.mk" command="make" useDefault="true"/> +<parser enabled="true"/> +</scannerInfoProvider> +</profile> +<profile id="org.eclipse.cdt.managedbuilder.core.GCCManagedMakePerProjectProfile"> +<buildOutputProvider> +<openAction enabled="true" filePath=""/> +<parser enabled="true"/> +</buildOutputProvider> +<scannerInfoProvider id="specsFile"> +<runAction arguments="-E -P -v -dD ${plugin_state_location}/${specs_file}" command="gcc" useDefault="true"/> +<parser enabled="true"/> +</scannerInfoProvider> +</profile> +<profile id="org.eclipse.cdt.managedbuilder.core.GCCManagedMakePerProjectProfileCPP"> +<buildOutputProvider> +<openAction enabled="true" filePath=""/> +<parser enabled="true"/> +</buildOutputProvider> +<scannerInfoProvider id="specsFile"> +<runAction arguments="-E -P -v -dD ${plugin_state_location}/specs.cpp" command="g++" useDefault="true"/> +<parser enabled="true"/> +</scannerInfoProvider> +</profile> +<profile id="org.eclipse.cdt.managedbuilder.core.GCCManagedMakePerProjectProfileC"> +<buildOutputProvider> +<openAction enabled="true" filePath=""/> +<parser enabled="true"/> +</buildOutputProvider> +<scannerInfoProvider id="specsFile"> +<runAction arguments="-E -P -v -dD ${plugin_state_location}/specs.c" command="gcc" useDefault="true"/> +<parser enabled="true"/> +</scannerInfoProvider> +</profile> +<profile id="org.eclipse.cdt.managedbuilder.core.GCCWinManagedMakePerProjectProfile"> +<buildOutputProvider> +<openAction enabled="true" filePath=""/> +<parser enabled="true"/> +</buildOutputProvider> +<scannerInfoProvider id="specsFile"> +<runAction arguments="-c 'gcc -E -P -v -dD "${plugin_state_location}/${specs_file}"'" command="sh" useDefault="true"/> +<parser enabled="true"/> +</scannerInfoProvider> +</profile> +<profile id="org.eclipse.cdt.managedbuilder.core.GCCWinManagedMakePerProjectProfileCPP"> +<buildOutputProvider> +<openAction enabled="true" filePath=""/> +<parser enabled="true"/> +</buildOutputProvider> +<scannerInfoProvider id="specsFile"> +<runAction arguments="-c 'g++ -E -P -v -dD "${plugin_state_location}/specs.cpp"'" command="sh" useDefault="true"/> +<parser enabled="true"/> +</scannerInfoProvider> +</profile> +<profile id="org.eclipse.cdt.managedbuilder.core.GCCWinManagedMakePerProjectProfileC"> +<buildOutputProvider> +<openAction enabled="true" filePath=""/> +<parser enabled="true"/> +</buildOutputProvider> +<scannerInfoProvider id="specsFile"> +<runAction arguments="-c 'gcc -E -P -v -dD "${plugin_state_location}/specs.c"'" command="sh" useDefault="true"/> +<parser enabled="true"/> +</scannerInfoProvider> +</profile> +<profile id="org.eclipse.cdt.managedbuilder.xlc.core.XLCManagedMakePerProjectProfile"> +<buildOutputProvider> +<openAction enabled="false" filePath=""/> +<parser enabled="false"/> +</buildOutputProvider> +<scannerInfoProvider id="specsFile"> +<runAction arguments="-E -v ${plugin_state_location}/${specs_file}" command="${XL_compilerRoot}/xlc" useDefault="true"/> +<parser enabled="true"/> +</scannerInfoProvider> +</profile> +<profile id="org.eclipse.cdt.managedbuilder.xlc.core.XLCManagedMakePerProjectProfileCPP"> +<buildOutputProvider> +<openAction enabled="false" filePath=""/> +<parser enabled="false"/> +</buildOutputProvider> +<scannerInfoProvider id="specsFile"> +<runAction arguments="-E -v ${plugin_state_location}/${specs_file}" command="${XL_compilerRoot}/xlC" useDefault="true"/> +<parser enabled="true"/> +</scannerInfoProvider> +</profile> +</scannerConfigBuildInfo> +</storageModule> +<storageModule moduleId="org.eclipse.cdt.core.externalSettings"/> +<storageModule moduleId="org.eclipse.cdt.core.language.mapping"/> +<storageModule moduleId="org.eclipse.cdt.internal.ui.text.commentOwnerProjectMappings"/> +<storageModule moduleId="org.eclipse.cdt.make.core.buildtargets"/> +</cconfiguration> +</storageModule> +<storageModule moduleId="cdtBuildSystem" version="4.0.0"> +<project id="vision.cdt.managedbuild.target.gnu.mingw.exe.407966002" name="Executable" projectType="cdt.managedbuild.target.gnu.mingw.exe"/> +</storageModule> +</cproject> Added: vision/.project =================================================================== --- vision/.project (rev 0) +++ vision/.project 2010-05-20 01:00:10 UTC (rev 13) @@ -0,0 +1,70 @@ +<?xml version="1.0" encoding="UTF-8"?> +<projectDescription> + <name>vision</name> + <comment></comment> + <projects> + </projects> + <buildSpec> + <buildCommand> + <name>org.eclipse.cdt.managedbuilder.core.genmakebuilder</name> + <triggers>clean,full,incremental,</triggers> + <arguments> + <dictionary> + <key>?name?</key> + <value></value> + </dictionary> + <dictionary> + <key>org.eclipse.cdt.make.core.append_environment</key> + <value>true</value> + </dictionary> + <dictionary> + <key>org.eclipse.cdt.make.core.buildArguments</key> + <value></value> + </dictionary> + <dictionary> + <key>org.eclipse.cdt.make.core.buildCommand</key> + <value>make</value> + </dictionary> + <dictionary> + <key>org.eclipse.cdt.make.core.buildLocation</key> + <value>${workspace_loc:/vision/Release}</value> + </... [truncated message content] |
From: <phi...@us...> - 2010-05-20 01:00:19
|
Revision: 13 http://robotvision.svn.sourceforge.net/robotvision/?rev=13&view=rev Author: phildavidson Date: 2010-05-20 01:00:10 +0000 (Thu, 20 May 2010) Log Message: ----------- pipe 90% done Added Paths: ----------- vision/.cproject vision/.project vision/images/ vision/images/3dballs.jpg vision/images/pic1.png vision/images/pic2.png vision/images/pic3.png vision/images/pic4.png vision/images/pic5.png vision/images/pic6.png vision/images/pipe.PNG vision/images/pipethresh.png vision/src/ vision/src/squares.c vision/src/test.cpp vision/src/test2.cpp vision/testimg.png vision/videos/ vision/videos/ets2007buoy.avi vision/videos/ets2007pipe.avi vision/videos/pipe3.avi Added: vision/.cproject =================================================================== --- vision/.cproject (rev 0) +++ vision/.cproject 2010-05-20 01:00:10 UTC (rev 13) @@ -0,0 +1,1172 @@ +<?xml version="1.0" encoding="UTF-8" standalone="no"?> +<?fileVersion 4.0.0?> + +<cproject storage_type_id="org.eclipse.cdt.core.XmlProjectDescriptionStorage"> +<storageModule moduleId="org.eclipse.cdt.core.settings"> +<cconfiguration id="cdt.managedbuild.config.gnu.mingw.exe.debug.1794257183"> +<storageModule buildSystemId="org.eclipse.cdt.managedbuilder.core.configurationDataProvider" id="cdt.managedbuild.config.gnu.mingw.exe.debug.1794257183" moduleId="org.eclipse.cdt.core.settings" name="Debug"> +<externalSettings/> +<extensions> +<extension id="org.eclipse.cdt.core.PE" point="org.eclipse.cdt.core.BinaryParser"/> +<extension id="org.eclipse.cdt.core.GCCErrorParser" point="org.eclipse.cdt.core.ErrorParser"/> +<extension id="org.eclipse.cdt.core.GASErrorParser" point="org.eclipse.cdt.core.ErrorParser"/> +<extension id="org.eclipse.cdt.core.GLDErrorParser" point="org.eclipse.cdt.core.ErrorParser"/> +</extensions> +</storageModule> +<storageModule moduleId="cdtBuildSystem" version="4.0.0"> +<configuration artifactName="vision" buildArtefactType="org.eclipse.cdt.build.core.buildArtefactType.exe" buildProperties="org.eclipse.cdt.build.core.buildType=org.eclipse.cdt.build.core.buildType.debug,org.eclipse.cdt.build.core.buildArtefactType=org.eclipse.cdt.build.core.buildArtefactType.exe" cleanCommand="rm -rf" description="" id="cdt.managedbuild.config.gnu.mingw.exe.debug.1794257183" name="Debug" parent="cdt.managedbuild.config.gnu.mingw.exe.debug"> +<folderInfo id="cdt.managedbuild.config.gnu.mingw.exe.debug.1794257183." name="/" resourcePath=""> +<toolChain id="cdt.managedbuild.toolchain.gnu.mingw.exe.debug.630271631" name="MinGW GCC" superClass="cdt.managedbuild.toolchain.gnu.mingw.exe.debug"> +<targetPlatform id="cdt.managedbuild.target.gnu.platform.mingw.exe.debug.2026977244" name="Debug Platform" superClass="cdt.managedbuild.target.gnu.platform.mingw.exe.debug"/> +<builder buildPath="${workspace_loc:/vision/Debug}" id="cdt.managedbuild.tool.gnu.builder.mingw.base.1674458609" keepEnvironmentInBuildfile="false" managedBuildOn="true" name="CDT Internal Builder" superClass="cdt.managedbuild.tool.gnu.builder.mingw.base"/> +<tool id="cdt.managedbuild.tool.gnu.assembler.mingw.exe.debug.261759773" name="GCC Assembler" superClass="cdt.managedbuild.tool.gnu.assembler.mingw.exe.debug"> +<inputType id="cdt.managedbuild.tool.gnu.assembler.input.737547003" superClass="cdt.managedbuild.tool.gnu.assembler.input"/> +</tool> +<tool id="cdt.managedbuild.tool.gnu.archiver.mingw.base.1390554830" name="GCC Archiver" superClass="cdt.managedbuild.tool.gnu.archiver.mingw.base"/> +<tool id="cdt.managedbuild.tool.gnu.cpp.compiler.mingw.exe.debug.690373895" name="GCC C++ Compiler" superClass="cdt.managedbuild.tool.gnu.cpp.compiler.mingw.exe.debug"> +<option id="gnu.cpp.compiler.mingw.exe.debug.option.optimization.level.1831407888" name="Optimization Level" superClass="gnu.cpp.compiler.mingw.exe.debug.option.optimization.level" value="gnu.cpp.compiler.optimization.level.none" valueType="enumerated"/> +<option id="gnu.cpp.compiler.mingw.exe.debug.option.debugging.level.523974820" name="Debug Level" superClass="gnu.cpp.compiler.mingw.exe.debug.option.debugging.level" value="gnu.cpp.compiler.debugging.level.max" valueType="enumerated"/> +<option id="gnu.cpp.compiler.option.include.paths.1983097712" name="Include paths (-I)" superClass="gnu.cpp.compiler.option.include.paths" valueType="includePath"> +<listOptionValue builtIn="false" value=""C:\OpenCV2.1\include\opencv""/> +</option> +<inputType id="cdt.managedbuild.tool.gnu.cpp.compiler.input.881392952" superClass="cdt.managedbuild.tool.gnu.cpp.compiler.input"/> +</tool> +<tool id="cdt.managedbuild.tool.gnu.c.compiler.mingw.exe.debug.1406350564" name="GCC C Compiler" superClass="cdt.managedbuild.tool.gnu.c.compiler.mingw.exe.debug"> +<option defaultValue="gnu.c.optimization.level.none" id="gnu.c.compiler.mingw.exe.debug.option.optimization.level.1766779643" name="Optimization Level" superClass="gnu.c.compiler.mingw.exe.debug.option.optimization.level" valueType="enumerated"/> +<option id="gnu.c.compiler.mingw.exe.debug.option.debugging.level.852285159" name="Debug Level" superClass="gnu.c.compiler.mingw.exe.debug.option.debugging.level" value="gnu.c.debugging.level.max" valueType="enumerated"/> +<option id="gnu.c.compiler.option.include.paths.1287588982" name="Include paths (-I)" superClass="gnu.c.compiler.option.include.paths" valueType="includePath"> +<listOptionValue builtIn="false" value=""C:\OpenCV2.1\include\opencv""/> +</option> +<inputType id="cdt.managedbuild.tool.gnu.c.compiler.input.2072174392" superClass="cdt.managedbuild.tool.gnu.c.compiler.input"/> +</tool> +<tool id="cdt.managedbuild.tool.gnu.c.linker.mingw.exe.debug.1458068716" name="MinGW C Linker" superClass="cdt.managedbuild.tool.gnu.c.linker.mingw.exe.debug"/> +<tool id="cdt.managedbuild.tool.gnu.cpp.linker.mingw.exe.debug.1280962527" name="MinGW C++ Linker" superClass="cdt.managedbuild.tool.gnu.cpp.linker.mingw.exe.debug"> +<option id="gnu.cpp.link.option.libs.1732101261" name="Libraries (-l)" superClass="gnu.cpp.link.option.libs" valueType="libs"> +<listOptionValue builtIn="false" value="cv210"/> +<listOptionValue builtIn="false" value="cvaux210"/> +<listOptionValue builtIn="false" value="cxcore210"/> +<listOptionValue builtIn="false" value="highgui210"/> +<listOptionValue builtIn="false" value="ml210"/> +</option> +<option id="gnu.cpp.link.option.paths.1959014800" name="Library search path (-L)" superClass="gnu.cpp.link.option.paths" valueType="libPaths"> +<listOptionValue builtIn="false" value=""C:\OpenCV2.1\bin""/> +</option> +<inputType id="cdt.managedbuild.tool.gnu.cpp.linker.input.599977798" superClass="cdt.managedbuild.tool.gnu.cpp.linker.input"> +<additionalInput kind="additionalinputdependency" paths="$(USER_OBJS)"/> +<additionalInput kind="additionalinput" paths="$(LIBS)"/> +</inputType> +</tool> +</toolChain> +</folderInfo> +<sourceEntries> +<entry excluding="src" flags="VALUE_WORKSPACE_PATH|RESOLVED" kind="sourcePath" name=""/> +<entry flags="VALUE_WORKSPACE_PATH|RESOLVED" kind="sourcePath" name="src"/> +</sourceEntries> +</configuration> +</storageModule> +<storageModule moduleId="scannerConfiguration"> +<autodiscovery enabled="true" problemReportingEnabled="true" selectedProfileId="org.eclipse.cdt.make.core.GCCStandardMakePerProjectProfile"/> +<profile id="org.eclipse.cdt.make.core.GCCStandardMakePerProjectProfile"> +<buildOutputProvider> +<openAction enabled="true" filePath=""/> +<parser enabled="true"/> +</buildOutputProvider> +<scannerInfoProvider id="specsFile"> +<runAction arguments="-E -P -v -dD ${plugin_state_location}/${specs_file}" command="gcc" useDefault="true"/> +<parser enabled="true"/> +</scannerInfoProvider> +</profile> +<profile id="org.eclipse.cdt.make.core.GCCStandardMakePerFileProfile"> +<buildOutputProvider> +<openAction enabled="true" filePath=""/> +<parser enabled="true"/> +</buildOutputProvider> +<scannerInfoProvider id="makefileGenerator"> +<runAction arguments="-f ${project_name}_scd.mk" command="make" useDefault="true"/> +<parser enabled="true"/> +</scannerInfoProvider> +</profile> +<profile id="org.eclipse.cdt.managedbuilder.core.GCCManagedMakePerProjectProfile"> +<buildOutputProvider> +<openAction enabled="true" filePath=""/> +<parser enabled="true"/> +</buildOutputProvider> +<scannerInfoProvider id="specsFile"> +<runAction arguments="-E -P -v -dD ${plugin_state_location}/${specs_file}" command="gcc" useDefault="true"/> +<parser enabled="true"/> +</scannerInfoProvider> +</profile> +<profile id="org.eclipse.cdt.managedbuilder.core.GCCManagedMakePerProjectProfileCPP"> +<buildOutputProvider> +<openAction enabled="true" filePath=""/> +<parser enabled="true"/> +</buildOutputProvider> +<scannerInfoProvider id="specsFile"> +<runAction arguments="-E -P -v -dD ${plugin_state_location}/specs.cpp" command="g++" useDefault="true"/> +<parser enabled="true"/> +</scannerInfoProvider> +</profile> +<profile id="org.eclipse.cdt.managedbuilder.core.GCCManagedMakePerProjectProfileC"> +<buildOutputProvider> +<openAction enabled="true" filePath=""/> +<parser enabled="true"/> +</buildOutputProvider> +<scannerInfoProvider id="specsFile"> +<runAction arguments="-E -P -v -dD ${plugin_state_location}/specs.c" command="gcc" useDefault="true"/> +<parser enabled="true"/> +</scannerInfoProvider> +</profile> +<profile id="org.eclipse.cdt.managedbuilder.core.GCCWinManagedMakePerProjectProfile"> +<buildOutputProvider> +<openAction enabled="true" filePath=""/> +<parser enabled="true"/> +</buildOutputProvider> +<scannerInfoProvider id="specsFile"> +<runAction arguments="-c 'gcc -E -P -v -dD "${plugin_state_location}/${specs_file}"'" command="sh" useDefault="true"/> +<parser enabled="true"/> +</scannerInfoProvider> +</profile> +<profile id="org.eclipse.cdt.managedbuilder.core.GCCWinManagedMakePerProjectProfileCPP"> +<buildOutputProvider> +<openAction enabled="true" filePath=""/> +<parser enabled="true"/> +</buildOutputProvider> +<scannerInfoProvider id="specsFile"> +<runAction arguments="-c 'g++ -E -P -v -dD "${plugin_state_location}/specs.cpp"'" command="sh" useDefault="true"/> +<parser enabled="true"/> +</scannerInfoProvider> +</profile> +<profile id="org.eclipse.cdt.managedbuilder.core.GCCWinManagedMakePerProjectProfileC"> +<buildOutputProvider> +<openAction enabled="true" filePath=""/> +<parser enabled="true"/> +</buildOutputProvider> +<scannerInfoProvider id="specsFile"> +<runAction arguments="-c 'gcc -E -P -v -dD "${plugin_state_location}/specs.c"'" command="sh" useDefault="true"/> +<parser enabled="true"/> +</scannerInfoProvider> +</profile> +<profile id="org.eclipse.cdt.managedbuilder.xlc.core.XLCManagedMakePerProjectProfile"> +<buildOutputProvider> +<openAction enabled="false" filePath=""/> +<parser enabled="false"/> +</buildOutputProvider> +<scannerInfoProvider id="specsFile"> +<runAction arguments="-E -v ${plugin_state_location}/${specs_file}" command="${XL_compilerRoot}/xlc" useDefault="true"/> +<parser enabled="true"/> +</scannerInfoProvider> +</profile> +<profile id="org.eclipse.cdt.managedbuilder.xlc.core.XLCManagedMakePerProjectProfileCPP"> +<buildOutputProvider> +<openAction enabled="false" filePath=""/> +<parser enabled="false"/> +</buildOutputProvider> +<scannerInfoProvider id="specsFile"> +<runAction arguments="-E -v ${plugin_state_location}/${specs_file}" command="${XL_compilerRoot}/xlC" useDefault="true"/> +<parser enabled="true"/> +</scannerInfoProvider> +</profile> +<scannerConfigBuildInfo instanceId="cdt.managedbuild.config.gnu.mingw.exe.release.369958126;cdt.managedbuild.config.gnu.mingw.exe.release.369958126.;cdt.managedbuild.tool.gnu.c.compiler.mingw.exe.release.1960648874;cdt.managedbuild.tool.gnu.c.compiler.input.425612201"> +<autodiscovery enabled="true" problemReportingEnabled="true" selectedProfileId="org.eclipse.cdt.managedbuilder.core.GCCManagedMakePerProjectProfileC"/> +<profile id="org.eclipse.cdt.make.core.GCCStandardMakePerProjectProfile"> +<buildOutputProvider> +<openAction enabled="true" filePath=""/> +<parser enabled="true"/> +</buildOutputProvider> +<scannerInfoProvider id="specsFile"> +<runAction arguments="-E -P -v -dD ${plugin_state_location}/${specs_file}" command="gcc" useDefault="true"/> +<parser enabled="true"/> +</scannerInfoProvider> +</profile> +<profile id="org.eclipse.cdt.make.core.GCCStandardMakePerFileProfile"> +<buildOutputProvider> +<openAction enabled="true" filePath=""/> +<parser enabled="true"/> +</buildOutputProvider> +<scannerInfoProvider id="makefileGenerator"> +<runAction arguments="-f ${project_name}_scd.mk" command="make" useDefault="true"/> +<parser enabled="true"/> +</scannerInfoProvider> +</profile> +<profile id="org.eclipse.cdt.managedbuilder.core.GCCManagedMakePerProjectProfile"> +<buildOutputProvider> +<openAction enabled="true" filePath=""/> +<parser enabled="true"/> +</buildOutputProvider> +<scannerInfoProvider id="specsFile"> +<runAction arguments="-E -P -v -dD ${plugin_state_location}/${specs_file}" command="gcc" useDefault="true"/> +<parser enabled="true"/> +</scannerInfoProvider> +</profile> +<profile id="org.eclipse.cdt.managedbuilder.core.GCCManagedMakePerProjectProfileCPP"> +<buildOutputProvider> +<openAction enabled="true" filePath=""/> +<parser enabled="true"/> +</buildOutputProvider> +<scannerInfoProvider id="specsFile"> +<runAction arguments="-E -P -v -dD ${plugin_state_location}/specs.cpp" command="g++" useDefault="true"/> +<parser enabled="true"/> +</scannerInfoProvider> +</profile> +<profile id="org.eclipse.cdt.managedbuilder.core.GCCManagedMakePerProjectProfileC"> +<buildOutputProvider> +<openAction enabled="true" filePath=""/> +<parser enabled="true"/> +</buildOutputProvider> +<scannerInfoProvider id="specsFile"> +<runAction arguments="-E -P -v -dD ${plugin_state_location}/specs.c" command="gcc" useDefault="true"/> +<parser enabled="true"/> +</scannerInfoProvider> +</profile> +<profile id="org.eclipse.cdt.managedbuilder.core.GCCWinManagedMakePerProjectProfile"> +<buildOutputProvider> +<openAction enabled="true" filePath=""/> +<parser enabled="true"/> +</buildOutputProvider> +<scannerInfoProvider id="specsFile"> +<runAction arguments="-c 'gcc -E -P -v -dD "${plugin_state_location}/${specs_file}"'" command="sh" useDefault="true"/> +<parser enabled="true"/> +</scannerInfoProvider> +</profile> +<profile id="org.eclipse.cdt.managedbuilder.core.GCCWinManagedMakePerProjectProfileCPP"> +<buildOutputProvider> +<openAction enabled="true" filePath=""/> +<parser enabled="true"/> +</buildOutputProvider> +<scannerInfoProvider id="specsFile"> +<runAction arguments="-c 'g++ -E -P -v -dD "${plugin_state_location}/specs.cpp"'" command="sh" useDefault="true"/> +<parser enabled="true"/> +</scannerInfoProvider> +</profile> +<profile id="org.eclipse.cdt.managedbuilder.core.GCCWinManagedMakePerProjectProfileC"> +<buildOutputProvider> +<openAction enabled="true" filePath=""/> +<parser enabled="true"/> +</buildOutputProvider> +<scannerInfoProvider id="specsFile"> +<runAction arguments="-c 'gcc -E -P -v -dD "${plugin_state_location}/specs.c"'" command="sh" useDefault="true"/> +<parser enabled="true"/> +</scannerInfoProvider> +</profile> +<profile id="org.eclipse.cdt.managedbuilder.xlc.core.XLCManagedMakePerProjectProfile"> +<buildOutputProvider> +<openAction enabled="false" filePath=""/> +<parser enabled="false"/> +</buildOutputProvider> +<scannerInfoProvider id="specsFile"> +<runAction arguments="-E -v ${plugin_state_location}/${specs_file}" command="${XL_compilerRoot}/xlc" useDefault="true"/> +<parser enabled="true"/> +</scannerInfoProvider> +</profile> +<profile id="org.eclipse.cdt.managedbuilder.xlc.core.XLCManagedMakePerProjectProfileCPP"> +<buildOutputProvider> +<openAction enabled="false" filePath=""/> +<parser enabled="false"/> +</buildOutputProvider> +<scannerInfoProvider id="specsFile"> +<runAction arguments="-E -v ${plugin_state_location}/${specs_file}" command="${XL_compilerRoot}/xlC" useDefault="true"/> +<parser enabled="true"/> +</scannerInfoProvider> +</profile> +</scannerConfigBuildInfo> +<scannerConfigBuildInfo instanceId="cdt.managedbuild.config.gnu.mingw.exe.debug.1794257183;cdt.managedbuild.config.gnu.mingw.exe.debug.1794257183.;cdt.managedbuild.tool.gnu.cpp.compiler.mingw.exe.debug.690373895;cdt.managedbuild.tool.gnu.cpp.compiler.input.881392952"> +<autodiscovery enabled="true" problemReportingEnabled="true" selectedProfileId="org.eclipse.cdt.managedbuilder.core.GCCManagedMakePerProjectProfileCPP"/> +<profile id="org.eclipse.cdt.make.core.GCCStandardMakePerProjectProfile"> +<buildOutputProvider> +<openAction enabled="true" filePath=""/> +<parser enabled="true"/> +</buildOutputProvider> +<scannerInfoProvider id="specsFile"> +<runAction arguments="-E -P -v -dD ${plugin_state_location}/${specs_file}" command="gcc" useDefault="true"/> +<parser enabled="true"/> +</scannerInfoProvider> +</profile> +<profile id="org.eclipse.cdt.make.core.GCCStandardMakePerFileProfile"> +<buildOutputProvider> +<openAction enabled="true" filePath=""/> +<parser enabled="true"/> +</buildOutputProvider> +<scannerInfoProvider id="makefileGenerator"> +<runAction arguments="-f ${project_name}_scd.mk" command="make" useDefault="true"/> +<parser enabled="true"/> +</scannerInfoProvider> +</profile> +<profile id="org.eclipse.cdt.managedbuilder.core.GCCManagedMakePerProjectProfile"> +<buildOutputProvider> +<openAction enabled="true" filePath=""/> +<parser enabled="true"/> +</buildOutputProvider> +<scannerInfoProvider id="specsFile"> +<runAction arguments="-E -P -v -dD ${plugin_state_location}/${specs_file}" command="gcc" useDefault="true"/> +<parser enabled="true"/> +</scannerInfoProvider> +</profile> +<profile id="org.eclipse.cdt.managedbuilder.core.GCCManagedMakePerProjectProfileCPP"> +<buildOutputProvider> +<openAction enabled="true" filePath=""/> +<parser enabled="true"/> +</buildOutputProvider> +<scannerInfoProvider id="specsFile"> +<runAction arguments="-E -P -v -dD ${plugin_state_location}/specs.cpp" command="g++" useDefault="true"/> +<parser enabled="true"/> +</scannerInfoProvider> +</profile> +<profile id="org.eclipse.cdt.managedbuilder.core.GCCManagedMakePerProjectProfileC"> +<buildOutputProvider> +<openAction enabled="true" filePath=""/> +<parser enabled="true"/> +</buildOutputProvider> +<scannerInfoProvider id="specsFile"> +<runAction arguments="-E -P -v -dD ${plugin_state_location}/specs.c" command="gcc" useDefault="true"/> +<parser enabled="true"/> +</scannerInfoProvider> +</profile> +<profile id="org.eclipse.cdt.managedbuilder.core.GCCWinManagedMakePerProjectProfile"> +<buildOutputProvider> +<openAction enabled="true" filePath=""/> +<parser enabled="true"/> +</buildOutputProvider> +<scannerInfoProvider id="specsFile"> +<runAction arguments="-c 'gcc -E -P -v -dD "${plugin_state_location}/${specs_file}"'" command="sh" useDefault="true"/> +<parser enabled="true"/> +</scannerInfoProvider> +</profile> +<profile id="org.eclipse.cdt.managedbuilder.core.GCCWinManagedMakePerProjectProfileCPP"> +<buildOutputProvider> +<openAction enabled="true" filePath=""/> +<parser enabled="true"/> +</buildOutputProvider> +<scannerInfoProvider id="specsFile"> +<runAction arguments="-c 'g++ -E -P -v -dD "${plugin_state_location}/specs.cpp"'" command="sh" useDefault="true"/> +<parser enabled="true"/> +</scannerInfoProvider> +</profile> +<profile id="org.eclipse.cdt.managedbuilder.core.GCCWinManagedMakePerProjectProfileC"> +<buildOutputProvider> +<openAction enabled="true" filePath=""/> +<parser enabled="true"/> +</buildOutputProvider> +<scannerInfoProvider id="specsFile"> +<runAction arguments="-c 'gcc -E -P -v -dD "${plugin_state_location}/specs.c"'" command="sh" useDefault="true"/> +<parser enabled="true"/> +</scannerInfoProvider> +</profile> +<profile id="org.eclipse.cdt.managedbuilder.xlc.core.XLCManagedMakePerProjectProfile"> +<buildOutputProvider> +<openAction enabled="false" filePath=""/> +<parser enabled="false"/> +</buildOutputProvider> +<scannerInfoProvider id="specsFile"> +<runAction arguments="-E -v ${plugin_state_location}/${specs_file}" command="${XL_compilerRoot}/xlc" useDefault="true"/> +<parser enabled="true"/> +</scannerInfoProvider> +</profile> +<profile id="org.eclipse.cdt.managedbuilder.xlc.core.XLCManagedMakePerProjectProfileCPP"> +<buildOutputProvider> +<openAction enabled="false" filePath=""/> +<parser enabled="false"/> +</buildOutputProvider> +<scannerInfoProvider id="specsFile"> +<runAction arguments="-E -v ${plugin_state_location}/${specs_file}" command="${XL_compilerRoot}/xlC" useDefault="true"/> +<parser enabled="true"/> +</scannerInfoProvider> +</profile> +</scannerConfigBuildInfo> +<scannerConfigBuildInfo instanceId="cdt.managedbuild.config.gnu.mingw.exe.release.369958126;cdt.managedbuild.config.gnu.mingw.exe.release.369958126.;cdt.managedbuild.tool.gnu.cpp.compiler.mingw.exe.release.1039220343;cdt.managedbuild.tool.gnu.cpp.compiler.input.394920570"> +<autodiscovery enabled="true" problemReportingEnabled="true" selectedProfileId="org.eclipse.cdt.managedbuilder.core.GCCManagedMakePerProjectProfileCPP"/> +<profile id="org.eclipse.cdt.make.core.GCCStandardMakePerProjectProfile"> +<buildOutputProvider> +<openAction enabled="true" filePath=""/> +<parser enabled="true"/> +</buildOutputProvider> +<scannerInfoProvider id="specsFile"> +<runAction arguments="-E -P -v -dD ${plugin_state_location}/${specs_file}" command="gcc" useDefault="true"/> +<parser enabled="true"/> +</scannerInfoProvider> +</profile> +<profile id="org.eclipse.cdt.make.core.GCCStandardMakePerFileProfile"> +<buildOutputProvider> +<openAction enabled="true" filePath=""/> +<parser enabled="true"/> +</buildOutputProvider> +<scannerInfoProvider id="makefileGenerator"> +<runAction arguments="-f ${project_name}_scd.mk" command="make" useDefault="true"/> +<parser enabled="true"/> +</scannerInfoProvider> +</profile> +<profile id="org.eclipse.cdt.managedbuilder.core.GCCManagedMakePerProjectProfile"> +<buildOutputProvider> +<openAction enabled="true" filePath=""/> +<parser enabled="true"/> +</buildOutputProvider> +<scannerInfoProvider id="specsFile"> +<runAction arguments="-E -P -v -dD ${plugin_state_location}/${specs_file}" command="gcc" useDefault="true"/> +<parser enabled="true"/> +</scannerInfoProvider> +</profile> +<profile id="org.eclipse.cdt.managedbuilder.core.GCCManagedMakePerProjectProfileCPP"> +<buildOutputProvider> +<openAction enabled="true" filePath=""/> +<parser enabled="true"/> +</buildOutputProvider> +<scannerInfoProvider id="specsFile"> +<runAction arguments="-E -P -v -dD ${plugin_state_location}/specs.cpp" command="g++" useDefault="true"/> +<parser enabled="true"/> +</scannerInfoProvider> +</profile> +<profile id="org.eclipse.cdt.managedbuilder.core.GCCManagedMakePerProjectProfileC"> +<buildOutputProvider> +<openAction enabled="true" filePath=""/> +<parser enabled="true"/> +</buildOutputProvider> +<scannerInfoProvider id="specsFile"> +<runAction arguments="-E -P -v -dD ${plugin_state_location}/specs.c" command="gcc" useDefault="true"/> +<parser enabled="true"/> +</scannerInfoProvider> +</profile> +<profile id="org.eclipse.cdt.managedbuilder.core.GCCWinManagedMakePerProjectProfile"> +<buildOutputProvider> +<openAction enabled="true" filePath=""/> +<parser enabled="true"/> +</buildOutputProvider> +<scannerInfoProvider id="specsFile"> +<runAction arguments="-c 'gcc -E -P -v -dD "${plugin_state_location}/${specs_file}"'" command="sh" useDefault="true"/> +<parser enabled="true"/> +</scannerInfoProvider> +</profile> +<profile id="org.eclipse.cdt.managedbuilder.core.GCCWinManagedMakePerProjectProfileCPP"> +<buildOutputProvider> +<openAction enabled="true" filePath=""/> +<parser enabled="true"/> +</buildOutputProvider> +<scannerInfoProvider id="specsFile"> +<runAction arguments="-c 'g++ -E -P -v -dD "${plugin_state_location}/specs.cpp"'" command="sh" useDefault="true"/> +<parser enabled="true"/> +</scannerInfoProvider> +</profile> +<profile id="org.eclipse.cdt.managedbuilder.core.GCCWinManagedMakePerProjectProfileC"> +<buildOutputProvider> +<openAction enabled="true" filePath=""/> +<parser enabled="true"/> +</buildOutputProvider> +<scannerInfoProvider id="specsFile"> +<runAction arguments="-c 'gcc -E -P -v -dD "${plugin_state_location}/specs.c"'" command="sh" useDefault="true"/> +<parser enabled="true"/> +</scannerInfoProvider> +</profile> +<profile id="org.eclipse.cdt.managedbuilder.xlc.core.XLCManagedMakePerProjectProfile"> +<buildOutputProvider> +<openAction enabled="false" filePath=""/> +<parser enabled="false"/> +</buildOutputProvider> +<scannerInfoProvider id="specsFile"> +<runAction arguments="-E -v ${plugin_state_location}/${specs_file}" command="${XL_compilerRoot}/xlc" useDefault="true"/> +<parser enabled="true"/> +</scannerInfoProvider> +</profile> +<profile id="org.eclipse.cdt.managedbuilder.xlc.core.XLCManagedMakePerProjectProfileCPP"> +<buildOutputProvider> +<openAction enabled="false" filePath=""/> +<parser enabled="false"/> +</buildOutputProvider> +<scannerInfoProvider id="specsFile"> +<runAction arguments="-E -v ${plugin_state_location}/${specs_file}" command="${XL_compilerRoot}/xlC" useDefault="true"/> +<parser enabled="true"/> +</scannerInfoProvider> +</profile> +</scannerConfigBuildInfo> +<scannerConfigBuildInfo instanceId="cdt.managedbuild.config.gnu.mingw.exe.debug.1794257183;cdt.managedbuild.config.gnu.mingw.exe.debug.1794257183.;cdt.managedbuild.tool.gnu.c.compiler.mingw.exe.debug.1406350564;cdt.managedbuild.tool.gnu.c.compiler.input.2072174392"> +<autodiscovery enabled="true" problemReportingEnabled="true" selectedProfileId="org.eclipse.cdt.managedbuilder.core.GCCManagedMakePerProjectProfileC"/> +<profile id="org.eclipse.cdt.make.core.GCCStandardMakePerProjectProfile"> +<buildOutputProvider> +<openAction enabled="true" filePath=""/> +<parser enabled="true"/> +</buildOutputProvider> +<scannerInfoProvider id="specsFile"> +<runAction arguments="-E -P -v -dD ${plugin_state_location}/${specs_file}" command="gcc" useDefault="true"/> +<parser enabled="true"/> +</scannerInfoProvider> +</profile> +<profile id="org.eclipse.cdt.make.core.GCCStandardMakePerFileProfile"> +<buildOutputProvider> +<openAction enabled="true" filePath=""/> +<parser enabled="true"/> +</buildOutputProvider> +<scannerInfoProvider id="makefileGenerator"> +<runAction arguments="-f ${project_name}_scd.mk" command="make" useDefault="true"/> +<parser enabled="true"/> +</scannerInfoProvider> +</profile> +<profile id="org.eclipse.cdt.managedbuilder.core.GCCManagedMakePerProjectProfile"> +<buildOutputProvider> +<openAction enabled="true" filePath=""/> +<parser enabled="true"/> +</buildOutputProvider> +<scannerInfoProvider id="specsFile"> +<runAction arguments="-E -P -v -dD ${plugin_state_location}/${specs_file}" command="gcc" useDefault="true"/> +<parser enabled="true"/> +</scannerInfoProvider> +</profile> +<profile id="org.eclipse.cdt.managedbuilder.core.GCCManagedMakePerProjectProfileCPP"> +<buildOutputProvider> +<openAction enabled="true" filePath=""/> +<parser enabled="true"/> +</buildOutputProvider> +<scannerInfoProvider id="specsFile"> +<runAction arguments="-E -P -v -dD ${plugin_state_location}/specs.cpp" command="g++" useDefault="true"/> +<parser enabled="true"/> +</scannerInfoProvider> +</profile> +<profile id="org.eclipse.cdt.managedbuilder.core.GCCManagedMakePerProjectProfileC"> +<buildOutputProvider> +<openAction enabled="true" filePath=""/> +<parser enabled="true"/> +</buildOutputProvider> +<scannerInfoProvider id="specsFile"> +<runAction arguments="-E -P -v -dD ${plugin_state_location}/specs.c" command="gcc" useDefault="true"/> +<parser enabled="true"/> +</scannerInfoProvider> +</profile> +<profile id="org.eclipse.cdt.managedbuilder.core.GCCWinManagedMakePerProjectProfile"> +<buildOutputProvider> +<openAction enabled="true" filePath=""/> +<parser enabled="true"/> +</buildOutputProvider> +<scannerInfoProvider id="specsFile"> +<runAction arguments="-c 'gcc -E -P -v -dD "${plugin_state_location}/${specs_file}"'" command="sh" useDefault="true"/> +<parser enabled="true"/> +</scannerInfoProvider> +</profile> +<profile id="org.eclipse.cdt.managedbuilder.core.GCCWinManagedMakePerProjectProfileCPP"> +<buildOutputProvider> +<openAction enabled="true" filePath=""/> +<parser enabled="true"/> +</buildOutputProvider> +<scannerInfoProvider id="specsFile"> +<runAction arguments="-c 'g++ -E -P -v -dD "${plugin_state_location}/specs.cpp"'" command="sh" useDefault="true"/> +<parser enabled="true"/> +</scannerInfoProvider> +</profile> +<profile id="org.eclipse.cdt.managedbuilder.core.GCCWinManagedMakePerProjectProfileC"> +<buildOutputProvider> +<openAction enabled="true" filePath=""/> +<parser enabled="true"/> +</buildOutputProvider> +<scannerInfoProvider id="specsFile"> +<runAction arguments="-c 'gcc -E -P -v -dD "${plugin_state_location}/specs.c"'" command="sh" useDefault="true"/> +<parser enabled="true"/> +</scannerInfoProvider> +</profile> +<profile id="org.eclipse.cdt.managedbuilder.xlc.core.XLCManagedMakePerProjectProfile"> +<buildOutputProvider> +<openAction enabled="false" filePath=""/> +<parser enabled="false"/> +</buildOutputProvider> +<scannerInfoProvider id="specsFile"> +<runAction arguments="-E -v ${plugin_state_location}/${specs_file}" command="${XL_compilerRoot}/xlc" useDefault="true"/> +<parser enabled="true"/> +</scannerInfoProvider> +</profile> +<profile id="org.eclipse.cdt.managedbuilder.xlc.core.XLCManagedMakePerProjectProfileCPP"> +<buildOutputProvider> +<openAction enabled="false" filePath=""/> +<parser enabled="false"/> +</buildOutputProvider> +<scannerInfoProvider id="specsFile"> +<runAction arguments="-E -v ${plugin_state_location}/${specs_file}" command="${XL_compilerRoot}/xlC" useDefault="true"/> +<parser enabled="true"/> +</scannerInfoProvider> +</profile> +</scannerConfigBuildInfo> +</storageModule> +<storageModule moduleId="org.eclipse.cdt.core.externalSettings"/> +<storageModule moduleId="org.eclipse.cdt.core.language.mapping"/> +<storageModule moduleId="org.eclipse.cdt.internal.ui.text.commentOwnerProjectMappings"/> +<storageModule moduleId="org.eclipse.cdt.make.core.buildtargets"/> +</cconfiguration> +<cconfiguration id="cdt.managedbuild.config.gnu.mingw.exe.release.369958126"> +<storageModule buildSystemId="org.eclipse.cdt.managedbuilder.core.configurationDataProvider" id="cdt.managedbuild.config.gnu.mingw.exe.release.369958126" moduleId="org.eclipse.cdt.core.settings" name="Release"> +<externalSettings/> +<extensions> +<extension id="org.eclipse.cdt.core.PE" point="org.eclipse.cdt.core.BinaryParser"/> +<extension id="org.eclipse.cdt.core.GCCErrorParser" point="org.eclipse.cdt.core.ErrorParser"/> +<extension id="org.eclipse.cdt.core.GASErrorParser" point="org.eclipse.cdt.core.ErrorParser"/> +<extension id="org.eclipse.cdt.core.GLDErrorParser" point="org.eclipse.cdt.core.ErrorParser"/> +</extensions> +</storageModule> +<storageModule moduleId="cdtBuildSystem" version="4.0.0"> +<configuration artifactName="vision" buildArtefactType="org.eclipse.cdt.build.core.buildArtefactType.exe" buildProperties="org.eclipse.cdt.build.core.buildType=org.eclipse.cdt.build.core.buildType.release,org.eclipse.cdt.build.core.buildArtefactType=org.eclipse.cdt.build.core.buildArtefactType.exe" cleanCommand="rm -rf" description="" id="cdt.managedbuild.config.gnu.mingw.exe.release.369958126" name="Release" parent="cdt.managedbuild.config.gnu.mingw.exe.release"> +<folderInfo id="cdt.managedbuild.config.gnu.mingw.exe.release.369958126." name="/" resourcePath=""> +<toolChain id="cdt.managedbuild.toolchain.gnu.mingw.exe.release.888375786" name="MinGW GCC" superClass="cdt.managedbuild.toolchain.gnu.mingw.exe.release"> +<targetPlatform id="cdt.managedbuild.target.gnu.platform.mingw.exe.release.1315511489" name="Debug Platform" superClass="cdt.managedbuild.target.gnu.platform.mingw.exe.release"/> +<builder buildPath="${workspace_loc:/vision/Release}" id="cdt.managedbuild.tool.gnu.builder.mingw.base.110972834" keepEnvironmentInBuildfile="false" managedBuildOn="true" name="CDT Internal Builder" superClass="cdt.managedbuild.tool.gnu.builder.mingw.base"/> +<tool command="as" commandLinePattern="${COMMAND} ${FLAGS} ${OUTPUT_FLAG}${OUTPUT_PREFIX}${OUTPUT} ${INPUTS}" id="cdt.managedbuild.tool.gnu.assembler.mingw.exe.release.2086243688" name="GCC Assembler" superClass="cdt.managedbuild.tool.gnu.assembler.mingw.exe.release"> +<inputType id="cdt.managedbuild.tool.gnu.assembler.input.1712840500" superClass="cdt.managedbuild.tool.gnu.assembler.input"/> +</tool> +<tool id="cdt.managedbuild.tool.gnu.archiver.mingw.base.651087879" name="GCC Archiver" superClass="cdt.managedbuild.tool.gnu.archiver.mingw.base"/> +<tool id="cdt.managedbuild.tool.gnu.cpp.compiler.mingw.exe.release.1039220343" name="GCC C++ Compiler" superClass="cdt.managedbuild.tool.gnu.cpp.compiler.mingw.exe.release"> +<option id="gnu.cpp.compiler.mingw.exe.release.option.optimization.level.630178120" name="Optimization Level" superClass="gnu.cpp.compiler.mingw.exe.release.option.optimization.level" value="gnu.cpp.compiler.optimization.level.most" valueType="enumerated"/> +<option id="gnu.cpp.compiler.mingw.exe.release.option.debugging.level.1662296820" name="Debug Level" superClass="gnu.cpp.compiler.mingw.exe.release.option.debugging.level" value="gnu.cpp.compiler.debugging.level.none" valueType="enumerated"/> +<option id="gnu.cpp.compiler.option.include.paths.1558332788" superClass="gnu.cpp.compiler.option.include.paths" valueType="includePath"> +<listOptionValue builtIn="false" value=""C:\OpenCV2.1\include\opencv""/> +</option> +<inputType id="cdt.managedbuild.tool.gnu.cpp.compiler.input.394920570" superClass="cdt.managedbuild.tool.gnu.cpp.compiler.input"/> +</tool> +<tool id="cdt.managedbuild.tool.gnu.c.compiler.mingw.exe.release.1960648874" name="GCC C Compiler" superClass="cdt.managedbuild.tool.gnu.c.compiler.mingw.exe.release"> +<option defaultValue="gnu.c.optimization.level.most" id="gnu.c.compiler.mingw.exe.release.option.optimization.level.201552392" name="Optimization Level" superClass="gnu.c.compiler.mingw.exe.release.option.optimization.level" valueType="enumerated"/> +<option id="gnu.c.compiler.mingw.exe.release.option.debugging.level.89770317" name="Debug Level" superClass="gnu.c.compiler.mingw.exe.release.option.debugging.level" value="gnu.c.debugging.level.none" valueType="enumerated"/> +<option id="gnu.c.compiler.option.include.paths.1683514941" superClass="gnu.c.compiler.option.include.paths" valueType="includePath"> +<listOptionValue builtIn="false" value=""C:\OpenCV2.1\include\opencv""/> +</option> +<inputType id="cdt.managedbuild.tool.gnu.c.compiler.input.425612201" superClass="cdt.managedbuild.tool.gnu.c.compiler.input"/> +</tool> +<tool id="cdt.managedbuild.tool.gnu.c.linker.mingw.exe.release.1609582156" name="MinGW C Linker" superClass="cdt.managedbuild.tool.gnu.c.linker.mingw.exe.release"/> +<tool id="cdt.managedbuild.tool.gnu.cpp.linker.mingw.exe.release.1364150050" name="MinGW C++ Linker" superClass="cdt.managedbuild.tool.gnu.cpp.linker.mingw.exe.release"> +<option id="gnu.cpp.link.option.libs.1043700432" superClass="gnu.cpp.link.option.libs" valueType="libs"> +<listOptionValue builtIn="false" value="cv210"/> +<listOptionValue builtIn="false" value="cvaux210"/> +<listOptionValue builtIn="false" value="cxcore210"/> +<listOptionValue builtIn="false" value="highgui210"/> +<listOptionValue builtIn="false" value="ml210"/> +</option> +<option id="gnu.cpp.link.option.paths.452181845" superClass="gnu.cpp.link.option.paths" valueType="libPaths"> +<listOptionValue builtIn="false" value=""C:\OpenCV2.1\bin""/> +</option> +<inputType id="cdt.managedbuild.tool.gnu.cpp.linker.input.162577737" superClass="cdt.managedbuild.tool.gnu.cpp.linker.input"> +<additionalInput kind="additionalinputdependency" paths="$(USER_OBJS)"/> +<additionalInput kind="additionalinput" paths="$(LIBS)"/> +</inputType> +</tool> +</toolChain> +</folderInfo> +<sourceEntries> +<entry excluding="src" flags="VALUE_WORKSPACE_PATH|RESOLVED" kind="sourcePath" name=""/> +<entry flags="VALUE_WORKSPACE_PATH|RESOLVED" kind="sourcePath" name="src"/> +</sourceEntries> +</configuration> +</storageModule> +<storageModule moduleId="scannerConfiguration"> +<autodiscovery enabled="true" problemReportingEnabled="true" selectedProfileId="org.eclipse.cdt.make.core.GCCStandardMakePerProjectProfile"/> +<profile id="org.eclipse.cdt.make.core.GCCStandardMakePerProjectProfile"> +<buildOutputProvider> +<openAction enabled="true" filePath=""/> +<parser enabled="true"/> +</buildOutputProvider> +<scannerInfoProvider id="specsFile"> +<runAction arguments="-E -P -v -dD ${plugin_state_location}/${specs_file}" command="gcc" useDefault="true"/> +<parser enabled="true"/> +</scannerInfoProvider> +</profile> +<profile id="org.eclipse.cdt.make.core.GCCStandardMakePerFileProfile"> +<buildOutputProvider> +<openAction enabled="true" filePath=""/> +<parser enabled="true"/> +</buildOutputProvider> +<scannerInfoProvider id="makefileGenerator"> +<runAction arguments="-f ${project_name}_scd.mk" command="make" useDefault="true"/> +<parser enabled="true"/> +</scannerInfoProvider> +</profile> +<profile id="org.eclipse.cdt.managedbuilder.core.GCCManagedMakePerProjectProfile"> +<buildOutputProvider> +<openAction enabled="true" filePath=""/> +<parser enabled="true"/> +</buildOutputProvider> +<scannerInfoProvider id="specsFile"> +<runAction arguments="-E -P -v -dD ${plugin_state_location}/${specs_file}" command="gcc" useDefault="true"/> +<parser enabled="true"/> +</scannerInfoProvider> +</profile> +<profile id="org.eclipse.cdt.managedbuilder.core.GCCManagedMakePerProjectProfileCPP"> +<buildOutputProvider> +<openAction enabled="true" filePath=""/> +<parser enabled="true"/> +</buildOutputProvider> +<scannerInfoProvider id="specsFile"> +<runAction arguments="-E -P -v -dD ${plugin_state_location}/specs.cpp" command="g++" useDefault="true"/> +<parser enabled="true"/> +</scannerInfoProvider> +</profile> +<profile id="org.eclipse.cdt.managedbuilder.core.GCCManagedMakePerProjectProfileC"> +<buildOutputProvider> +<openAction enabled="true" filePath=""/> +<parser enabled="true"/> +</buildOutputProvider> +<scannerInfoProvider id="specsFile"> +<runAction arguments="-E -P -v -dD ${plugin_state_location}/specs.c" command="gcc" useDefault="true"/> +<parser enabled="true"/> +</scannerInfoProvider> +</profile> +<profile id="org.eclipse.cdt.managedbuilder.core.GCCWinManagedMakePerProjectProfile"> +<buildOutputProvider> +<openAction enabled="true" filePath=""/> +<parser enabled="true"/> +</buildOutputProvider> +<scannerInfoProvider id="specsFile"> +<runAction arguments="-c 'gcc -E -P -v -dD "${plugin_state_location}/${specs_file}"'" command="sh" useDefault="true"/> +<parser enabled="true"/> +</scannerInfoProvider> +</profile> +<profile id="org.eclipse.cdt.managedbuilder.core.GCCWinManagedMakePerProjectProfileCPP"> +<buildOutputProvider> +<openAction enabled="true" filePath=""/> +<parser enabled="true"/> +</buildOutputProvider> +<scannerInfoProvider id="specsFile"> +<runAction arguments="-c 'g++ -E -P -v -dD "${plugin_state_location}/specs.cpp"'" command="sh" useDefault="true"/> +<parser enabled="true"/> +</scannerInfoProvider> +</profile> +<profile id="org.eclipse.cdt.managedbuilder.core.GCCWinManagedMakePerProjectProfileC"> +<buildOutputProvider> +<openAction enabled="true" filePath=""/> +<parser enabled="true"/> +</buildOutputProvider> +<scannerInfoProvider id="specsFile"> +<runAction arguments="-c 'gcc -E -P -v -dD "${plugin_state_location}/specs.c"'" command="sh" useDefault="true"/> +<parser enabled="true"/> +</scannerInfoProvider> +</profile> +<profile id="org.eclipse.cdt.managedbuilder.xlc.core.XLCManagedMakePerProjectProfile"> +<buildOutputProvider> +<openAction enabled="false" filePath=""/> +<parser enabled="false"/> +</buildOutputProvider> +<scannerInfoProvider id="specsFile"> +<runAction arguments="-E -v ${plugin_state_location}/${specs_file}" command="${XL_compilerRoot}/xlc" useDefault="true"/> +<parser enabled="true"/> +</scannerInfoProvider> +</profile> +<profile id="org.eclipse.cdt.managedbuilder.xlc.core.XLCManagedMakePerProjectProfileCPP"> +<buildOutputProvider> +<openAction enabled="false" filePath=""/> +<parser enabled="false"/> +</buildOutputProvider> +<scannerInfoProvider id="specsFile"> +<runAction arguments="-E -v ${plugin_state_location}/${specs_file}" command="${XL_compilerRoot}/xlC" useDefault="true"/> +<parser enabled="true"/> +</scannerInfoProvider> +</profile> +<scannerConfigBuildInfo instanceId="cdt.managedbuild.config.gnu.mingw.exe.release.369958126;cdt.managedbuild.config.gnu.mingw.exe.release.369958126.;cdt.managedbuild.tool.gnu.c.compiler.mingw.exe.release.1960648874;cdt.managedbuild.tool.gnu.c.compiler.input.425612201"> +<autodiscovery enabled="true" problemReportingEnabled="true" selectedProfileId="org.eclipse.cdt.managedbuilder.core.GCCManagedMakePerProjectProfileC"/> +<profile id="org.eclipse.cdt.make.core.GCCStandardMakePerProjectProfile"> +<buildOutputProvider> +<openAction enabled="true" filePath=""/> +<parser enabled="true"/> +</buildOutputProvider> +<scannerInfoProvider id="specsFile"> +<runAction arguments="-E -P -v -dD ${plugin_state_location}/${specs_file}" command="gcc" useDefault="true"/> +<parser enabled="true"/> +</scannerInfoProvider> +</profile> +<profile id="org.eclipse.cdt.make.core.GCCStandardMakePerFileProfile"> +<buildOutputProvider> +<openAction enabled="true" filePath=""/> +<parser enabled="true"/> +</buildOutputProvider> +<scannerInfoProvider id="makefileGenerator"> +<runAction arguments="-f ${project_name}_scd.mk" command="make" useDefault="true"/> +<parser enabled="true"/> +</scannerInfoProvider> +</profile> +<profile id="org.eclipse.cdt.managedbuilder.core.GCCManagedMakePerProjectProfile"> +<buildOutputProvider> +<openAction enabled="true" filePath=""/> +<parser enabled="true"/> +</buildOutputProvider> +<scannerInfoProvider id="specsFile"> +<runAction arguments="-E -P -v -dD ${plugin_state_location}/${specs_file}" command="gcc" useDefault="true"/> +<parser enabled="true"/> +</scannerInfoProvider> +</profile> +<profile id="org.eclipse.cdt.managedbuilder.core.GCCManagedMakePerProjectProfileCPP"> +<buildOutputProvider> +<openAction enabled="true" filePath=""/> +<parser enabled="true"/> +</buildOutputProvider> +<scannerInfoProvider id="specsFile"> +<runAction arguments="-E -P -v -dD ${plugin_state_location}/specs.cpp" command="g++" useDefault="true"/> +<parser enabled="true"/> +</scannerInfoProvider> +</profile> +<profile id="org.eclipse.cdt.managedbuilder.core.GCCManagedMakePerProjectProfileC"> +<buildOutputProvider> +<openAction enabled="true" filePath=""/> +<parser enabled="true"/> +</buildOutputProvider> +<scannerInfoProvider id="specsFile"> +<runAction arguments="-E -P -v -dD ${plugin_state_location}/specs.c" command="gcc" useDefault="true"/> +<parser enabled="true"/> +</scannerInfoProvider> +</profile> +<profile id="org.eclipse.cdt.managedbuilder.core.GCCWinManagedMakePerProjectProfile"> +<buildOutputProvider> +<openAction enabled="true" filePath=""/> +<parser enabled="true"/> +</buildOutputProvider> +<scannerInfoProvider id="specsFile"> +<runAction arguments="-c 'gcc -E -P -v -dD "${plugin_state_location}/${specs_file}"'" command="sh" useDefault="true"/> +<parser enabled="true"/> +</scannerInfoProvider> +</profile> +<profile id="org.eclipse.cdt.managedbuilder.core.GCCWinManagedMakePerProjectProfileCPP"> +<buildOutputProvider> +<openAction enabled="true" filePath=""/> +<parser enabled="true"/> +</buildOutputProvider> +<scannerInfoProvider id="specsFile"> +<runAction arguments="-c 'g++ -E -P -v -dD "${plugin_state_location}/specs.cpp"'" command="sh" useDefault="true"/> +<parser enabled="true"/> +</scannerInfoProvider> +</profile> +<profile id="org.eclipse.cdt.managedbuilder.core.GCCWinManagedMakePerProjectProfileC"> +<buildOutputProvider> +<openAction enabled="true" filePath=""/> +<parser enabled="true"/> +</buildOutputProvider> +<scannerInfoProvider id="specsFile"> +<runAction arguments="-c 'gcc -E -P -v -dD "${plugin_state_location}/specs.c"'" command="sh" useDefault="true"/> +<parser enabled="true"/> +</scannerInfoProvider> +</profile> +<profile id="org.eclipse.cdt.managedbuilder.xlc.core.XLCManagedMakePerProjectProfile"> +<buildOutputProvider> +<openAction enabled="false" filePath=""/> +<parser enabled="false"/> +</buildOutputProvider> +<scannerInfoProvider id="specsFile"> +<runAction arguments="-E -v ${plugin_state_location}/${specs_file}" command="${XL_compilerRoot}/xlc" useDefault="true"/> +<parser enabled="true"/> +</scannerInfoProvider> +</profile> +<profile id="org.eclipse.cdt.managedbuilder.xlc.core.XLCManagedMakePerProjectProfileCPP"> +<buildOutputProvider> +<openAction enabled="false" filePath=""/> +<parser enabled="false"/> +</buildOutputProvider> +<scannerInfoProvider id="specsFile"> +<runAction arguments="-E -v ${plugin_state_location}/${specs_file}" command="${XL_compilerRoot}/xlC" useDefault="true"/> +<parser enabled="true"/> +</scannerInfoProvider> +</profile> +</scannerConfigBuildInfo> +<scannerConfigBuildInfo instanceId="cdt.managedbuild.config.gnu.mingw.exe.debug.1794257183;cdt.managedbuild.config.gnu.mingw.exe.debug.1794257183.;cdt.managedbuild.tool.gnu.cpp.compiler.mingw.exe.debug.690373895;cdt.managedbuild.tool.gnu.cpp.compiler.input.881392952"> +<autodiscovery enabled="true" problemReportingEnabled="true" selectedProfileId="org.eclipse.cdt.managedbuilder.core.GCCManagedMakePerProjectProfileCPP"/> +<profile id="org.eclipse.cdt.make.core.GCCStandardMakePerProjectProfile"> +<buildOutputProvider> +<openAction enabled="true" filePath=""/> +<parser enabled="true"/> +</buildOutputProvider> +<scannerInfoProvider id="specsFile"> +<runAction arguments="-E -P -v -dD ${plugin_state_location}/${specs_file}" command="gcc" useDefault="true"/> +<parser enabled="true"/> +</scannerInfoProvider> +</profile> +<profile id="org.eclipse.cdt.make.core.GCCStandardMakePerFileProfile"> +<buildOutputProvider> +<openAction enabled="true" filePath=""/> +<parser enabled="true"/> +</buildOutputProvider> +<scannerInfoProvider id="makefileGenerator"> +<runAction arguments="-f ${project_name}_scd.mk" command="make" useDefault="true"/> +<parser enabled="true"/> +</scannerInfoProvider> +</profile> +<profile id="org.eclipse.cdt.managedbuilder.core.GCCManagedMakePerProjectProfile"> +<buildOutputProvider> +<openAction enabled="true" filePath=""/> +<parser enabled="true"/> +</buildOutputProvider> +<scannerInfoProvider id="specsFile"> +<runAction arguments="-E -P -v -dD ${plugin_state_location}/${specs_file}" command="gcc" useDefault="true"/> +<parser enabled="true"/> +</scannerInfoProvider> +</profile> +<profile id="org.eclipse.cdt.managedbuilder.core.GCCManagedMakePerProjectProfileCPP"> +<buildOutputProvider> +<openAction enabled="true" filePath=""/> +<parser enabled="true"/> +</buildOutputProvider> +<scannerInfoProvider id="specsFile"> +<runAction arguments="-E -P -v -dD ${plugin_state_location}/specs.cpp" command="g++" useDefault="true"/> +<parser enabled="true"/> +</scannerInfoProvider> +</profile> +<profile id="org.eclipse.cdt.managedbuilder.core.GCCManagedMakePerProjectProfileC"> +<buildOutputProvider> +<openAction enabled="true" filePath=""/> +<parser enabled="true"/> +</buildOutputProvider> +<scannerInfoProvider id="specsFile"> +<runAction arguments="-E -P -v -dD ${plugin_state_location}/specs.c" command="gcc" useDefault="true"/> +<parser enabled="true"/> +</scannerInfoProvider> +</profile> +<profile id="org.eclipse.cdt.managedbuilder.core.GCCWinManagedMakePerProjectProfile"> +<buildOutputProvider> +<openAction enabled="true" filePath=""/> +<parser enabled="true"/> +</buildOutputProvider> +<scannerInfoProvider id="specsFile"> +<runAction arguments="-c 'gcc -E -P -v -dD "${plugin_state_location}/${specs_file}"'" command="sh" useDefault="true"/> +<parser enabled="true"/> +</scannerInfoProvider> +</profile> +<profile id="org.eclipse.cdt.managedbuilder.core.GCCWinManagedMakePerProjectProfileCPP"> +<buildOutputProvider> +<openAction enabled="true" filePath=""/> +<parser enabled="true"/> +</buildOutputProvider> +<scannerInfoProvider id="specsFile"> +<runAction arguments="-c 'g++ -E -P -v -dD "${plugin_state_location}/specs.cpp"'" command="sh" useDefault="true"/> +<parser enabled="true"/> +</scannerInfoProvider> +</profile> +<profile id="org.eclipse.cdt.managedbuilder.core.GCCWinManagedMakePerProjectProfileC"> +<buildOutputProvider> +<openAction enabled="true" filePath=""/> +<parser enabled="true"/> +</buildOutputProvider> +<scannerInfoProvider id="specsFile"> +<runAction arguments="-c 'gcc -E -P -v -dD "${plugin_state_location}/specs.c"'" command="sh" useDefault="true"/> +<parser enabled="true"/> +</scannerInfoProvider> +</profile> +<profile id="org.eclipse.cdt.managedbuilder.xlc.core.XLCManagedMakePerProjectProfile"> +<buildOutputProvider> +<openAction enabled="false" filePath=""/> +<parser enabled="false"/> +</buildOutputProvider> +<scannerInfoProvider id="specsFile"> +<runAction arguments="-E -v ${plugin_state_location}/${specs_file}" command="${XL_compilerRoot}/xlc" useDefault="true"/> +<parser enabled="true"/> +</scannerInfoProvider> +</profile> +<profile id="org.eclipse.cdt.managedbuilder.xlc.core.XLCManagedMakePerProjectProfileCPP"> +<buildOutputProvider> +<openAction enabled="false" filePath=""/> +<parser enabled="false"/> +</buildOutputProvider> +<scannerInfoProvider id="specsFile"> +<runAction arguments="-E -v ${plugin_state_location}/${specs_file}" command="${XL_compilerRoot}/xlC" useDefault="true"/> +<parser enabled="true"/> +</scannerInfoProvider> +</profile> +</scannerConfigBuildInfo> +<scannerConfigBuildInfo instanceId="cdt.managedbuild.config.gnu.mingw.exe.release.369958126;cdt.managedbuild.config.gnu.mingw.exe.release.369958126.;cdt.managedbuild.tool.gnu.cpp.compiler.mingw.exe.release.1039220343;cdt.managedbuild.tool.gnu.cpp.compiler.input.394920570"> +<autodiscovery enabled="true" problemReportingEnabled="true" selectedProfileId="org.eclipse.cdt.managedbuilder.core.GCCManagedMakePerProjectProfileCPP"/> +<profile id="org.eclipse.cdt.make.core.GCCStandardMakePerProjectProfile"> +<buildOutputProvider> +<openAction enabled="true" filePath=""/> +<parser enabled="true"/> +</buildOutputProvider> +<scannerInfoProvider id="specsFile"> +<runAction arguments="-E -P -v -dD ${plugin_state_location}/${specs_file}" command="gcc" useDefault="true"/> +<parser enabled="true"/> +</scannerInfoProvider> +</profile> +<profile id="org.eclipse.cdt.make.core.GCCStandardMakePerFileProfile"> +<buildOutputProvider> +<openAction enabled="true" filePath=""/> +<parser enabled="true"/> +</buildOutputProvider> +<scannerInfoProvider id="makefileGenerator"> +<runAction arguments="-f ${project_name}_scd.mk" command="make" useDefault="true"/> +<parser enabled="true"/> +</scannerInfoProvider> +</profile> +<profile id="org.eclipse.cdt.managedbuilder.core.GCCManagedMakePerProjectProfile"> +<buildOutputProvider> +<openAction enabled="true" filePath=""/> +<parser enabled="true"/> +</buildOutputProvider> +<scannerInfoProvider id="specsFile"> +<runAction arguments="-E -P -v -dD ${plugin_state_location}/${specs_file}" command="gcc" useDefault="true"/> +<parser enabled="true"/> +</scannerInfoProvider> +</profile> +<profile id="org.eclipse.cdt.managedbuilder.core.GCCManagedMakePerProjectProfileCPP"> +<buildOutputProvider> +<openAction enabled="true" filePath=""/> +<parser enabled="true"/> +</buildOutputProvider> +<scannerInfoProvider id="specsFile"> +<runAction arguments="-E -P -v -dD ${plugin_state_location}/specs.cpp" command="g++" useDefault="true"/> +<parser enabled="true"/> +</scannerInfoProvider> +</profile> +<profile id="org.eclipse.cdt.managedbuilder.core.GCCManagedMakePerProjectProfileC"> +<buildOutputProvider> +<openAction enabled="true" filePath=""/> +<parser enabled="true"/> +</buildOutputProvider> +<scannerInfoProvider id="specsFile"> +<runAction arguments="-E -P -v -dD ${plugin_state_location}/specs.c" command="gcc" useDefault="true"/> +<parser enabled="true"/> +</scannerInfoProvider> +</profile> +<profile id="org.eclipse.cdt.managedbuilder.core.GCCWinManagedMakePerProjectProfile"> +<buildOutputProvider> +<openAction enabled="true" filePath=""/> +<parser enabled="true"/> +</buildOutputProvider> +<scannerInfoProvider id="specsFile"> +<runAction arguments="-c 'gcc -E -P -v -dD "${plugin_state_location}/${specs_file}"'" command="sh" useDefault="true"/> +<parser enabled="true"/> +</scannerInfoProvider> +</profile> +<profile id="org.eclipse.cdt.managedbuilder.core.GCCWinManagedMakePerProjectProfileCPP"> +<buildOutputProvider> +<openAction enabled="true" filePath=""/> +<parser enabled="true"/> +</buildOutputProvider> +<scannerInfoProvider id="specsFile"> +<runAction arguments="-c 'g++ -E -P -v -dD "${plugin_state_location}/specs.cpp"'" command="sh" useDefault="true"/> +<parser enabled="true"/> +</scannerInfoProvider> +</profile> +<profile id="org.eclipse.cdt.managedbuilder.core.GCCWinManagedMakePerProjectProfileC"> +<buildOutputProvider> +<openAction enabled="true" filePath=""/> +<parser enabled="true"/> +</buildOutputProvider> +<scannerInfoProvider id="specsFile"> +<runAction arguments="-c 'gcc -E -P -v -dD "${plugin_state_location}/specs.c"'" command="sh" useDefault="true"/> +<parser enabled="true"/> +</scannerInfoProvider> +</profile> +<profile id="org.eclipse.cdt.managedbuilder.xlc.core.XLCManagedMakePerProjectProfile"> +<buildOutputProvider> +<openAction enabled="false" filePath=""/> +<parser enabled="false"/> +</buildOutputProvider> +<scannerInfoProvider id="specsFile"> +<runAction arguments="-E -v ${plugin_state_location}/${specs_file}" command="${XL_compilerRoot}/xlc" useDefault="true"/> +<parser enabled="true"/> +</scannerInfoProvider> +</profile> +<profile id="org.eclipse.cdt.managedbuilder.xlc.core.XLCManagedMakePerProjectProfileCPP"> +<buildOutputProvider> +<openAction enabled="false" filePath=""/> +<parser enabled="false"/> +</buildOutputProvider> +<scannerInfoProvider id="specsFile"> +<runAction arguments="-E -v ${plugin_state_location}/${specs_file}" command="${XL_compilerRoot}/xlC" useDefault="true"/> +<parser enabled="true"/> +</scannerInfoProvider> +</profile> +</scannerConfigBuildInfo> +<scannerConfigBuildInfo instanceId="cdt.managedbuild.config.gnu.mingw.exe.debug.1794257183;cdt.managedbuild.config.gnu.mingw.exe.debug.1794257183.;cdt.managedbuild.tool.gnu.c.compiler.mingw.exe.debug.1406350564;cdt.managedbuild.tool.gnu.c.compiler.input.2072174392"> +<autodiscovery enabled="true" problemReportingEnabled="true" selectedProfileId="org.eclipse.cdt.managedbuilder.core.GCCManagedMakePerProjectProfileC"/> +<profile id="org.eclipse.cdt.make.core.GCCStandardMakePerProjectProfile"> +<buildOutputProvider> +<openAction enabled="true" filePath=""/> +<parser enabled="true"/> +</buildOutputProvider> +<scannerInfoProvider id="specsFile"> +<runAction arguments="-E -P -v -dD ${plugin_state_location}/${specs_file}" command="gcc" useDefault="true"/> +<parser enabled="true"/> +</scannerInfoProvider> +</profile> +<profile id="org.eclipse.cdt.make.core.GCCStandardMakePerFileProfile"> +<buildOutputProvider> +<openAction enabled="true" filePath=""/> +<parser enabled="true"/> +</buildOutputProvider> +<scannerInfoProvider id="makefileGenerator"> +<runAction arguments="-f ${project_name}_scd.mk" command="make" useDefault="true"/> +<parser enabled="true"/> +</scannerInfoProvider> +</profile> +<profile id="org.eclipse.cdt.managedbuilder.core.GCCManagedMakePerProjectProfile"> +<buildOutputProvider> +<openAction enabled="true" filePath=""/> +<parser enabled="true"/> +</buildOutputProvider> +<scannerInfoProvider id="specsFile"> +<runAction arguments="-E -P -v -dD ${plugin_state_location}/${specs_file}" command="gcc" useDefault="true"/> +<parser enabled="true"/> +</scannerInfoProvider> +</profile> +<profile id="org.eclipse.cdt.managedbuilder.core.GCCManagedMakePerProjectProfileCPP"> +<buildOutputProvider> +<openAction enabled="true" filePath=""/> +<parser enabled="true"/> +</buildOutputProvider> +<scannerInfoProvider id="specsFile"> +<runAction arguments="-E -P -v -dD ${plugin_state_location}/specs.cpp" command="g++" useDefault="true"/> +<parser enabled="true"/> +</scannerInfoProvider> +</profile> +<profile id="org.eclipse.cdt.managedbuilder.core.GCCManagedMakePerProjectProfileC"> +<buildOutputProvider> +<openAction enabled="true" filePath=""/> +<parser enabled="true"/> +</buildOutputProvider> +<scannerInfoProvider id="specsFile"> +<runAction arguments="-E -P -v -dD ${plugin_state_location}/specs.c" command="gcc" useDefault="true"/> +<parser enabled="true"/> +</scannerInfoProvider> +</profile> +<profile id="org.eclipse.cdt.managedbuilder.core.GCCWinManagedMakePerProjectProfile"> +<buildOutputProvider> +<openAction enabled="true" filePath=""/> +<parser enabled="true"/> +</buildOutputProvider> +<scannerInfoProvider id="specsFile"> +<runAction arguments="-c 'gcc -E -P -v -dD "${plugin_state_location}/${specs_file}"'" command="sh" useDefault="true"/> +<parser enabled="true"/> +</scannerInfoProvider> +</profile> +<profile id="org.eclipse.cdt.managedbuilder.core.GCCWinManagedMakePerProjectProfileCPP"> +<buildOutputProvider> +<openAction enabled="true" filePath=""/> +<parser enabled="true"/> +</buildOutputProvider> +<scannerInfoProvider id="specsFile"> +<runAction arguments="-c 'g++ -E -P -v -dD "${plugin_state_location}/specs.cpp"'" command="sh" useDefault="true"/> +<parser enabled="true"/> +</scannerInfoProvider> +</profile> +<profile id="org.eclipse.cdt.managedbuilder.core.GCCWinManagedMakePerProjectProfileC"> +<buildOutputProvider> +<openAction enabled="true" filePath=""/> +<parser enabled="true"/> +</buildOutputProvider> +<scannerInfoProvider id="specsFile"> +<runAction arguments="-c 'gcc -E -P -v -dD "${plugin_state_location}/specs.c"'" command="sh" useDefault="true"/> +<parser enabled="true"/> +</scannerInfoProvider> +</profile> +<profile id="org.eclipse.cdt.managedbuilder.xlc.core.XLCManagedMakePerProjectProfile"> +<buildOutputProvider> +<openAction enabled="false" filePath=""/> +<parser enabled="false"/> +</buildOutputProvider> +<scannerInfoProvider id="specsFile"> +<runAction arguments="-E -v ${plugin_state_location}/${specs_file}" command="${XL_compilerRoot}/xlc" useDefault="true"/> +<parser enabled="true"/> +</scannerInfoProvider> +</profile> +<profile id="org.eclipse.cdt.managedbuilder.xlc.core.XLCManagedMakePerProjectProfileCPP"> +<buildOutputProvider> +<openAction enabled="false" filePath=""/> +<parser enabled="false"/> +</buildOutputProvider> +<scannerInfoProvider id="specsFile"> +<runAction arguments="-E -v ${plugin_state_location}/${specs_file}" command="${XL_compilerRoot}/xlC" useDefault="true"/> +<parser enabled="true"/> +</scannerInfoProvider> +</profile> +</scannerConfigBuildInfo> +</storageModule> +<storageModule moduleId="org.eclipse.cdt.core.externalSettings"/> +<storageModule moduleId="org.eclipse.cdt.core.language.mapping"/> +<storageModule moduleId="org.eclipse.cdt.internal.ui.text.commentOwnerProjectMappings"/> +<storageModule moduleId="org.eclipse.cdt.make.core.buildtargets"/> +</cconfiguration> +</storageModule> +<storageModule moduleId="cdtBuildSystem" version="4.0.0"> +<project id="vision.cdt.managedbuild.target.gnu.mingw.exe.407966002" name="Executable" projectType="cdt.managedbuild.target.gnu.mingw.exe"/> +</storageModule> +</cproject> Added: vision/.project =================================================================== --- vision/.project (rev 0) +++ vision/.project 2010-05-20 01:00:10 UTC (rev 13) @@ -0,0 +1,70 @@ +<?xml version="1.0" encoding="UTF-8"?> +<projectDescription> + <name>vision</name> + <comment></comment> + <projects> + </projects> + <buildSpec> + <buildCommand> + <name>org.eclipse.cdt.managedbuilder.core.genmakebuilder</name> + <triggers>clean,full,incremental,</triggers> + <arguments> + <dictionary> + <key>?name?</key> + <value></value> + </dictionary> + <dictionary> + <key>org.eclipse.cdt.make.core.append_environment</key> + <value>true</value> + </dictionary> + <dictionary> + <key>org.eclipse.cdt.make.core.buildArguments</key> + <value></value> + </dictionary> + <dictionary> + <key>org.eclipse.cdt.make.core.buildCommand</key> + <value>make</value> + </dictionary> + <dictionary> + <key>org.eclipse.cdt.make.core.buildLocation</key> + <value>${workspace_loc:/vision/Release}</value> + </... [truncated message content] |
From: <phi...@us...> - 2010-05-24 19:27:58
|
Revision: 14 http://robotvision.svn.sourceforge.net/robotvision/?rev=14&view=rev Author: phildavidson Date: 2010-05-24 19:27:52 +0000 (Mon, 24 May 2010) Log Message: ----------- update... Modified Paths: -------------- vision/.project vision/src/test.cpp vision/src/test2.cpp vision/testimg.png Added Paths: ----------- vision/images/flipper.png Modified: vision/.project =================================================================== --- vision/.project 2010-05-20 01:00:10 UTC (rev 13) +++ vision/.project 2010-05-24 19:27:52 UTC (rev 14) @@ -27,7 +27,7 @@ </dictionary> <dictionary> <key>org.eclipse.cdt.make.core.buildLocation</key> - <value>${workspace_loc:/vision/Release}</value> + <value>${workspace_loc:/vision/Debug}</value> </dictionary> <dictionary> <key>org.eclipse.cdt.make.core.contents</key> Added: vision/images/flipper.png =================================================================== (Binary files differ) Property changes on: vision/images/flipper.png ___________________________________________________________________ Added: svn:mime-type + application/octet-stream Modified: vision/src/test.cpp =================================================================== --- vision/src/test.cpp 2010-05-20 01:00:10 UTC (rev 13) +++ vision/src/test.cpp 2010-05-24 19:27:52 UTC (rev 14) @@ -169,19 +169,18 @@ { int sthreshold = 86, erode = 4, dialate = 8; - int hlower = 127, hupper = 5;/* + int hlower = 127, hupper = 18;/* here hlower is the lower cut off and the hupper is the upper cut off for hue values of red.*/ cvNamedWindow("original", CV_WINDOW_AUTOSIZE); - cvNamedWindow("Monochrome Of red Blob", CV_WINDOW_AUTOSIZE); + cvNamedWindow("processed", CV_WINDOW_AUTOSIZE); - cvCreateTrackbar("sthreshold", "Monochrome Of red Blob", &sthreshold, 255, - 0); - cvCreateTrackbar("hlower", "Monochrome Of red Blob", &hlower, 255, 0); - cvCreateTrackbar("hupper", "Monochrome Of red Blob", &hupper, 255, 0); - cvCreateTrackbar("erode", "Monochrome Of red Blob", &erode, 20, 0); - cvCreateTrackbar("dialate", "Monochrome Of red Blob", &dialate, 20, 0); + //cvCreateTrackbar("sthreshold", "Monochrome Of red Blob", &sthreshold, 255, 0); + //cvCreateTrackbar("hlower", "Monochrome Of red Blob", &hlower, 255, 0); + //cvCreateTrackbar("hupper", "Monochrome Of red Blob", &hupper, 255, 0); + //cvCreateTrackbar("erode", "Monochrome Of red Blob", &erode, 20, 0); + //cvCreateTrackbar("dialate", "Monochrome Of red Blob", &dialate, 20, 0); int i, j, k;//for iterations int temp = 0;//if we use a temporary var @@ -225,7 +224,7 @@ // } - frame = cvRetrieveFrame(capture); + //frame = cvRetrieveFrame(capture); for (;;) {/*keep looping till we are out of frames...*/ @@ -244,6 +243,7 @@ exit(0); } //printf("frame loaded"); + colimgbot = cvCreateImage(cvGetSize(frame), 8, 3); monoimgbot = cvCreateImage(cvGetSize(frame), 8, 1); @@ -275,6 +275,7 @@ } else /*A very simple concept with the loops here if the hue values are in the aforementioned range and the threshold is met then logic one else logic zero*/ + datamono[i * stepmono + j * channelsmono] = 0; } } @@ -328,9 +329,10 @@ } } - w = w / countw; - h = h / counth; - + if(countw!=0 && counth!=0) { + w = w / countw; + h = h / counth; + } cvCircle(frame, cvPoint(w, h), 20, cvScalar(0, 255, 0), 1); //printf("w: %i, h: %i", w, h); @@ -341,13 +343,13 @@ IplImage * img2 = cvLoadImage("testimg.png", 1); - drawSquares( img2, findSquares4( img2 ) ); + drawSquares(img2, findSquares4(img2)); cvCircle(img2, cvPoint(w, h), 20, cvScalar(0, 255, 0), 1); cvShowImage("original", frame); //cvSaveImage("red-ballmonochrome.jpg",monoimgbot);/*if you want to save the image*/ - cvShowImage("Monochrome Of red Blob", img2); + cvShowImage("processed", img2); int c = cvWaitKey(100); if ((char) c == 27) break; @@ -357,11 +359,13 @@ check the other posts on this blog*/ } + + /* free memory */ //cvReleaseVideoWriter(&writer); - cvDestroyWindow("Monochrome Of red Blob"); + cvDestroyWindow("processed"); cvDestroyWindow("original"); cvReleaseCapture(&capture); Modified: vision/src/test2.cpp =================================================================== --- vision/src/test2.cpp 2010-05-20 01:00:10 UTC (rev 13) +++ vision/src/test2.cpp 2010-05-24 19:27:52 UTC (rev 14) @@ -49,7 +49,7 @@ //frame = cvLoadImage("images/3dballs.jpg", 1); - frame=cvLoadImage("images/pipe.png",1); + frame=cvLoadImage("images/flipper.png",1); if (frame == NULL) { puts("unable to load the frame"); Modified: vision/testimg.png =================================================================== (Binary files differ) This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <phi...@us...> - 2010-05-24 19:27:58
|
Revision: 14 http://robotvision.svn.sourceforge.net/robotvision/?rev=14&view=rev Author: phildavidson Date: 2010-05-24 19:27:52 +0000 (Mon, 24 May 2010) Log Message: ----------- update... Modified Paths: -------------- vision/.project vision/src/test.cpp vision/src/test2.cpp vision/testimg.png Added Paths: ----------- vision/images/flipper.png Modified: vision/.project =================================================================== --- vision/.project 2010-05-20 01:00:10 UTC (rev 13) +++ vision/.project 2010-05-24 19:27:52 UTC (rev 14) @@ -27,7 +27,7 @@ </dictionary> <dictionary> <key>org.eclipse.cdt.make.core.buildLocation</key> - <value>${workspace_loc:/vision/Release}</value> + <value>${workspace_loc:/vision/Debug}</value> </dictionary> <dictionary> <key>org.eclipse.cdt.make.core.contents</key> Added: vision/images/flipper.png =================================================================== (Binary files differ) Property changes on: vision/images/flipper.png ___________________________________________________________________ Added: svn:mime-type + application/octet-stream Modified: vision/src/test.cpp =================================================================== --- vision/src/test.cpp 2010-05-20 01:00:10 UTC (rev 13) +++ vision/src/test.cpp 2010-05-24 19:27:52 UTC (rev 14) @@ -169,19 +169,18 @@ { int sthreshold = 86, erode = 4, dialate = 8; - int hlower = 127, hupper = 5;/* + int hlower = 127, hupper = 18;/* here hlower is the lower cut off and the hupper is the upper cut off for hue values of red.*/ cvNamedWindow("original", CV_WINDOW_AUTOSIZE); - cvNamedWindow("Monochrome Of red Blob", CV_WINDOW_AUTOSIZE); + cvNamedWindow("processed", CV_WINDOW_AUTOSIZE); - cvCreateTrackbar("sthreshold", "Monochrome Of red Blob", &sthreshold, 255, - 0); - cvCreateTrackbar("hlower", "Monochrome Of red Blob", &hlower, 255, 0); - cvCreateTrackbar("hupper", "Monochrome Of red Blob", &hupper, 255, 0); - cvCreateTrackbar("erode", "Monochrome Of red Blob", &erode, 20, 0); - cvCreateTrackbar("dialate", "Monochrome Of red Blob", &dialate, 20, 0); + //cvCreateTrackbar("sthreshold", "Monochrome Of red Blob", &sthreshold, 255, 0); + //cvCreateTrackbar("hlower", "Monochrome Of red Blob", &hlower, 255, 0); + //cvCreateTrackbar("hupper", "Monochrome Of red Blob", &hupper, 255, 0); + //cvCreateTrackbar("erode", "Monochrome Of red Blob", &erode, 20, 0); + //cvCreateTrackbar("dialate", "Monochrome Of red Blob", &dialate, 20, 0); int i, j, k;//for iterations int temp = 0;//if we use a temporary var @@ -225,7 +224,7 @@ // } - frame = cvRetrieveFrame(capture); + //frame = cvRetrieveFrame(capture); for (;;) {/*keep looping till we are out of frames...*/ @@ -244,6 +243,7 @@ exit(0); } //printf("frame loaded"); + colimgbot = cvCreateImage(cvGetSize(frame), 8, 3); monoimgbot = cvCreateImage(cvGetSize(frame), 8, 1); @@ -275,6 +275,7 @@ } else /*A very simple concept with the loops here if the hue values are in the aforementioned range and the threshold is met then logic one else logic zero*/ + datamono[i * stepmono + j * channelsmono] = 0; } } @@ -328,9 +329,10 @@ } } - w = w / countw; - h = h / counth; - + if(countw!=0 && counth!=0) { + w = w / countw; + h = h / counth; + } cvCircle(frame, cvPoint(w, h), 20, cvScalar(0, 255, 0), 1); //printf("w: %i, h: %i", w, h); @@ -341,13 +343,13 @@ IplImage * img2 = cvLoadImage("testimg.png", 1); - drawSquares( img2, findSquares4( img2 ) ); + drawSquares(img2, findSquares4(img2)); cvCircle(img2, cvPoint(w, h), 20, cvScalar(0, 255, 0), 1); cvShowImage("original", frame); //cvSaveImage("red-ballmonochrome.jpg",monoimgbot);/*if you want to save the image*/ - cvShowImage("Monochrome Of red Blob", img2); + cvShowImage("processed", img2); int c = cvWaitKey(100); if ((char) c == 27) break; @@ -357,11 +359,13 @@ check the other posts on this blog*/ } + + /* free memory */ //cvReleaseVideoWriter(&writer); - cvDestroyWindow("Monochrome Of red Blob"); + cvDestroyWindow("processed"); cvDestroyWindow("original"); cvReleaseCapture(&capture); Modified: vision/src/test2.cpp =================================================================== --- vision/src/test2.cpp 2010-05-20 01:00:10 UTC (rev 13) +++ vision/src/test2.cpp 2010-05-24 19:27:52 UTC (rev 14) @@ -49,7 +49,7 @@ //frame = cvLoadImage("images/3dballs.jpg", 1); - frame=cvLoadImage("images/pipe.png",1); + frame=cvLoadImage("images/flipper.png",1); if (frame == NULL) { puts("unable to load the frame"); Modified: vision/testimg.png =================================================================== (Binary files differ) This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <phi...@us...> - 2010-05-29 14:43:19
|
Revision: 15 http://robotvision.svn.sourceforge.net/robotvision/?rev=15&view=rev Author: phildavidson Date: 2010-05-29 14:43:13 +0000 (Sat, 29 May 2010) Log Message: ----------- Final Find Pipe Modified Paths: -------------- vision/images/flipper.png vision/src/test2.cpp vision/testimg.png Added Paths: ----------- vision/images/test1.PNG vision/images/test2.PNG vision/images/test3.PNG vision/images/test4.PNG vision/images/test5.PNG vision/images/test6.PNG vision/src/ellipse.cpp vision/src/main.cpp vision/src/pipe.cpp Removed Paths: ------------- vision/src/test.cpp Modified: vision/images/flipper.png =================================================================== (Binary files differ) Added: vision/images/test1.PNG =================================================================== (Binary files differ) Property changes on: vision/images/test1.PNG ___________________________________________________________________ Added: svn:mime-type + application/octet-stream Added: vision/images/test2.PNG =================================================================== (Binary files differ) Property changes on: vision/images/test2.PNG ___________________________________________________________________ Added: svn:mime-type + application/octet-stream Added: vision/images/test3.PNG =================================================================== (Binary files differ) Property changes on: vision/images/test3.PNG ___________________________________________________________________ Added: svn:mime-type + application/octet-stream Added: vision/images/test4.PNG =================================================================== (Binary files differ) Property changes on: vision/images/test4.PNG ___________________________________________________________________ Added: svn:mime-type + application/octet-stream Added: vision/images/test5.PNG =================================================================== (Binary files differ) Property changes on: vision/images/test5.PNG ___________________________________________________________________ Added: svn:mime-type + application/octet-stream Added: vision/images/test6.PNG =================================================================== (Binary files differ) Property changes on: vision/images/test6.PNG ___________________________________________________________________ Added: svn:mime-type + application/octet-stream Added: vision/src/ellipse.cpp =================================================================== --- vision/src/ellipse.cpp (rev 0) +++ vision/src/ellipse.cpp 2010-05-29 14:43:13 UTC (rev 15) @@ -0,0 +1,269 @@ +#ifdef _CH_ +#pragma package <opencv> +#endif + +#define CV_NO_BACKWARD_COMPATIBILITY + +#ifndef _EiC +#include "cv.h" +#include "highgui.h" +#include "cxcore.h" +#include "math.h" +#endif + + +typedef struct elipse { + + float angle; + int total; + CvPoint center; + CvSize size; + + +} elipse; + + + +elipse findPipe(IplImage *src) { + + int sthreshold = 86, erode = 4, dialate = 8; + + int hlower = 127, hupper = 25;/* + here hlower is the lower cut off and the hupper is the upper cut off for hue values of red.*/ + + int i, j, k;//for iterations + int temp = 0;//if we use a temporary var + + int heighthsv, widthhsv, stephsv, channelshsv; + int heightmono, widthmono, stepmono, channelsmono; + uchar *datahsv, *datamono; + + IplImage *colimgbot; + + IplImage *monoimgbot; + + //printf("frame loaded"); + + colimgbot = cvCreateImage(cvGetSize(src), 8, 3); + + monoimgbot = cvCreateImage(cvGetSize(src), 8, 1); + + cvCvtColor(src, colimgbot, CV_RGB2HSV); + + //\x97\x97\x97\x97\x97\x97\x97\x97\x97\x97\x97\x97\x97\x97\x97\x97\x97\x97\x97\x97\x97\x97 + + heighthsv = colimgbot->height; + widthhsv = colimgbot->width; + stephsv = colimgbot->widthStep; + channelshsv = colimgbot->nChannels; + datahsv = (uchar *) colimgbot->imageData; + //\x97\x97\x97\x97\x97\x97\x97\x97\x96 + + heightmono = monoimgbot ->height; + widthmono = monoimgbot->width; + stepmono = monoimgbot->widthStep; + channelsmono = monoimgbot->nChannels; + datamono = (uchar *) monoimgbot->imageData; + + for (i = 0; i < (heighthsv); i++) { + for (j = 0; j < (widthhsv); j++) { + if ((datahsv[(i) * stephsv + j * channelshsv] <= hlower) + && (datahsv[(i) * stephsv + j * channelshsv] >= hupper)) { + if ((datahsv[(i) * stephsv + j * (channelshsv) + 1]) + > sthreshold) { + datamono[i * stepmono + j * channelsmono] = 255; + } else + /*A very simple concept with the loops here if the hue values are in the aforementioned range and the + threshold is met then logic one else logic zero*/ + + datamono[i * stepmono + j * channelsmono] = 0; + } + } + } + + + //crosscheck all are either black or white + for (i = 0; i < (heighthsv); i++) { + for (j = 0; j < (widthhsv); j++) { + if (!(datamono[i * stepmono + j * channelsmono] == 0 || datamono[i + * stepmono + j * channelsmono] == 255)) + datamono[i * stepmono + j * channelsmono] = 0; + } + } + + + // get rid of noise + cvErode(monoimgbot, monoimgbot, 0, erode); + cvDilate(monoimgbot, monoimgbot, 0, dialate); + + CvMemStorage* storage; + CvSeq* contour; + + // Create dynamic structure and sequence. + storage = cvCreateMemStorage(0); + contour = cvCreateSeq(CV_SEQ_ELTYPE_POINT, sizeof(CvSeq), sizeof(CvPoint), + storage); + + + cvShowImage("processed", monoimgbot); + + // Find all contours. + cvFindContours(monoimgbot, storage, &contour, sizeof(CvContour), CV_RETR_LIST, + CV_CHAIN_APPROX_NONE, cvPoint(0, 0)); + + elipse retElipse; + retElipse.total=0; + retElipse.angle=-1; + + // This cycle draw all contours and approximate it by ellipses. + for(;contour;contour = contour->h_next) + { + + + int count = contour->total; // This is number point in contour + + CvBox2D box; + + // Number point must be more than or equal to 6 (for cvFitEllipse_32f). + if (count < 6) + continue; + + CvMat* points_f = cvCreateMat(1, count, CV_32FC2 ); + CvMat points_i = cvMat(1, count, CV_32SC2, points_f->data.ptr); + cvCvtSeqToArray(contour, points_f->data.ptr, CV_WHOLE_SEQ ); + cvConvert( &points_i, points_f ); + + // Fits ellipse to current contour. + box = cvFitEllipse2(points_f); + + // Draw current contour. + //cvDrawContours(image04,contour,CV_RGB(255,255,255),CV_RGB(255,255,255),0,1,8,cvPoint(0,0)); + + // Convert ellipse data from float to integer representation. + + if(count>retElipse.total) { + + retElipse.total = count; + retElipse.angle = box.angle; + retElipse.center = cvPointFrom32f(box.center); + retElipse.size.width = cvRound(box.size.width*0.5); + retElipse.size.height = cvRound(box.size.height*0.5); + } + + cvReleaseMat(&points_f); + + } + +/* + if(retElipse.angle!=-1) { + cvLine(monoimgbot, cvPoint(monoimgbot->width / 2, monoimgbot->height / 2), + cvPoint((monoimgbot->width / 2) + (100 * (sin((-retElipse.angle) + * 3.14159265 / 180))), (monoimgbot->height / 2) + (100 + * (cos(-retElipse.angle * 3.14159265 / 180)))), + CV_RGB(0,0,255), 5); + + cvCircle(monoimgbot, cvPoint(monoimgbot->width / 2, monoimgbot->height / 2), 10, + CV_RGB(0,0,255), 10); + + // Draw ellipse. + cvEllipse(monoimgbot, retElipse.center, retElipse.size, -retElipse.angle, 0, 360, CV_RGB(255,0,255), + 1, CV_AA, 0); + + + cvCircle(monoimgbot, retElipse.center, 20, CV_RGB(0,255,0), 3); + + + } +*/ + + // Show image. HighGUI use. + + + cvReleaseImage(&colimgbot); + cvReleaseImage(&monoimgbot); + cvReleaseMemStorage(&storage); + + return retElipse; +} + +int zmain(int argc, char** argv) { + + cvNamedWindow("original", CV_WINDOW_AUTOSIZE); + + cvNamedWindow("processed", CV_WINDOW_AUTOSIZE); + + CvCapture* capture = cvCreateFileCapture("videos/pipe3.avi"); + //CvCapture* capture = cvCreateFileCapture("videos/ets2007pipe.avi"); + //CvCapture* capture = cvCreateFileCapture("videos/ets2007buoy.avi"); + + IplImage *frame; + + if (!capture) { + + printf("Cannot open video file!\n"); + + return (1); + + } + + + for (;;) {/*keep looping till we are out of frames...*/ + + if (!cvGrabFrame(capture)) { + + break; + + } + + + frame = cvRetrieveFrame(capture); + + if (frame == NULL) { + puts("unable to load the frame"); + return 0; + } + + elipse retElipse = findPipe(frame); + + if(retElipse.angle!=-1) { + cvLine(frame, cvPoint(frame->width / 2, frame->height / 2), + cvPoint((frame->width / 2) + (100 * (sin((-retElipse.angle) + * 3.14159265 / 180))), (frame->height / 2) + (100 + * (cos(-retElipse.angle * 3.14159265 / 180)))), + CV_RGB(0,0,255), 5); + + cvCircle(frame, cvPoint(frame->width / 2, frame->height / 2), 10, + CV_RGB(0,0,255), 10); + + // Draw ellipse. + cvEllipse(frame, retElipse.center, retElipse.size, -retElipse.angle, 0, 360, CV_RGB(255,0,255), + 1, CV_AA, 0); + + + cvCircle(frame, retElipse.center, 10, CV_RGB(0,255,0), 5); + + + } + + + cvShowImage("original", frame); + + + int c = cvWaitKey(150); + if ((char) c == 27) + break; + + } + + /* free memory */ + + + cvDestroyWindow("processed"); + cvDestroyWindow("original"); + + cvReleaseCapture(&capture); + + return 0; +} + + Added: vision/src/main.cpp =================================================================== --- vision/src/main.cpp (rev 0) +++ vision/src/main.cpp 2010-05-29 14:43:13 UTC (rev 15) @@ -0,0 +1,420 @@ +#ifdef _CH_ +#pragma package <opencv> +#endif + +#define CV_NO_BACKWARD_COMPATIBILITY + +#include <cv.h> +#include <highgui.h> +#include <stdio.h> +#include <math.h> +#include <string.h> +//#include "pipe.cpp" + +using namespace std; + +//using namespace pipe; + +//the struct is what will be used to return the values in the form of an ordered pair (x,y) + + +typedef struct retValue { + + double x; + double y; + +} point; + + +typedef struct elipse { + + float angle; + int total; + CvPoint center; + CvSize size; + + +} elipse; + +//need to show the method headers +/*point findBuoy(IplImage* img); + point findPipe(IplImage* img); + point findHeading(IplImage* img); + */ + +//the convert function converts a gStreamer object to an OpenCV image +/* + + IplImage* convert(GSTBuffer gBuffer){ + + + + + } + */ + +//For the findBuoy function, the center of mass is returned as (x,y) coordinates +//center of mass will either be found by averaging white pixels in binary image +//or by fitting an ellipse around the buoy + +point findBuoy(IplImage* img) { + + point p; + p.x = 0.0; + p.y = 0.0; + + //these are the threshold values + int sthreshold = 194;//210; + double hlower = 178; + double hupper = 3; + + //create the windows: + //this is for the original image + cvNamedWindow("orig", CV_WINDOW_AUTOSIZE); + //this is for the smoothed image + cvNamedWindow("smooth", CV_WINDOW_AUTOSIZE); + //this is for the binary image (thresholding) + cvNamedWindow("binary", CV_WINDOW_AUTOSIZE); + + //display the original image + cvShowImage("orig", img); + + //we smooth the image and store the smooth img back in img + cvSmooth(img, img, CV_GAUSSIAN, 3, 3, 0, 0); + + //display the smoothed image + cvShowImage("smooth", img); + + //these are the properties of the image + //we will use them to loop through the data array (the image buffer) + int height = img->height; + int width = img->width; + int step = img->widthStep; + int nChannels = img->nChannels; + + //this is the image buffer + uchar *data = (uchar*) img->imageData; + + int i; + int j; + + for (i = 0; i < height; i++) { + + for (j = 0; j < width; j++) { + + if ((data[i * step + j * nChannels + 2] >= hlower) && (data[i + * step + j * nChannels + 2] >= hupper)) { + + if ((data[i * step + j * nChannels + 2]) > sthreshold) { + + data[i * step + j * nChannels + 0] = 255; + + data[i * step + j * nChannels + 1] = 255; + + data[i * step + j * nChannels + 2] = 255; + + } else { + data[i * step + j * nChannels + 0] = 0; + + data[i * step + j * nChannels + 1] = 0; + + data[i * step + j * nChannels + 2] = 0; + + } + + } else { + + data[i * step + j * nChannels + 0] = 0; + + data[i * step + j * nChannels + 1] = 0; + + data[i * step + j * nChannels + 2] = 0; + + } + + }//end inner for loop + + }//end outer for loop + + cvErode(img, img, 0, 6); + cvDilate(img, img, 0, 10); + + //display the binary image + cvShowImage("binary", img); + + cvWaitKey(0); + + cvDestroyWindow("orig"); + cvDestroyWindow("smooth"); + cvDestroyWindow("binary"); + + cvWaitKey(0); + + return p; + +} + +//the findHedge function will have to be used with a fake image we create +//(I suggest manipulating the buoy image and drawing a green hedge within it) +//since we don't have any ones to base ourselves on +//how are we going to return the values? Are we going to return a struct with three points, +//each corresponding to the center of each rectangle? Will it have to be done in the same way +//as finding the heading of the pipe? +//will we need to make a new struct then for this return value? + +/*point? findHedge(IplImage* img){ + + + } + */ + +//The findPipe function works in quite the same way as findBuoy + + + + +elipse finalFindPipe(IplImage *src) { + + int sthreshold = 86, erode = 4, dialate = 8; + + int hlower = 127, hupper = 25;/* + here hlower is the lower cut off and the hupper is the upper cut off for hue values of red.*/ + + int i, j, k;//for iterations + int temp = 0;//if we use a temporary var + + int heighthsv, widthhsv, stephsv, channelshsv; + int heightmono, widthmono, stepmono, channelsmono; + uchar *datahsv, *datamono; + + IplImage *colimgbot; + + IplImage *monoimgbot; + + //printf("frame loaded"); + + colimgbot = cvCreateImage(cvGetSize(src), 8, 3); + + monoimgbot = cvCreateImage(cvGetSize(src), 8, 1); + + cvCvtColor(src, colimgbot, CV_RGB2HSV); + + //\x97\x97\x97\x97\x97\x97\x97\x97\x97\x97\x97\x97\x97\x97\x97\x97\x97\x97\x97\x97\x97\x97 + + heighthsv = colimgbot->height; + widthhsv = colimgbot->width; + stephsv = colimgbot->widthStep; + channelshsv = colimgbot->nChannels; + datahsv = (uchar *) colimgbot->imageData; + //\x97\x97\x97\x97\x97\x97\x97\x97\x96 + + heightmono = monoimgbot ->height; + widthmono = monoimgbot->width; + stepmono = monoimgbot->widthStep; + channelsmono = monoimgbot->nChannels; + datamono = (uchar *) monoimgbot->imageData; + + for (i = 0; i < (heighthsv); i++) { + for (j = 0; j < (widthhsv); j++) { + if ((datahsv[(i) * stephsv + j * channelshsv] <= hlower) + && (datahsv[(i) * stephsv + j * channelshsv] >= hupper)) { + if ((datahsv[(i) * stephsv + j * (channelshsv) + 1]) + > sthreshold) { + datamono[i * stepmono + j * channelsmono] = 255; + } else + /*A very simple concept with the loops here if the hue values are in the aforementioned range and the + threshold is met then logic one else logic zero*/ + + datamono[i * stepmono + j * channelsmono] = 0; + } + } + } + + + //crosscheck all are either black or white + for (i = 0; i < (heighthsv); i++) { + for (j = 0; j < (widthhsv); j++) { + if (!(datamono[i * stepmono + j * channelsmono] == 0 || datamono[i + * stepmono + j * channelsmono] == 255)) + datamono[i * stepmono + j * channelsmono] = 0; + } + } + + + // get rid of noise + cvErode(monoimgbot, monoimgbot, 0, erode); + cvDilate(monoimgbot, monoimgbot, 0, dialate); + + CvMemStorage* storage; + CvSeq* contour; + + // Create dynamic structure and sequence. + storage = cvCreateMemStorage(0); + contour = cvCreateSeq(CV_SEQ_ELTYPE_POINT, sizeof(CvSeq), sizeof(CvPoint), + storage); + + + cvShowImage("processed", monoimgbot); + + // Find all contours. + cvFindContours(monoimgbot, storage, &contour, sizeof(CvContour), CV_RETR_LIST, + CV_CHAIN_APPROX_NONE, cvPoint(0, 0)); + + elipse retElipse; + retElipse.total=0; + retElipse.angle=-1; + + // This cycle draw all contours and approximate it by ellipses. + for(;contour;contour = contour->h_next) + { + + + int count = contour->total; // This is number point in contour + + CvBox2D box; + + // Number point must be more than or equal to 6 (for cvFitEllipse_32f). + if (count < 6) + continue; + + CvMat* points_f = cvCreateMat(1, count, CV_32FC2 ); + CvMat points_i = cvMat(1, count, CV_32SC2, points_f->data.ptr); + cvCvtSeqToArray(contour, points_f->data.ptr, CV_WHOLE_SEQ ); + cvConvert( &points_i, points_f ); + + // Fits ellipse to current contour. + box = cvFitEllipse2(points_f); + + // Draw current contour. + //cvDrawContours(image04,contour,CV_RGB(255,255,255),CV_RGB(255,255,255),0,1,8,cvPoint(0,0)); + + // Convert ellipse data from float to integer representation. + + if(count>retElipse.total) { + + retElipse.total = count; + retElipse.angle = box.angle; + retElipse.center = cvPointFrom32f(box.center); + retElipse.size.width = cvRound(box.size.width*0.5); + retElipse.size.height = cvRound(box.size.height*0.5); + } + + cvReleaseMat(&points_f); + + } + +/* + if(retElipse.angle!=-1) { + cvLine(monoimgbot, cvPoint(monoimgbot->width / 2, monoimgbot->height / 2), + cvPoint((monoimgbot->width / 2) + (100 * (sin((-retElipse.angle) + * 3.14159265 / 180))), (monoimgbot->height / 2) + (100 + * (cos(-retElipse.angle * 3.14159265 / 180)))), + CV_RGB(0,0,255), 5); + + cvCircle(monoimgbot, cvPoint(monoimgbot->width / 2, monoimgbot->height / 2), 10, + CV_RGB(0,0,255), 10); + + // Draw ellipse. + cvEllipse(monoimgbot, retElipse.center, retElipse.size, -retElipse.angle, 0, 360, CV_RGB(255,0,255), + 1, CV_AA, 0); + + + cvCircle(monoimgbot, retElipse.center, 20, CV_RGB(0,255,0), 3); + + + } +*/ + + // Show image. HighGUI use. + + + cvReleaseImage(&colimgbot); + cvReleaseImage(&monoimgbot); + cvReleaseMemStorage(&storage); + + return retElipse; +} + +int main(int argc, char** argv) { + + cvNamedWindow("original", CV_WINDOW_AUTOSIZE); + + cvNamedWindow("processed", CV_WINDOW_AUTOSIZE); + + CvCapture* capture = cvCreateFileCapture("videos/pipe3.avi"); + //CvCapture* capture = cvCreateFileCapture("videos/ets2007pipe.avi"); + //CvCapture* capture = cvCreateFileCapture("videos/ets2007buoy.avi"); + + IplImage *frame; + + if (!capture) { + + printf("Cannot open video file!\n"); + + return (1); + + } + + + for (;;) {/*keep looping till we are out of frames...*/ + + if (!cvGrabFrame(capture)) { + + break; + + } + + + frame = cvRetrieveFrame(capture); + + if (frame == NULL) { + puts("unable to load the frame"); + return 0; + } + + elipse retElipse = finalFindPipe(frame); + + if(retElipse.angle!=-1) { + cvLine(frame, cvPoint(frame->width / 2, frame->height / 2), + cvPoint((frame->width / 2) + (100 * (sin((-retElipse.angle) + * 3.14159265 / 180))), (frame->height / 2) + (100 + * (cos(-retElipse.angle * 3.14159265 / 180)))), + CV_RGB(0,0,255), 5); + + cvCircle(frame, cvPoint(frame->width / 2, frame->height / 2), 10, + CV_RGB(0,0,255), 10); + + // Draw ellipse. + cvEllipse(frame, retElipse.center, retElipse.size, -retElipse.angle, 0, 360, CV_RGB(255,0,255), + 1, CV_AA, 0); + + + cvCircle(frame, retElipse.center, 10, CV_RGB(0,255,0), 5); + + + } + + + cvShowImage("original", frame); + + + int c = cvWaitKey(150); + if ((char) c == 27) + break; + + } + + /* free memory */ + + + cvDestroyWindow("processed"); + cvDestroyWindow("original"); + + cvReleaseCapture(&capture); + + return 0; +} + + + + Copied: vision/src/pipe.cpp (from rev 14, vision/src/test.cpp) =================================================================== --- vision/src/pipe.cpp (rev 0) +++ vision/src/pipe.cpp 2010-05-29 14:43:13 UTC (rev 15) @@ -0,0 +1,391 @@ + + +#ifdef _CH_ +#pragma package <opencv> +#endif + +#define CV_NO_BACKWARD_COMPATIBILITY + + +#include "cv.h" +#include "highgui.h" +#include <stdio.h> +#include <math.h> +#include <string.h> + + +/*the includes*/ +/*This program is not done in CVBlob library*/ +/*Purpose of the program to track the blob */ +//using namespace std; + + +/*Note:The detection algorithm is the same as the one you can find in one of my previous posts + + The same algorithm is copied from that post and pasted in this + post only the values of the "sthreshold" and the "hupper" and the "hlower" are different....*/ +//CvSeq* findSquares4(IplImage* img); +//double angle(CvPoint* pt1, CvPoint* pt2, CvPoint* pt0); +//void drawSquares(IplImage* img, CvSeq* squares); +//int findPipe(); + + +namespace pipe { + +double angle(CvPoint* pt1, CvPoint* pt2, CvPoint* pt0) { + double dx1 = pt1->x - pt0->x; + double dy1 = pt1->y - pt0->y; + double dx2 = pt2->x - pt0->x; + double dy2 = pt2->y - pt0->y; + return (dx1 * dx2 + dy1 * dy2) / sqrt((dx1 * dx1 + dy1 * dy1) * (dx2 * dx2 + + dy2 * dy2) + 1e-10); +} + +// returns sequence of squares detected on the image. +// the sequence is stored in the specified memory storage +CvSeq* findSquares4(IplImage* img) { + int thresh = 50; + CvSeq* contours; + int i, c, l, N = 11; + CvSize sz = cvSize(img->width & -2, img->height & -2); + IplImage* timg = cvCloneImage(img); // make a copy of input image + IplImage* gray = cvCreateImage(sz, 8, 1); + IplImage* pyr = cvCreateImage(cvSize(sz.width / 2, sz.height / 2), 8, 3); + IplImage* tgray; + CvSeq* result; + double s, t; + + CvMemStorage* storage = 0; + + storage = cvCreateMemStorage(0); + + // create empty sequence that will contain points - + // 4 points per square (the square's vertices) + CvSeq* squares = cvCreateSeq(0, sizeof(CvSeq), sizeof(CvPoint), storage); + + // select the maximum ROI in the image + // with the width and height divisible by 2 + cvSetImageROI(timg, cvRect(0, 0, sz.width, sz.height)); + + // down-scale and upscale the image to filter out the noise + cvPyrDown(timg, pyr, 7); + cvPyrUp(pyr, timg, 7); + tgray = cvCreateImage(sz, 8, 1); + + // find squares in every color plane of the image + for (c = 0; c < 3; c++) { + // extract the c-th color plane + cvSetImageCOI(timg, c + 1); + cvCopy(timg, tgray, 0); + + // try several threshold levels + for (l = 0; l < N; l++) { + // hack: use Canny instead of zero threshold level. + // Canny helps to catch squares with gradient shading + if (l == 0) { + // apply Canny. Take the upper threshold from slider + // and set the lower to 0 (which forces edges merging) + cvCanny(tgray, gray, 0, thresh, 5); + // dilate canny output to remove potential + // holes between edge segments + cvDilate(gray, gray, 0, 1); + } else { + // apply threshold if l!=0: + // tgray(x,y) = gray(x,y) < (l+1)*255/N ? 255 : 0 + cvThreshold(tgray, gray, (l + 1) * 255 / N, 255, + CV_THRESH_BINARY ); + } + + // find contours and store them all as a list + cvFindContours(gray, storage, &contours, sizeof(CvContour), + CV_RETR_LIST, CV_CHAIN_APPROX_SIMPLE, cvPoint(0, 0)); + + // test each contour + while (contours) { + // approximate contour with accuracy proportional + // to the contour perimeter + result = cvApproxPoly(contours, sizeof(CvContour), storage, + CV_POLY_APPROX_DP, cvContourPerimeter(contours) * 0.02, + 0); + // square contours should have 4 vertices after approximation + // relatively large area (to filter out noisy contours) + // and be convex. + // Note: absolute value of an area is used because + // area may be positive or negative - in accordance with the + // contour orientation + if (result->total == 4 + && cvContourArea(result, CV_WHOLE_SEQ, 0) > 1000 + && cvCheckContourConvexity(result)) { + s = 0; + + for (i = 0; i < 5; i++) { + // find minimum angle between joint + // edges (maximum of cosine) + if (i >= 2) { + t = fabs(angle((CvPoint*) cvGetSeqElem(result, i), + (CvPoint*) cvGetSeqElem(result, i - 2), + (CvPoint*) cvGetSeqElem(result, i - 1))); + s = s > t ? s : t; + } + } + + // if cosines of all angles are small + // (all angles are ~90 degree) then write quandrange + // vertices to resultant sequence + if (s < 0.3) + for (i = 0; i < 4; i++) + cvSeqPush(squares, (CvPoint*) cvGetSeqElem(result, + i)); + } + + // take the next contour + contours = contours->h_next; + } + } + } + + // release all the temporary images + cvReleaseImage(&gray); + cvReleaseImage(&pyr); + cvReleaseImage(&tgray); + cvReleaseImage(&timg); + cvClearMemStorage(storage); + return squares; +} + +// the function draws all the squares in the image +void drawSquares(IplImage* img, CvSeq* squares) { + CvSeqReader reader; + //IplImage* cpy = cvCloneImage( img ); + int i; + + // initialize reader of the sequence + cvStartReadSeq(squares, &reader, 0); + + // read 4 sequence elements at a time (all vertices of a square) + for (i = 0; i < squares->total; i += 4) { + CvPoint pt[4], *rect = pt; + int count = 4; + + // read 4 vertices + CV_READ_SEQ_ELEM( pt[0], reader ); + CV_READ_SEQ_ELEM( pt[1], reader ); + CV_READ_SEQ_ELEM( pt[2], reader ); + CV_READ_SEQ_ELEM( pt[3], reader ); + + // draw the square as a closed polyline + cvPolyLine(img, &rect, &count, 1, 1, CV_RGB(0,255,0), 3, CV_AA, 0); + } + + // show the resultant image + //cvReleaseImage( &cpy ); +} + +int findPipe() { + + int sthreshold = 86, erode = 4, dialate = 8; + + int hlower = 127, hupper = 25;/* + here hlower is the lower cut off and the hupper is the upper cut off for hue values of red.*/ + + cvNamedWindow("original", CV_WINDOW_AUTOSIZE); + + cvNamedWindow("processed", CV_WINDOW_AUTOSIZE); + + //cvCreateTrackbar("sthreshold", "Monochrome Of red Blob", &sthreshold, 255, 0); + //cvCreateTrackbar("hlower", "Monochrome Of red Blob", &hlower, 255, 0); + //cvCreateTrackbar("hupper", "Monochrome Of red Blob", &hupper, 255, 0); + //cvCreateTrackbar("erode", "Monochrome Of red Blob", &erode, 20, 0); + //cvCreateTrackbar("dialate", "Monochrome Of red Blob", &dialate, 20, 0); + + int i, j, k;//for iterations + int temp = 0;//if we use a temporary var + /*here lets look at the word \x93heighthsv\x94 \x85now lets breadk up this word\x85here height means + + height as a regular IplImage Structure has now the addition \x93hsv\x94 to the word heigh means this + height attribute is for the image which is color converted to the hsv,Similar conventions + for the monochrome image\x85so you may find the attribute height for the monochrome image to be + heightmono\x85So i believe it is easy\x85*/ + int heighthsv, widthhsv, stephsv, channelshsv; + int heightmono, widthmono, stepmono, channelsmono; + uchar *datahsv, *datamono; + + IplImage *frame; + IplImage *colimgbot; + + IplImage *monoimgbot; + + CvCapture* capture = cvCreateFileCapture("videos/pipe3.avi"); + //CvCapture* capture = cvCreateFileCapture("videos/ets2007pipe.avi"); + + // CvSize size = cvSize((int) cvGetCaptureProperty(capture, CV_CAP_PROP_FRAME_WIDTH), (int) cvGetCaptureProperty(capture, CV_CAP_PROP_FRAME_HEIGHT)); + + //CvVideoWriter* writer = cvCreateVideoWriter(string1, CV_FOURCC( 'D','I','V','X'), fps, size); + + /* always check */ + + if (!capture) { + + printf("Cannot open video file!\n"); + + return (1); + + } + + /* create a window for the video,one for the monochrome image and the other for the original frame */ + + //if (!cvGrabFrame(capture)) { + + //break; + + // } + + //frame = cvRetrieveFrame(capture); + + for (;;) {/*keep looping till we are out of frames...*/ + + if (!cvGrabFrame(capture)) { + + break; + + } + + /*colimgbot---means color image of the bot*/ + + frame = cvRetrieveFrame(capture); + + if (frame == NULL) { + puts("unable to load the frame"); + return 0; + } + //printf("frame loaded"); + + colimgbot = cvCreateImage(cvGetSize(frame), 8, 3); + + monoimgbot = cvCreateImage(cvGetSize(frame), 8, 1); + + cvCvtColor(frame, colimgbot, CV_RGB2HSV); + + //\x97\x97\x97\x97\x97\x97\x97\x97\x97\x97\x97\x97\x97\x97\x97\x97\x97\x97\x97\x97\x97\x97 + + heighthsv = colimgbot->height; + widthhsv = colimgbot->width; + stephsv = colimgbot->widthStep; + channelshsv = colimgbot->nChannels; + datahsv = (uchar *) colimgbot->imageData; + //\x97\x97\x97\x97\x97\x97\x97\x97\x96 + + heightmono = monoimgbot ->height; + widthmono = monoimgbot->width; + stepmono = monoimgbot->widthStep; + channelsmono = monoimgbot->nChannels; + datamono = (uchar *) monoimgbot->imageData; + + for (i = 0; i < (heighthsv); i++) { + for (j = 0; j < (widthhsv); j++) { + if ((datahsv[(i) * stephsv + j * channelshsv] <= hlower) + && (datahsv[(i) * stephsv + j * channelshsv] >= hupper)) { + if ((datahsv[(i) * stephsv + j * (channelshsv) + 1]) + > sthreshold) { + datamono[i * stepmono + j * channelsmono] = 255; + } else + /*A very simple concept with the loops here if the hue values are in the aforementioned range and the + threshold is met then logic one else logic zero*/ + + datamono[i * stepmono + j * channelsmono] = 0; + } + } + } + + for (i = 0; i < (heighthsv); i++) { + for (j = 0; j < (widthhsv); j++) { + if (!(datamono[i * stepmono + j * channelsmono] == 0 + || datamono[i * stepmono + j * channelsmono] == 255)) + datamono[i * stepmono + j * channelsmono] = 0; + } + } + + /*Just a cross chek to ensure whether all the pixels have only + either 0 or 255*/ + + /*Please check these links for the explanation of the erosion and dilation functions + + + + + http://www.dca.fee.unicamp.br/dipcourse/html-dip/c9/s4/front-page.html*/ + + /*so now the last parameter in the function indicates how many times you want to apply dilation + + or erosion*/ + + cvErode(monoimgbot, monoimgbot, 0, erode); + cvDilate(monoimgbot, monoimgbot, 0, dialate); + /*here i have experimented with the values by changing them\x85and i have found + that i come to a good result by applying erosion 6 times and dilation 15 times + you can comment/uncomment play with the values and see what is going on + Sometimes you will find the areas which are shining in the image also get detected\x85 + + Please think why and then try to post a comment the best commment would get visible on this page*/ + + int w = 0; + int countw = 0; + int h = 0; + int counth = 0; + + for (i = 0; i < (heighthsv); i++) { + for (j = 0; j < (widthhsv); j++) { + if (datamono[i * stepmono + j * channelsmono] == 255) { + + w += j; + countw++; + h += i; + counth++; + } + } + } + + if (countw != 0 && counth != 0) { + w = w / countw; + h = h / counth; + } + cvCircle(frame, cvPoint(w, h), 20, cvScalar(0, 255, 0), 1); + + //printf("w: %i, h: %i", w, h); + + cvSaveImage("testimg.png", monoimgbot); + //cvCvtColor(monoimgbot, img2, CV_GRAY2RGB); + + + IplImage * img2 = cvLoadImage("testimg.png", 1); + + drawSquares(img2, findSquares4(img2)); + + cvCircle(img2, cvPoint(w, h), 20, cvScalar(0, 255, 0), 1); + + cvShowImage("original", frame); + //cvSaveImage("red-ballmonochrome.jpg",monoimgbot);/*if you want to save the image*/ + cvShowImage("processed", img2); + int c = cvWaitKey(100); + if ((char) c == 27) + break; + /*for all the other clarifications you can check the other posts\x85. you will find an answer + People who are getting started with the Opencv must make sure you + + check the other posts on this blog*/ + } + + /* free memory */ + + //cvReleaseVideoWriter(&writer); + + cvDestroyWindow("processed"); + cvDestroyWindow("original"); + + cvReleaseCapture(&capture); + + return 0; +} +} + + Deleted: vision/src/test.cpp =================================================================== --- vision/src/test.cpp 2010-05-24 19:27:52 UTC (rev 14) +++ vision/src/test.cpp 2010-05-29 14:43:13 UTC (rev 15) @@ -1,375 +0,0 @@ -#include "iostream" -#include "stdlib.h" -#include "stdio.h" -#include "cv.h" -#include "highgui.h" -#include "cstring" - -/*the includes*/ -/*This program is not done in CVBlob library*/ -/*Purpose of the program to track the blob */ -using namespace std; - -/*Note:The detection algorithm is the same as the one you can find in one of my previous posts - - The same algorithm is copied from that post and pasted in this - post only the values of the "sthreshold" and the "hupper" and the "hlower" are different....*/ - -double angle(CvPoint* pt1, CvPoint* pt2, CvPoint* pt0) { - double dx1 = pt1->x - pt0->x; - double dy1 = pt1->y - pt0->y; - double dx2 = pt2->x - pt0->x; - double dy2 = pt2->y - pt0->y; - return (dx1 * dx2 + dy1 * dy2) / sqrt((dx1 * dx1 + dy1 * dy1) * (dx2 * dx2 - + dy2 * dy2) + 1e-10); -} - -// returns sequence of squares detected on the image. -// the sequence is stored in the specified memory storage -CvSeq* findSquares4(IplImage* img) { - int thresh = 50; - CvSeq* contours; - int i, c, l, N = 11; - CvSize sz = cvSize(img->width & -2, img->height & -2); - IplImage* timg = cvCloneImage(img); // make a copy of input image - IplImage* gray = cvCreateImage(sz, 8, 1); - IplImage* pyr = cvCreateImage(cvSize(sz.width / 2, sz.height / 2), 8, 3); - IplImage* tgray; - CvSeq* result; - double s, t; - - CvMemStorage* storage = 0; - - storage = cvCreateMemStorage(0); - - // create empty sequence that will contain points - - // 4 points per square (the square's vertices) - CvSeq* squares = cvCreateSeq(0, sizeof(CvSeq), sizeof(CvPoint), storage); - - // select the maximum ROI in the image - // with the width and height divisible by 2 - cvSetImageROI(timg, cvRect(0, 0, sz.width, sz.height)); - - // down-scale and upscale the image to filter out the noise - cvPyrDown(timg, pyr, 7); - cvPyrUp(pyr, timg, 7); - tgray = cvCreateImage(sz, 8, 1); - - // find squares in every color plane of the image - for (c = 0; c < 3; c++) { - // extract the c-th color plane - cvSetImageCOI(timg, c + 1); - cvCopy(timg, tgray, 0); - - // try several threshold levels - for (l = 0; l < N; l++) { - // hack: use Canny instead of zero threshold level. - // Canny helps to catch squares with gradient shading - if (l == 0) { - // apply Canny. Take the upper threshold from slider - // and set the lower to 0 (which forces edges merging) - cvCanny(tgray, gray, 0, thresh, 5); - // dilate canny output to remove potential - // holes between edge segments - cvDilate(gray, gray, 0, 1); - } else { - // apply threshold if l!=0: - // tgray(x,y) = gray(x,y) < (l+1)*255/N ? 255 : 0 - cvThreshold(tgray, gray, (l + 1) * 255 / N, 255, - CV_THRESH_BINARY ); - } - - // find contours and store them all as a list - cvFindContours(gray, storage, &contours, sizeof(CvContour), - CV_RETR_LIST, CV_CHAIN_APPROX_SIMPLE, cvPoint(0, 0)); - - // test each contour - while (contours) { - // approximate contour with accuracy proportional - // to the contour perimeter - result = cvApproxPoly(contours, sizeof(CvContour), storage, - CV_POLY_APPROX_DP, cvContourPerimeter(contours) * 0.02, - 0); - // square contours should have 4 vertices after approximation - // relatively large area (to filter out noisy contours) - // and be convex. - // Note: absolute value of an area is used because - // area may be positive or negative - in accordance with the - // contour orientation - if (result->total == 4 - && cvContourArea(result, CV_WHOLE_SEQ, 0) > 1000 - && cvCheckContourConvexity(result)) { - s = 0; - - for (i = 0; i < 5; i++) { - // find minimum angle between joint - // edges (maximum of cosine) - if (i >= 2) { - t = fabs(angle((CvPoint*) cvGetSeqElem(result, i), - (CvPoint*) cvGetSeqElem(result, i - 2), - (CvPoint*) cvGetSeqElem(result, i - 1))); - s = s > t ? s : t; - } - } - - // if cosines of all angles are small - // (all angles are ~90 degree) then write quandrange - // vertices to resultant sequence - if (s < 0.3) - for (i = 0; i < 4; i++) - cvSeqPush(squares, (CvPoint*) cvGetSeqElem(result, - i)); - } - - // take the next contour - contours = contours->h_next; - } - } - } - - // release all the temporary images - cvReleaseImage(&gray); - cvReleaseImage(&pyr); - cvReleaseImage(&tgray); - cvReleaseImage(&timg); - cvClearMemStorage(storage); - return squares; -} - -// the function draws all the squares in the image -void drawSquares(IplImage* img, CvSeq* squares) { - CvSeqReader reader; - //IplImage* cpy = cvCloneImage( img ); - int i; - - // initialize reader of the sequence - cvStartReadSeq(squares, &reader, 0); - - // read 4 sequence elements at a time (all vertices of a square) - for (i = 0; i < squares->total; i += 4) { - CvPoint pt[4], *rect = pt; - int count = 4; - - // read 4 vertices - CV_READ_SEQ_ELEM( pt[0], reader ); - CV_READ_SEQ_ELEM( pt[1], reader ); - CV_READ_SEQ_ELEM( pt[2], reader ); - CV_READ_SEQ_ELEM( pt[3], reader ); - - // draw the square as a closed polyline - cvPolyLine(img, &rect, &count, 1, 1, CV_RGB(0,255,0), 3, CV_AA, 0); - } - - // show the resultant image - //cvReleaseImage( &cpy ); -} - -int main(int argc, char** argv) - -{ - int sthreshold = 86, erode = 4, dialate = 8; - - int hlower = 127, hupper = 18;/* - here hlower is the lower cut off and the hupper is the upper cut off for hue values of red.*/ - - cvNamedWindow("original", CV_WINDOW_AUTOSIZE); - - cvNamedWindow("processed", CV_WINDOW_AUTOSIZE); - - //cvCreateTrackbar("sthreshold", "Monochrome Of red Blob", &sthreshold, 255, 0); - //cvCreateTrackbar("hlower", "Monochrome Of red Blob", &hlower, 255, 0); - //cvCreateTrackbar("hupper", "Monochrome Of red Blob", &hupper, 255, 0); - //cvCreateTrackbar("erode", "Monochrome Of red Blob", &erode, 20, 0); - //cvCreateTrackbar("dialate", "Monochrome Of red Blob", &dialate, 20, 0); - - int i, j, k;//for iterations - int temp = 0;//if we use a temporary var - /*here lets look at the word \x93heighthsv\x94 \x85now lets breadk up this word\x85here height means - - height as a regular IplImage Structure has now the addition \x93hsv\x94 to the word heigh means this - height attribute is for the image which is color converted to the hsv,Similar conventions - for the monochrome image\x85so you may find the attribute height for the monochrome image to be - heightmono\x85So i believe it is easy\x85*/ - int heighthsv, widthhsv, stephsv, channelshsv; - int heightmono, widthmono, stepmono, channelsmono; - uchar *datahsv, *datamono; - - IplImage *frame; - IplImage *colimgbot; - - IplImage *monoimgbot; - - CvCapture* capture = cvCreateFileCapture("videos/pipe3.avi"); - //CvCapture* capture = cvCreateFileCapture("videos/ets2007pipe.avi"); - - // CvSize size = cvSize((int) cvGetCaptureProperty(capture, CV_CAP_PROP_FRAME_WIDTH), (int) cvGetCaptureProperty(capture, CV_CAP_PROP_FRAME_HEIGHT)); - - //CvVideoWriter* writer = cvCreateVideoWriter(string1, CV_FOURCC( 'D','I','V','X'), fps, size); - - /* always check */ - - if (!capture) { - - printf("Cannot open video file!\n"); - - return (1); - - } - - /* create a window for the video,one for the monochrome image and the other for the original frame */ - - //if (!cvGrabFrame(capture)) { - - //break; - - // } - - //frame = cvRetrieveFrame(capture); - - for (;;) {/*keep looping till we are out of frames...*/ - - if (!cvGrabFrame(capture)) { - - break; - - } - - /*colimgbot---means color image of the bot*/ - - frame = cvRetrieveFrame(capture); - - if (frame == NULL) { - puts("unable to load the frame"); - exit(0); - } - //printf("frame loaded"); - - colimgbot = cvCreateImage(cvGetSize(frame), 8, 3); - - monoimgbot = cvCreateImage(cvGetSize(frame), 8, 1); - - cvCvtColor(frame, colimgbot, CV_RGB2HSV); - - //\x97\x97\x97\x97\x97\x97\x97\x97\x97\x97\x97\x97\x97\x97\x97\x97\x97\x97\x97\x97\x97\x97 - - heighthsv = colimgbot->height; - widthhsv = colimgbot->width; - stephsv = colimgbot->widthStep; - channelshsv = colimgbot->nChannels; - datahsv = (uchar *) colimgbot->imageData; - //\x97\x97\x97\x97\x97\x97\x97\x97\x96 - - heightmono = monoimgbot ->height; - widthmono = monoimgbot->width; - stepmono = monoimgbot->widthStep; - channelsmono = monoimgbot->nChannels; - datamono = (uchar *) monoimgbot->imageData; - - for (i = 0; i < (heighthsv); i++) { - for (j = 0; j < (widthhsv); j++) { - if ((datahsv[(i) * stephsv + j * channelshsv] <= hlower) - && (datahsv[(i) * stephsv + j * channelshsv] >= hupper)) { - if ((datahsv[(i) * stephsv + j * (channelshsv) + 1]) - > sthreshold) { - datamono[i * stepmono + j * channelsmono] = 255; - } else - /*A very simple concept with the loops here if the hue values are in the aforementioned range and the - threshold is met then logic one else logic zero*/ - - datamono[i * stepmono + j * channelsmono] = 0; - } - } - } - - for (i = 0; i < (heighthsv); i++) { - for (j = 0; j < (widthhsv); j++) { - if (!(datamono[i * stepmono + j * channelsmono] == 0 - || datamono[i * stepmono + j * channelsmono] == 255)) - datamono[i * stepmono + j * channelsmono] = 0; - } - } - - /*Just a cross chek to ensure whether all the pixels have only - either 0 or 255*/ - - /*Please check these links for the explanation of the erosion and dilation functions - - - - - http://www.dca.fee.unicamp.br/dipcourse/html-dip/c9/s4/front-page.html*/ - - /*so now the last parameter in the function indicates how many times you want to apply dilation - - or erosion*/ - - cvErode(monoimgbot, monoimgbot, 0, erode); - cvDilate(monoimgbot, monoimgbot, 0, dialate); - /*here i have experimented with the values by changing them\x85and i have found - that i come to a good result by applying erosion 6 times and dilation 15 times - you can comment/uncomment play with the values and see what is going on - Sometimes you will find the areas which are shining in the image also get detected\x85 - - Please think why and then try to post a comment the best commment would get visible on this page*/ - - int w = 0; - int countw = 0; - int h = 0; - int counth = 0; - - for (i = 0; i < (heighthsv); i++) { - for (j = 0; j < (widthhsv); j++) { - if (datamono[i * stepmono + j * channelsmono] == 255) { - - w += j; - countw++; - h += i; - counth++; - } - } - } - - if(countw!=0 && counth!=0) { - w = w / countw; - h = h / counth; - } - cvCircle(frame, cvPoint(w, h), 20, cvScalar(0, 255, 0), 1); - - //printf("w: %i, h: %i", w, h); - - cvSaveImage("testimg.png", monoimgbot); - //cvCvtColor(monoimgbot, img2, CV_GRAY2RGB); - - - IplImage * img2 = cvLoadImage("testimg.png", 1); - - drawSquares(img2, findSquares4(img2)); - - cvCircle(img2, cvPoint(w, h), 20, cvScalar(0, 255, 0), 1); - - cvShowImage("original", frame); - //cvSaveImage("red-ballmonochrome.jpg",monoimgbot);/*if you want to save the image*/ - cvShowImage("processed", img2); - int c = cvWaitKey(100); - if ((char) c == 27) - break; - /*for all the other clarifications you can check the other posts\x85. you will find an answer - People who are getting started with the Opencv must make sure you - - check the other posts on this blog*/ - } - - - - /* free memory */ - - //cvReleaseVideoWriter(&writer); - - cvDestroyWindow("processed"); - cvDestroyWindow("original"); - - cvReleaseCapture(&capture); - - exit(0); -} - Modified: vision/src/test2.cpp =================================================================== --- vision/src/test2.cpp 2010-05-24 19:27:52 UTC (rev 14) +++ vision/src/test2.cpp 2010-05-29 14:43:13 UTC (rev 15) @@ -7,9 +7,9 @@ #include"stdio.h" int bmain() { - int sthreshold = 68, erode = 6, dialate = 10; + int sthreshold = 68, erode = 4, dialate = 8; - int hlower = 127, hupper = 5;/* + int hlower = 127, hupper = 25;/* here hlower is the lower cut off and the hupper is the upper cut off for hue values of red.*/ cvNamedWindow("original", CV_WINDOW_AUTOSIZE); @@ -49,7 +49,9 @@ //frame = cvLoadImage("images/3dballs.jpg", 1); - frame=cvLoadImage("images/flipper.png",1); + //frame=cvLoadImage("images/flipper.png",1); + frame=cvLoadImage("images/test6.png",1); + //frame=cvLoadImage("images/pipe.png",1); if (frame == NULL) { puts("unable to load the frame"); Modified: vision/testimg.png =================================================================== (Binary files differ) This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <phi...@us...> - 2010-05-29 14:43:19
|
Revision: 15 http://robotvision.svn.sourceforge.net/robotvision/?rev=15&view=rev Author: phildavidson Date: 2010-05-29 14:43:13 +0000 (Sat, 29 May 2010) Log Message: ----------- Final Find Pipe Modified Paths: -------------- vision/images/flipper.png vision/src/test2.cpp vision/testimg.png Added Paths: ----------- vision/images/test1.PNG vision/images/test2.PNG vision/images/test3.PNG vision/images/test4.PNG vision/images/test5.PNG vision/images/test6.PNG vision/src/ellipse.cpp vision/src/main.cpp vision/src/pipe.cpp Removed Paths: ------------- vision/src/test.cpp Modified: vision/images/flipper.png =================================================================== (Binary files differ) Added: vision/images/test1.PNG =================================================================== (Binary files differ) Property changes on: vision/images/test1.PNG ___________________________________________________________________ Added: svn:mime-type + application/octet-stream Added: vision/images/test2.PNG =================================================================== (Binary files differ) Property changes on: vision/images/test2.PNG ___________________________________________________________________ Added: svn:mime-type + application/octet-stream Added: vision/images/test3.PNG =================================================================== (Binary files differ) Property changes on: vision/images/test3.PNG ___________________________________________________________________ Added: svn:mime-type + application/octet-stream Added: vision/images/test4.PNG =================================================================== (Binary files differ) Property changes on: vision/images/test4.PNG ___________________________________________________________________ Added: svn:mime-type + application/octet-stream Added: vision/images/test5.PNG =================================================================== (Binary files differ) Property changes on: vision/images/test5.PNG ___________________________________________________________________ Added: svn:mime-type + application/octet-stream Added: vision/images/test6.PNG =================================================================== (Binary files differ) Property changes on: vision/images/test6.PNG ___________________________________________________________________ Added: svn:mime-type + application/octet-stream Added: vision/src/ellipse.cpp =================================================================== --- vision/src/ellipse.cpp (rev 0) +++ vision/src/ellipse.cpp 2010-05-29 14:43:13 UTC (rev 15) @@ -0,0 +1,269 @@ +#ifdef _CH_ +#pragma package <opencv> +#endif + +#define CV_NO_BACKWARD_COMPATIBILITY + +#ifndef _EiC +#include "cv.h" +#include "highgui.h" +#include "cxcore.h" +#include "math.h" +#endif + + +typedef struct elipse { + + float angle; + int total; + CvPoint center; + CvSize size; + + +} elipse; + + + +elipse findPipe(IplImage *src) { + + int sthreshold = 86, erode = 4, dialate = 8; + + int hlower = 127, hupper = 25;/* + here hlower is the lower cut off and the hupper is the upper cut off for hue values of red.*/ + + int i, j, k;//for iterations + int temp = 0;//if we use a temporary var + + int heighthsv, widthhsv, stephsv, channelshsv; + int heightmono, widthmono, stepmono, channelsmono; + uchar *datahsv, *datamono; + + IplImage *colimgbot; + + IplImage *monoimgbot; + + //printf("frame loaded"); + + colimgbot = cvCreateImage(cvGetSize(src), 8, 3); + + monoimgbot = cvCreateImage(cvGetSize(src), 8, 1); + + cvCvtColor(src, colimgbot, CV_RGB2HSV); + + //\x97\x97\x97\x97\x97\x97\x97\x97\x97\x97\x97\x97\x97\x97\x97\x97\x97\x97\x97\x97\x97\x97 + + heighthsv = colimgbot->height; + widthhsv = colimgbot->width; + stephsv = colimgbot->widthStep; + channelshsv = colimgbot->nChannels; + datahsv = (uchar *) colimgbot->imageData; + //\x97\x97\x97\x97\x97\x97\x97\x97\x96 + + heightmono = monoimgbot ->height; + widthmono = monoimgbot->width; + stepmono = monoimgbot->widthStep; + channelsmono = monoimgbot->nChannels; + datamono = (uchar *) monoimgbot->imageData; + + for (i = 0; i < (heighthsv); i++) { + for (j = 0; j < (widthhsv); j++) { + if ((datahsv[(i) * stephsv + j * channelshsv] <= hlower) + && (datahsv[(i) * stephsv + j * channelshsv] >= hupper)) { + if ((datahsv[(i) * stephsv + j * (channelshsv) + 1]) + > sthreshold) { + datamono[i * stepmono + j * channelsmono] = 255; + } else + /*A very simple concept with the loops here if the hue values are in the aforementioned range and the + threshold is met then logic one else logic zero*/ + + datamono[i * stepmono + j * channelsmono] = 0; + } + } + } + + + //crosscheck all are either black or white + for (i = 0; i < (heighthsv); i++) { + for (j = 0; j < (widthhsv); j++) { + if (!(datamono[i * stepmono + j * channelsmono] == 0 || datamono[i + * stepmono + j * channelsmono] == 255)) + datamono[i * stepmono + j * channelsmono] = 0; + } + } + + + // get rid of noise + cvErode(monoimgbot, monoimgbot, 0, erode); + cvDilate(monoimgbot, monoimgbot, 0, dialate); + + CvMemStorage* storage; + CvSeq* contour; + + // Create dynamic structure and sequence. + storage = cvCreateMemStorage(0); + contour = cvCreateSeq(CV_SEQ_ELTYPE_POINT, sizeof(CvSeq), sizeof(CvPoint), + storage); + + + cvShowImage("processed", monoimgbot); + + // Find all contours. + cvFindContours(monoimgbot, storage, &contour, sizeof(CvContour), CV_RETR_LIST, + CV_CHAIN_APPROX_NONE, cvPoint(0, 0)); + + elipse retElipse; + retElipse.total=0; + retElipse.angle=-1; + + // This cycle draw all contours and approximate it by ellipses. + for(;contour;contour = contour->h_next) + { + + + int count = contour->total; // This is number point in contour + + CvBox2D box; + + // Number point must be more than or equal to 6 (for cvFitEllipse_32f). + if (count < 6) + continue; + + CvMat* points_f = cvCreateMat(1, count, CV_32FC2 ); + CvMat points_i = cvMat(1, count, CV_32SC2, points_f->data.ptr); + cvCvtSeqToArray(contour, points_f->data.ptr, CV_WHOLE_SEQ ); + cvConvert( &points_i, points_f ); + + // Fits ellipse to current contour. + box = cvFitEllipse2(points_f); + + // Draw current contour. + //cvDrawContours(image04,contour,CV_RGB(255,255,255),CV_RGB(255,255,255),0,1,8,cvPoint(0,0)); + + // Convert ellipse data from float to integer representation. + + if(count>retElipse.total) { + + retElipse.total = count; + retElipse.angle = box.angle; + retElipse.center = cvPointFrom32f(box.center); + retElipse.size.width = cvRound(box.size.width*0.5); + retElipse.size.height = cvRound(box.size.height*0.5); + } + + cvReleaseMat(&points_f); + + } + +/* + if(retElipse.angle!=-1) { + cvLine(monoimgbot, cvPoint(monoimgbot->width / 2, monoimgbot->height / 2), + cvPoint((monoimgbot->width / 2) + (100 * (sin((-retElipse.angle) + * 3.14159265 / 180))), (monoimgbot->height / 2) + (100 + * (cos(-retElipse.angle * 3.14159265 / 180)))), + CV_RGB(0,0,255), 5); + + cvCircle(monoimgbot, cvPoint(monoimgbot->width / 2, monoimgbot->height / 2), 10, + CV_RGB(0,0,255), 10); + + // Draw ellipse. + cvEllipse(monoimgbot, retElipse.center, retElipse.size, -retElipse.angle, 0, 360, CV_RGB(255,0,255), + 1, CV_AA, 0); + + + cvCircle(monoimgbot, retElipse.center, 20, CV_RGB(0,255,0), 3); + + + } +*/ + + // Show image. HighGUI use. + + + cvReleaseImage(&colimgbot); + cvReleaseImage(&monoimgbot); + cvReleaseMemStorage(&storage); + + return retElipse; +} + +int zmain(int argc, char** argv) { + + cvNamedWindow("original", CV_WINDOW_AUTOSIZE); + + cvNamedWindow("processed", CV_WINDOW_AUTOSIZE); + + CvCapture* capture = cvCreateFileCapture("videos/pipe3.avi"); + //CvCapture* capture = cvCreateFileCapture("videos/ets2007pipe.avi"); + //CvCapture* capture = cvCreateFileCapture("videos/ets2007buoy.avi"); + + IplImage *frame; + + if (!capture) { + + printf("Cannot open video file!\n"); + + return (1); + + } + + + for (;;) {/*keep looping till we are out of frames...*/ + + if (!cvGrabFrame(capture)) { + + break; + + } + + + frame = cvRetrieveFrame(capture); + + if (frame == NULL) { + puts("unable to load the frame"); + return 0; + } + + elipse retElipse = findPipe(frame); + + if(retElipse.angle!=-1) { + cvLine(frame, cvPoint(frame->width / 2, frame->height / 2), + cvPoint((frame->width / 2) + (100 * (sin((-retElipse.angle) + * 3.14159265 / 180))), (frame->height / 2) + (100 + * (cos(-retElipse.angle * 3.14159265 / 180)))), + CV_RGB(0,0,255), 5); + + cvCircle(frame, cvPoint(frame->width / 2, frame->height / 2), 10, + CV_RGB(0,0,255), 10); + + // Draw ellipse. + cvEllipse(frame, retElipse.center, retElipse.size, -retElipse.angle, 0, 360, CV_RGB(255,0,255), + 1, CV_AA, 0); + + + cvCircle(frame, retElipse.center, 10, CV_RGB(0,255,0), 5); + + + } + + + cvShowImage("original", frame); + + + int c = cvWaitKey(150); + if ((char) c == 27) + break; + + } + + /* free memory */ + + + cvDestroyWindow("processed"); + cvDestroyWindow("original"); + + cvReleaseCapture(&capture); + + return 0; +} + + Added: vision/src/main.cpp =================================================================== --- vision/src/main.cpp (rev 0) +++ vision/src/main.cpp 2010-05-29 14:43:13 UTC (rev 15) @@ -0,0 +1,420 @@ +#ifdef _CH_ +#pragma package <opencv> +#endif + +#define CV_NO_BACKWARD_COMPATIBILITY + +#include <cv.h> +#include <highgui.h> +#include <stdio.h> +#include <math.h> +#include <string.h> +//#include "pipe.cpp" + +using namespace std; + +//using namespace pipe; + +//the struct is what will be used to return the values in the form of an ordered pair (x,y) + + +typedef struct retValue { + + double x; + double y; + +} point; + + +typedef struct elipse { + + float angle; + int total; + CvPoint center; + CvSize size; + + +} elipse; + +//need to show the method headers +/*point findBuoy(IplImage* img); + point findPipe(IplImage* img); + point findHeading(IplImage* img); + */ + +//the convert function converts a gStreamer object to an OpenCV image +/* + + IplImage* convert(GSTBuffer gBuffer){ + + + + + } + */ + +//For the findBuoy function, the center of mass is returned as (x,y) coordinates +//center of mass will either be found by averaging white pixels in binary image +//or by fitting an ellipse around the buoy + +point findBuoy(IplImage* img) { + + point p; + p.x = 0.0; + p.y = 0.0; + + //these are the threshold values + int sthreshold = 194;//210; + double hlower = 178; + double hupper = 3; + + //create the windows: + //this is for the original image + cvNamedWindow("orig", CV_WINDOW_AUTOSIZE); + //this is for the smoothed image + cvNamedWindow("smooth", CV_WINDOW_AUTOSIZE); + //this is for the binary image (thresholding) + cvNamedWindow("binary", CV_WINDOW_AUTOSIZE); + + //display the original image + cvShowImage("orig", img); + + //we smooth the image and store the smooth img back in img + cvSmooth(img, img, CV_GAUSSIAN, 3, 3, 0, 0); + + //display the smoothed image + cvShowImage("smooth", img); + + //these are the properties of the image + //we will use them to loop through the data array (the image buffer) + int height = img->height; + int width = img->width; + int step = img->widthStep; + int nChannels = img->nChannels; + + //this is the image buffer + uchar *data = (uchar*) img->imageData; + + int i; + int j; + + for (i = 0; i < height; i++) { + + for (j = 0; j < width; j++) { + + if ((data[i * step + j * nChannels + 2] >= hlower) && (data[i + * step + j * nChannels + 2] >= hupper)) { + + if ((data[i * step + j * nChannels + 2]) > sthreshold) { + + data[i * step + j * nChannels + 0] = 255; + + data[i * step + j * nChannels + 1] = 255; + + data[i * step + j * nChannels + 2] = 255; + + } else { + data[i * step + j * nChannels + 0] = 0; + + data[i * step + j * nChannels + 1] = 0; + + data[i * step + j * nChannels + 2] = 0; + + } + + } else { + + data[i * step + j * nChannels + 0] = 0; + + data[i * step + j * nChannels + 1] = 0; + + data[i * step + j * nChannels + 2] = 0; + + } + + }//end inner for loop + + }//end outer for loop + + cvErode(img, img, 0, 6); + cvDilate(img, img, 0, 10); + + //display the binary image + cvShowImage("binary", img); + + cvWaitKey(0); + + cvDestroyWindow("orig"); + cvDestroyWindow("smooth"); + cvDestroyWindow("binary"); + + cvWaitKey(0); + + return p; + +} + +//the findHedge function will have to be used with a fake image we create +//(I suggest manipulating the buoy image and drawing a green hedge within it) +//since we don't have any ones to base ourselves on +//how are we going to return the values? Are we going to return a struct with three points, +//each corresponding to the center of each rectangle? Will it have to be done in the same way +//as finding the heading of the pipe? +//will we need to make a new struct then for this return value? + +/*point? findHedge(IplImage* img){ + + + } + */ + +//The findPipe function works in quite the same way as findBuoy + + + + +elipse finalFindPipe(IplImage *src) { + + int sthreshold = 86, erode = 4, dialate = 8; + + int hlower = 127, hupper = 25;/* + here hlower is the lower cut off and the hupper is the upper cut off for hue values of red.*/ + + int i, j, k;//for iterations + int temp = 0;//if we use a temporary var + + int heighthsv, widthhsv, stephsv, channelshsv; + int heightmono, widthmono, stepmono, channelsmono; + uchar *datahsv, *datamono; + + IplImage *colimgbot; + + IplImage *monoimgbot; + + //printf("frame loaded"); + + colimgbot = cvCreateImage(cvGetSize(src), 8, 3); + + monoimgbot = cvCreateImage(cvGetSize(src), 8, 1); + + cvCvtColor(src, colimgbot, CV_RGB2HSV); + + //\x97\x97\x97\x97\x97\x97\x97\x97\x97\x97\x97\x97\x97\x97\x97\x97\x97\x97\x97\x97\x97\x97 + + heighthsv = colimgbot->height; + widthhsv = colimgbot->width; + stephsv = colimgbot->widthStep; + channelshsv = colimgbot->nChannels; + datahsv = (uchar *) colimgbot->imageData; + //\x97\x97\x97\x97\x97\x97\x97\x97\x96 + + heightmono = monoimgbot ->height; + widthmono = monoimgbot->width; + stepmono = monoimgbot->widthStep; + channelsmono = monoimgbot->nChannels; + datamono = (uchar *) monoimgbot->imageData; + + for (i = 0; i < (heighthsv); i++) { + for (j = 0; j < (widthhsv); j++) { + if ((datahsv[(i) * stephsv + j * channelshsv] <= hlower) + && (datahsv[(i) * stephsv + j * channelshsv] >= hupper)) { + if ((datahsv[(i) * stephsv + j * (channelshsv) + 1]) + > sthreshold) { + datamono[i * stepmono + j * channelsmono] = 255; + } else + /*A very simple concept with the loops here if the hue values are in the aforementioned range and the + threshold is met then logic one else logic zero*/ + + datamono[i * stepmono + j * channelsmono] = 0; + } + } + } + + + //crosscheck all are either black or white + for (i = 0; i < (heighthsv); i++) { + for (j = 0; j < (widthhsv); j++) { + if (!(datamono[i * stepmono + j * channelsmono] == 0 || datamono[i + * stepmono + j * channelsmono] == 255)) + datamono[i * stepmono + j * channelsmono] = 0; + } + } + + + // get rid of noise + cvErode(monoimgbot, monoimgbot, 0, erode); + cvDilate(monoimgbot, monoimgbot, 0, dialate); + + CvMemStorage* storage; + CvSeq* contour; + + // Create dynamic structure and sequence. + storage = cvCreateMemStorage(0); + contour = cvCreateSeq(CV_SEQ_ELTYPE_POINT, sizeof(CvSeq), sizeof(CvPoint), + storage); + + + cvShowImage("processed", monoimgbot); + + // Find all contours. + cvFindContours(monoimgbot, storage, &contour, sizeof(CvContour), CV_RETR_LIST, + CV_CHAIN_APPROX_NONE, cvPoint(0, 0)); + + elipse retElipse; + retElipse.total=0; + retElipse.angle=-1; + + // This cycle draw all contours and approximate it by ellipses. + for(;contour;contour = contour->h_next) + { + + + int count = contour->total; // This is number point in contour + + CvBox2D box; + + // Number point must be more than or equal to 6 (for cvFitEllipse_32f). + if (count < 6) + continue; + + CvMat* points_f = cvCreateMat(1, count, CV_32FC2 ); + CvMat points_i = cvMat(1, count, CV_32SC2, points_f->data.ptr); + cvCvtSeqToArray(contour, points_f->data.ptr, CV_WHOLE_SEQ ); + cvConvert( &points_i, points_f ); + + // Fits ellipse to current contour. + box = cvFitEllipse2(points_f); + + // Draw current contour. + //cvDrawContours(image04,contour,CV_RGB(255,255,255),CV_RGB(255,255,255),0,1,8,cvPoint(0,0)); + + // Convert ellipse data from float to integer representation. + + if(count>retElipse.total) { + + retElipse.total = count; + retElipse.angle = box.angle; + retElipse.center = cvPointFrom32f(box.center); + retElipse.size.width = cvRound(box.size.width*0.5); + retElipse.size.height = cvRound(box.size.height*0.5); + } + + cvReleaseMat(&points_f); + + } + +/* + if(retElipse.angle!=-1) { + cvLine(monoimgbot, cvPoint(monoimgbot->width / 2, monoimgbot->height / 2), + cvPoint((monoimgbot->width / 2) + (100 * (sin((-retElipse.angle) + * 3.14159265 / 180))), (monoimgbot->height / 2) + (100 + * (cos(-retElipse.angle * 3.14159265 / 180)))), + CV_RGB(0,0,255), 5); + + cvCircle(monoimgbot, cvPoint(monoimgbot->width / 2, monoimgbot->height / 2), 10, + CV_RGB(0,0,255), 10); + + // Draw ellipse. + cvEllipse(monoimgbot, retElipse.center, retElipse.size, -retElipse.angle, 0, 360, CV_RGB(255,0,255), + 1, CV_AA, 0); + + + cvCircle(monoimgbot, retElipse.center, 20, CV_RGB(0,255,0), 3); + + + } +*/ + + // Show image. HighGUI use. + + + cvReleaseImage(&colimgbot); + cvReleaseImage(&monoimgbot); + cvReleaseMemStorage(&storage); + + return retElipse; +} + +int main(int argc, char** argv) { + + cvNamedWindow("original", CV_WINDOW_AUTOSIZE); + + cvNamedWindow("processed", CV_WINDOW_AUTOSIZE); + + CvCapture* capture = cvCreateFileCapture("videos/pipe3.avi"); + //CvCapture* capture = cvCreateFileCapture("videos/ets2007pipe.avi"); + //CvCapture* capture = cvCreateFileCapture("videos/ets2007buoy.avi"); + + IplImage *frame; + + if (!capture) { + + printf("Cannot open video file!\n"); + + return (1); + + } + + + for (;;) {/*keep looping till we are out of frames...*/ + + if (!cvGrabFrame(capture)) { + + break; + + } + + + frame = cvRetrieveFrame(capture); + + if (frame == NULL) { + puts("unable to load the frame"); + return 0; + } + + elipse retElipse = finalFindPipe(frame); + + if(retElipse.angle!=-1) { + cvLine(frame, cvPoint(frame->width / 2, frame->height / 2), + cvPoint((frame->width / 2) + (100 * (sin((-retElipse.angle) + * 3.14159265 / 180))), (frame->height / 2) + (100 + * (cos(-retElipse.angle * 3.14159265 / 180)))), + CV_RGB(0,0,255), 5); + + cvCircle(frame, cvPoint(frame->width / 2, frame->height / 2), 10, + CV_RGB(0,0,255), 10); + + // Draw ellipse. + cvEllipse(frame, retElipse.center, retElipse.size, -retElipse.angle, 0, 360, CV_RGB(255,0,255), + 1, CV_AA, 0); + + + cvCircle(frame, retElipse.center, 10, CV_RGB(0,255,0), 5); + + + } + + + cvShowImage("original", frame); + + + int c = cvWaitKey(150); + if ((char) c == 27) + break; + + } + + /* free memory */ + + + cvDestroyWindow("processed"); + cvDestroyWindow("original"); + + cvReleaseCapture(&capture); + + return 0; +} + + + + Copied: vision/src/pipe.cpp (from rev 14, vision/src/test.cpp) =================================================================== --- vision/src/pipe.cpp (rev 0) +++ vision/src/pipe.cpp 2010-05-29 14:43:13 UTC (rev 15) @@ -0,0 +1,391 @@ + + +#ifdef _CH_ +#pragma package <opencv> +#endif + +#define CV_NO_BACKWARD_COMPATIBILITY + + +#include "cv.h" +#include "highgui.h" +#include <stdio.h> +#include <math.h> +#include <string.h> + + +/*the includes*/ +/*This program is not done in CVBlob library*/ +/*Purpose of the program to track the blob */ +//using namespace std; + + +/*Note:The detection algorithm is the same as the one you can find in one of my previous posts + + The same algorithm is copied from that post and pasted in this + post only the values of the "sthreshold" and the "hupper" and the "hlower" are different....*/ +//CvSeq* findSquares4(IplImage* img); +//double angle(CvPoint* pt1, CvPoint* pt2, CvPoint* pt0); +//void drawSquares(IplImage* img, CvSeq* squares); +//int findPipe(); + + +namespace pipe { + +double angle(CvPoint* pt1, CvPoint* pt2, CvPoint* pt0) { + double dx1 = pt1->x - pt0->x; + double dy1 = pt1->y - pt0->y; + double dx2 = pt2->x - pt0->x; + double dy2 = pt2->y - pt0->y; + return (dx1 * dx2 + dy1 * dy2) / sqrt((dx1 * dx1 + dy1 * dy1) * (dx2 * dx2 + + dy2 * dy2) + 1e-10); +} + +// returns sequence of squares detected on the image. +// the sequence is stored in the specified memory storage +CvSeq* findSquares4(IplImage* img) { + int thresh = 50; + CvSeq* contours; + int i, c, l, N = 11; + CvSize sz = cvSize(img->width & -2, img->height & -2); + IplImage* timg = cvCloneImage(img); // make a copy of input image + IplImage* gray = cvCreateImage(sz, 8, 1); + IplImage* pyr = cvCreateImage(cvSize(sz.width / 2, sz.height / 2), 8, 3); + IplImage* tgray; + CvSeq* result; + double s, t; + + CvMemStorage* storage = 0; + + storage = cvCreateMemStorage(0); + + // create empty sequence that will contain points - + // 4 points per square (the square's vertices) + CvSeq* squares = cvCreateSeq(0, sizeof(CvSeq), sizeof(CvPoint), storage); + + // select the maximum ROI in the image + // with the width and height divisible by 2 + cvSetImageROI(timg, cvRect(0, 0, sz.width, sz.height)); + + // down-scale and upscale the image to filter out the noise + cvPyrDown(timg, pyr, 7); + cvPyrUp(pyr, timg, 7); + tgray = cvCreateImage(sz, 8, 1); + + // find squares in every color plane of the image + for (c = 0; c < 3; c++) { + // extract the c-th color plane + cvSetImageCOI(timg, c + 1); + cvCopy(timg, tgray, 0); + + // try several threshold levels + for (l = 0; l < N; l++) { + // hack: use Canny instead of zero threshold level. + // Canny helps to catch squares with gradient shading + if (l == 0) { + // apply Canny. Take the upper threshold from slider + // and set the lower to 0 (which forces edges merging) + cvCanny(tgray, gray, 0, thresh, 5); + // dilate canny output to remove potential + // holes between edge segments + cvDilate(gray, gray, 0, 1); + } else { + // apply threshold if l!=0: + // tgray(x,y) = gray(x,y) < (l+1)*255/N ? 255 : 0 + cvThreshold(tgray, gray, (l + 1) * 255 / N, 255, + CV_THRESH_BINARY ); + } + + // find contours and store them all as a list + cvFindContours(gray, storage, &contours, sizeof(CvContour), + CV_RETR_LIST, CV_CHAIN_APPROX_SIMPLE, cvPoint(0, 0)); + + // test each contour + while (contours) { + // approximate contour with accuracy proportional + // to the contour perimeter + result = cvApproxPoly(contours, sizeof(CvContour), storage, + CV_POLY_APPROX_DP, cvContourPerimeter(contours) * 0.02, + 0); + // square contours should have 4 vertices after approximation + // relatively large area (to filter out noisy contours) + // and be convex. + // Note: absolute value of an area is used because + // area may be positive or negative - in accordance with the + // contour orientation + if (result->total == 4 + && cvContourArea(result, CV_WHOLE_SEQ, 0) > 1000 + && cvCheckContourConvexity(result)) { + s = 0; + + for (i = 0; i < 5; i++) { + // find minimum angle between joint + // edges (maximum of cosine) + if (i >= 2) { + t = fabs(angle((CvPoint*) cvGetSeqElem(result, i), + (CvPoint*) cvGetSeqElem(result, i - 2), + (CvPoint*) cvGetSeqElem(result, i - 1))); + s = s > t ? s : t; + } + } + + // if cosines of all angles are small + // (all angles are ~90 degree) then write quandrange + // vertices to resultant sequence + if (s < 0.3) + for (i = 0; i < 4; i++) + cvSeqPush(squares, (CvPoint*) cvGetSeqElem(result, + i)); + } + + // take the next contour + contours = contours->h_next; + } + } + } + + // release all the temporary images + cvReleaseImage(&gray); + cvReleaseImage(&pyr); + cvReleaseImage(&tgray); + cvReleaseImage(&timg); + cvClearMemStorage(storage); + return squares; +} + +// the function draws all the squares in the image +void drawSquares(IplImage* img, CvSeq* squares) { + CvSeqReader reader; + //IplImage* cpy = cvCloneImage( img ); + int i; + + // initialize reader of the sequence + cvStartReadSeq(squares, &reader, 0); + + // read 4 sequence elements at a time (all vertices of a square) + for (i = 0; i < squares->total; i += 4) { + CvPoint pt[4], *rect = pt; + int count = 4; + + // read 4 vertices + CV_READ_SEQ_ELEM( pt[0], reader ); + CV_READ_SEQ_ELEM( pt[1], reader ); + CV_READ_SEQ_ELEM( pt[2], reader ); + CV_READ_SEQ_ELEM( pt[3], reader ); + + // draw the square as a closed polyline + cvPolyLine(img, &rect, &count, 1, 1, CV_RGB(0,255,0), 3, CV_AA, 0); + } + + // show the resultant image + //cvReleaseImage( &cpy ); +} + +int findPipe() { + + int sthreshold = 86, erode = 4, dialate = 8; + + int hlower = 127, hupper = 25;/* + here hlower is the lower cut off and the hupper is the upper cut off for hue values of red.*/ + + cvNamedWindow("original", CV_WINDOW_AUTOSIZE); + + cvNamedWindow("processed", CV_WINDOW_AUTOSIZE); + + //cvCreateTrackbar("sthreshold", "Monochrome Of red Blob", &sthreshold, 255, 0); + //cvCreateTrackbar("hlower", "Monochrome Of red Blob", &hlower, 255, 0); + //cvCreateTrackbar("hupper", "Monochrome Of red Blob", &hupper, 255, 0); + //cvCreateTrackbar("erode", "Monochrome Of red Blob", &erode, 20, 0); + //cvCreateTrackbar("dialate", "Monochrome Of red Blob", &dialate, 20, 0); + + int i, j, k;//for iterations + int temp = 0;//if we use a temporary var + /*here lets look at the word \x93heighthsv\x94 \x85now lets breadk up this word\x85here height means + + height as a regular IplImage Structure has now the addition \x93hsv\x94 to the word heigh means this + height attribute is for the image which is color converted to the hsv,Similar conventions + for the monochrome image\x85so you may find the attribute height for the monochrome image to be + heightmono\x85So i believe it is easy\x85*/ + int heighthsv, widthhsv, stephsv, channelshsv; + int heightmono, widthmono, stepmono, channelsmono; + uchar *datahsv, *datamono; + + IplImage *frame; + IplImage *colimgbot; + + IplImage *monoimgbot; + + CvCapture* capture = cvCreateFileCapture("videos/pipe3.avi"); + //CvCapture* capture = cvCreateFileCapture("videos/ets2007pipe.avi"); + + // CvSize size = cvSize((int) cvGetCaptureProperty(capture, CV_CAP_PROP_FRAME_WIDTH), (int) cvGetCaptureProperty(capture, CV_CAP_PROP_FRAME_HEIGHT)); + + //CvVideoWriter* writer = cvCreateVideoWriter(string1, CV_FOURCC( 'D','I','V','X'), fps, size); + + /* always check */ + + if (!capture) { + + printf("Cannot open video file!\n"); + + return (1); + + } + + /* create a window for the video,one for the monochrome image and the other for the original frame */ + + //if (!cvGrabFrame(capture)) { + + //break; + + // } + + //frame = cvRetrieveFrame(capture); + + for (;;) {/*keep looping till we are out of frames...*/ + + if (!cvGrabFrame(capture)) { + + break; + + } + + /*colimgbot---means color image of the bot*/ + + frame = cvRetrieveFrame(capture); + + if (frame == NULL) { + puts("unable to load the frame"); + return 0; + } + //printf("frame loaded"); + + colimgbot = cvCreateImage(cvGetSize(frame), 8, 3); + + monoimgbot = cvCreateImage(cvGetSize(frame), 8, 1); + + cvCvtColor(frame, colimgbot, CV_RGB2HSV); + + //\x97\x97\x97\x97\x97\x97\x97\x97\x97\x97\x97\x97\x97\x97\x97\x97\x97\x97\x97\x97\x97\x97 + + heighthsv = colimgbot->height; + widthhsv = colimgbot->width; + stephsv = colimgbot->widthStep; + channelshsv = colimgbot->nChannels; + datahsv = (uchar *) colimgbot->imageData; + //\x97\x97\x97\x97\x97\x97\x97\x97\x96 + + heightmono = monoimgbot ->height; + widthmono = monoimgbot->width; + stepmono = monoimgbot->widthStep; + channelsmono = monoimgbot->nChannels; + datamono = (uchar *) monoimgbot->imageData; + + for (i = 0; i < (heighthsv); i++) { + for (j = 0; j < (widthhsv); j++) { + if ((datahsv[(i) * stephsv + j * channelshsv] <= hlower) + && (datahsv[(i) * stephsv + j * channelshsv] >= hupper)) { + if ((datahsv[(i) * stephsv + j * (channelshsv) + 1]) + > sthreshold) { + datamono[i * stepmono + j * channelsmono] = 255; + } else + /*A very simple concept with the loops here if the hue values are in the aforementioned range and the + threshold is met then logic one else logic zero*/ + + datamono[i * stepmono + j * channelsmono] = 0; + } + } + } + + for (i = 0; i < (heighthsv); i++) { + for (j = 0; j < (widthhsv); j++) { + if (!(datamono[i * stepmono + j * channelsmono] == 0 + || datamono[i * stepmono + j * channelsmono] == 255)) + datamono[i * stepmono + j * channelsmono] = 0; + } + } + + /*Just a cross chek to ensure whether all the pixels have only + either 0 or 255*/ + + /*Please check these links for the explanation of the erosion and dilation functions + + + + + http://www.dca.fee.unicamp.br/dipcourse/html-dip/c9/s4/front-page.html*/ + + /*so now the last parameter in the function indicates how many times you want to apply dilation + + or erosion*/ + + cvErode(monoimgbot, monoimgbot, 0, erode); + cvDilate(monoimgbot, monoimgbot, 0, dialate); + /*here i have experimented with the values by changing them\x85and i have found + that i come to a good result by applying erosion 6 times and dilation 15 times + you can comment/uncomment play with the values and see what is going on + Sometimes you will find the areas which are shining in the image also get detected\x85 + + Please think why and then try to post a comment the best commment would get visible on this page*/ + + int w = 0; + int countw = 0; + int h = 0; + int counth = 0; + + for (i = 0; i < (heighthsv); i++) { + for (j = 0; j < (widthhsv); j++) { + if (datamono[i * stepmono + j * channelsmono] == 255) { + + w += j; + countw++; + h += i; + counth++; + } + } + } + + if (countw != 0 && counth != 0) { + w = w / countw; + h = h / counth; + } + cvCircle(frame, cvPoint(w, h), 20, cvScalar(0, 255, 0), 1); + + //printf("w: %i, h: %i", w, h); + + cvSaveImage("testimg.png", monoimgbot); + //cvCvtColor(monoimgbot, img2, CV_GRAY2RGB); + + + IplImage * img2 = cvLoadImage("testimg.png", 1); + + drawSquares(img2, findSquares4(img2)); + + cvCircle(img2, cvPoint(w, h), 20, cvScalar(0, 255, 0), 1); + + cvShowImage("original", frame); + //cvSaveImage("red-ballmonochrome.jpg",monoimgbot);/*if you want to save the image*/ + cvShowImage("processed", img2); + int c = cvWaitKey(100); + if ((char) c == 27) + break; + /*for all the other clarifications you can check the other posts\x85. you will find an answer + People who are getting started with the Opencv must make sure you + + check the other posts on this blog*/ + } + + /* free memory */ + + //cvReleaseVideoWriter(&writer); + + cvDestroyWindow("processed"); + cvDestroyWindow("original"); + + cvReleaseCapture(&capture); + + return 0; +} +} + + Deleted: vision/src/test.cpp =================================================================== --- vision/src/test.cpp 2010-05-24 19:27:52 UTC (rev 14) +++ vision/src/test.cpp 2010-05-29 14:43:13 UTC (rev 15) @@ -1,375 +0,0 @@ -#include "iostream" -#include "stdlib.h" -#include "stdio.h" -#include "cv.h" -#include "highgui.h" -#include "cstring" - -/*the includes*/ -/*This program is not done in CVBlob library*/ -/*Purpose of the program to track the blob */ -using namespace std; - -/*Note:The detection algorithm is the same as the one you can find in one of my previous posts - - The same algorithm is copied from that post and pasted in this - post only the values of the "sthreshold" and the "hupper" and the "hlower" are different....*/ - -double angle(CvPoint* pt1, CvPoint* pt2, CvPoint* pt0) { - double dx1 = pt1->x - pt0->x; - double dy1 = pt1->y - pt0->y; - double dx2 = pt2->x - pt0->x; - double dy2 = pt2->y - pt0->y; - return (dx1 * dx2 + dy1 * dy2) / sqrt((dx1 * dx1 + dy1 * dy1) * (dx2 * dx2 - + dy2 * dy2) + 1e-10); -} - -// returns sequence of squares detected on the image. -// the sequence is stored in the specified memory storage -CvSeq* findSquares4(IplImage* img) { - int thresh = 50; - CvSeq* contours; - int i, c, l, N = 11; - CvSize sz = cvSize(img->width & -2, img->height & -2); - IplImage* timg = cvCloneImage(img); // make a copy of input image - IplImage* gray = cvCreateImage(sz, 8, 1); - IplImage* pyr = cvCreateImage(cvSize(sz.width / 2, sz.height / 2), 8, 3); - IplImage* tgray; - CvSeq* result; - double s, t; - - CvMemStorage* storage = 0; - - storage = cvCreateMemStorage(0); - - // create empty sequence that will contain points - - // 4 points per square (the square's vertices) - CvSeq* squares = cvCreateSeq(0, sizeof(CvSeq), sizeof(CvPoint), storage); - - // select the maximum ROI in the image - // with the width and height divisible by 2 - cvSetImageROI(timg, cvRect(0, 0, sz.width, sz.height)); - - // down-scale and upscale the image to filter out the noise - cvPyrDown(timg, pyr, 7); - cvPyrUp(pyr, timg, 7); - tgray = cvCreateImage(sz, 8, 1); - - // find squares in every color plane of the image - for (c = 0; c < 3; c++) { - // extract the c-th color plane - cvSetImageCOI(timg, c + 1); - cvCopy(timg, tgray, 0); - - // try several threshold levels - for (l = 0; l < N; l++) { - // hack: use Canny instead of zero threshold level. - // Canny helps to catch squares with gradient shading - if (l == 0) { - // apply Canny. Take the upper threshold from slider - // and set the lower to 0 (which forces edges merging) - cvCanny(tgray, gray, 0, thresh, 5); - // dilate canny output to remove potential - // holes between edge segments - cvDilate(gray, gray, 0, 1); - } else { - // apply threshold if l!=0: - // tgray(x,y) = gray(x,y) < (l+1)*255/N ? 255 : 0 - cvThreshold(tgray, gray, (l + 1) * 255 / N, 255, - CV_THRESH_BINARY ); - } - - // find contours and store them all as a list - cvFindContours(gray, storage, &contours, sizeof(CvContour), - CV_RETR_LIST, CV_CHAIN_APPROX_SIMPLE, cvPoint(0, 0)); - - // test each contour - while (contours) { - // approximate contour with accuracy proportional - // to the contour perimeter - result = cvApproxPoly(contours, sizeof(CvContour), storage, - CV_POLY_APPROX_DP, cvContourPerimeter(contours) * 0.02, - 0); - // square contours should have 4 vertices after approximation - // relatively large area (to filter out noisy contours) - // and be convex. - // Note: absolute value of an area is used because - // area may be positive or negative - in accordance with the - // contour orientation - if (result->total == 4 - && cvContourArea(result, CV_WHOLE_SEQ, 0) > 1000 - && cvCheckContourConvexity(result)) { - s = 0; - - for (i = 0; i < 5; i++) { - // find minimum angle between joint - // edges (maximum of cosine) - if (i >= 2) { - t = fabs(angle((CvPoint*) cvGetSeqElem(result, i), - (CvPoint*) cvGetSeqElem(result, i - 2), - (CvPoint*) cvGetSeqElem(result, i - 1))); - s = s > t ? s : t; - } - } - - // if cosines of all angles are small - // (all angles are ~90 degree) then write quandrange - // vertices to resultant sequence - if (s < 0.3) - for (i = 0; i < 4; i++) - cvSeqPush(squares, (CvPoint*) cvGetSeqElem(result, - i)); - } - - // take the next contour - contours = contours->h_next; - } - } - } - - // release all the temporary images - cvReleaseImage(&gray); - cvReleaseImage(&pyr); - cvReleaseImage(&tgray); - cvReleaseImage(&timg); - cvClearMemStorage(storage); - return squares; -} - -// the function draws all the squares in the image -void drawSquares(IplImage* img, CvSeq* squares) { - CvSeqReader reader; - //IplImage* cpy = cvCloneImage( img ); - int i; - - // initialize reader of the sequence - cvStartReadSeq(squares, &reader, 0); - - // read 4 sequence elements at a time (all vertices of a square) - for (i = 0; i < squares->total; i += 4) { - CvPoint pt[4], *rect = pt; - int count = 4; - - // read 4 vertices - CV_READ_SEQ_ELEM( pt[0], reader ); - CV_READ_SEQ_ELEM( pt[1], reader ); - CV_READ_SEQ_ELEM( pt[2], reader ); - CV_READ_SEQ_ELEM( pt[3], reader ); - - // draw the square as a closed polyline - cvPolyLine(img, &rect, &count, 1, 1, CV_RGB(0,255,0), 3, CV_AA, 0); - } - - // show the resultant image - //cvReleaseImage( &cpy ); -} - -int main(int argc, char** argv) - -{ - int sthreshold = 86, erode = 4, dialate = 8; - - int hlower = 127, hupper = 18;/* - here hlower is the lower cut off and the hupper is the upper cut off for hue values of red.*/ - - cvNamedWindow("original", CV_WINDOW_AUTOSIZE); - - cvNamedWindow("processed", CV_WINDOW_AUTOSIZE); - - //cvCreateTrackbar("sthreshold", "Monochrome Of red Blob", &sthreshold, 255, 0); - //cvCreateTrackbar("hlower", "Monochrome Of red Blob", &hlower, 255, 0); - //cvCreateTrackbar("hupper", "Monochrome Of red Blob", &hupper, 255, 0); - //cvCreateTrackbar("erode", "Monochrome Of red Blob", &erode, 20, 0); - //cvCreateTrackbar("dialate", "Monochrome Of red Blob", &dialate, 20, 0); - - int i, j, k;//for iterations - int temp = 0;//if we use a temporary var - /*here lets look at the word \x93heighthsv\x94 \x85now lets breadk up this word\x85here height means - - height as a regular IplImage Structure has now the addition \x93hsv\x94 to the word heigh means this - height attribute is for the image which is color converted to the hsv,Similar conventions - for the monochrome image\x85so you may find the attribute height for the monochrome image to be - heightmono\x85So i believe it is easy\x85*/ - int heighthsv, widthhsv, stephsv, channelshsv; - int heightmono, widthmono, stepmono, channelsmono; - uchar *datahsv, *datamono; - - IplImage *frame; - IplImage *colimgbot; - - IplImage *monoimgbot; - - CvCapture* capture = cvCreateFileCapture("videos/pipe3.avi"); - //CvCapture* capture = cvCreateFileCapture("videos/ets2007pipe.avi"); - - // CvSize size = cvSize((int) cvGetCaptureProperty(capture, CV_CAP_PROP_FRAME_WIDTH), (int) cvGetCaptureProperty(capture, CV_CAP_PROP_FRAME_HEIGHT)); - - //CvVideoWriter* writer = cvCreateVideoWriter(string1, CV_FOURCC( 'D','I','V','X'), fps, size); - - /* always check */ - - if (!capture) { - - printf("Cannot open video file!\n"); - - return (1); - - } - - /* create a window for the video,one for the monochrome image and the other for the original frame */ - - //if (!cvGrabFrame(capture)) { - - //break; - - // } - - //frame = cvRetrieveFrame(capture); - - for (;;) {/*keep looping till we are out of frames...*/ - - if (!cvGrabFrame(capture)) { - - break; - - } - - /*colimgbot---means color image of the bot*/ - - frame = cvRetrieveFrame(capture); - - if (frame == NULL) { - puts("unable to load the frame"); - exit(0); - } - //printf("frame loaded"); - - colimgbot = cvCreateImage(cvGetSize(frame), 8, 3); - - monoimgbot = cvCreateImage(cvGetSize(frame), 8, 1); - - cvCvtColor(frame, colimgbot, CV_RGB2HSV); - - //\x97\x97\x97\x97\x97\x97\x97\x97\x97\x97\x97\x97\x97\x97\x97\x97\x97\x97\x97\x97\x97\x97 - - heighthsv = colimgbot->height; - widthhsv = colimgbot->width; - stephsv = colimgbot->widthStep; - channelshsv = colimgbot->nChannels; - datahsv = (uchar *) colimgbot->imageData; - //\x97\x97\x97\x97\x97\x97\x97\x97\x96 - - heightmono = monoimgbot ->height; - widthmono = monoimgbot->width; - stepmono = monoimgbot->widthStep; - channelsmono = monoimgbot->nChannels; - datamono = (uchar *) monoimgbot->imageData; - - for (i = 0; i < (heighthsv); i++) { - for (j = 0; j < (widthhsv); j++) { - if ((datahsv[(i) * stephsv + j * channelshsv] <= hlower) - && (datahsv[(i) * stephsv + j * channelshsv] >= hupper)) { - if ((datahsv[(i) * stephsv + j * (channelshsv) + 1]) - > sthreshold) { - datamono[i * stepmono + j * channelsmono] = 255; - } else - /*A very simple concept with the loops here if the hue values are in the aforementioned range and the - threshold is met then logic one else logic zero*/ - - datamono[i * stepmono + j * channelsmono] = 0; - } - } - } - - for (i = 0; i < (heighthsv); i++) { - for (j = 0; j < (widthhsv); j++) { - if (!(datamono[i * stepmono + j * channelsmono] == 0 - || datamono[i * stepmono + j * channelsmono] == 255)) - datamono[i * stepmono + j * channelsmono] = 0; - } - } - - /*Just a cross chek to ensure whether all the pixels have only - either 0 or 255*/ - - /*Please check these links for the explanation of the erosion and dilation functions - - - - - http://www.dca.fee.unicamp.br/dipcourse/html-dip/c9/s4/front-page.html*/ - - /*so now the last parameter in the function indicates how many times you want to apply dilation - - or erosion*/ - - cvErode(monoimgbot, monoimgbot, 0, erode); - cvDilate(monoimgbot, monoimgbot, 0, dialate); - /*here i have experimented with the values by changing them\x85and i have found - that i come to a good result by applying erosion 6 times and dilation 15 times - you can comment/uncomment play with the values and see what is going on - Sometimes you will find the areas which are shining in the image also get detected\x85 - - Please think why and then try to post a comment the best commment would get visible on this page*/ - - int w = 0; - int countw = 0; - int h = 0; - int counth = 0; - - for (i = 0; i < (heighthsv); i++) { - for (j = 0; j < (widthhsv); j++) { - if (datamono[i * stepmono + j * channelsmono] == 255) { - - w += j; - countw++; - h += i; - counth++; - } - } - } - - if(countw!=0 && counth!=0) { - w = w / countw; - h = h / counth; - } - cvCircle(frame, cvPoint(w, h), 20, cvScalar(0, 255, 0), 1); - - //printf("w: %i, h: %i", w, h); - - cvSaveImage("testimg.png", monoimgbot); - //cvCvtColor(monoimgbot, img2, CV_GRAY2RGB); - - - IplImage * img2 = cvLoadImage("testimg.png", 1); - - drawSquares(img2, findSquares4(img2)); - - cvCircle(img2, cvPoint(w, h), 20, cvScalar(0, 255, 0), 1); - - cvShowImage("original", frame); - //cvSaveImage("red-ballmonochrome.jpg",monoimgbot);/*if you want to save the image*/ - cvShowImage("processed", img2); - int c = cvWaitKey(100); - if ((char) c == 27) - break; - /*for all the other clarifications you can check the other posts\x85. you will find an answer - People who are getting started with the Opencv must make sure you - - check the other posts on this blog*/ - } - - - - /* free memory */ - - //cvReleaseVideoWriter(&writer); - - cvDestroyWindow("processed"); - cvDestroyWindow("original"); - - cvReleaseCapture(&capture); - - exit(0); -} - Modified: vision/src/test2.cpp =================================================================== --- vision/src/test2.cpp 2010-05-24 19:27:52 UTC (rev 14) +++ vision/src/test2.cpp 2010-05-29 14:43:13 UTC (rev 15) @@ -7,9 +7,9 @@ #include"stdio.h" int bmain() { - int sthreshold = 68, erode = 6, dialate = 10; + int sthreshold = 68, erode = 4, dialate = 8; - int hlower = 127, hupper = 5;/* + int hlower = 127, hupper = 25;/* here hlower is the lower cut off and the hupper is the upper cut off for hue values of red.*/ cvNamedWindow("original", CV_WINDOW_AUTOSIZE); @@ -49,7 +49,9 @@ //frame = cvLoadImage("images/3dballs.jpg", 1); - frame=cvLoadImage("images/flipper.png",1); + //frame=cvLoadImage("images/flipper.png",1); + frame=cvLoadImage("images/test6.png",1); + //frame=cvLoadImage("images/pipe.png",1); if (frame == NULL) { puts("unable to load the frame"); Modified: vision/testimg.png =================================================================== (Binary files differ) This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <phi...@us...> - 2010-05-31 11:17:20
|
Revision: 17 http://robotvision.svn.sourceforge.net/robotvision/?rev=17&view=rev Author: phildavidson Date: 2010-05-31 11:17:12 +0000 (Mon, 31 May 2010) Log Message: ----------- Final pipe Modified Paths: -------------- vision/src/main.cpp vision/src/test2.cpp Added Paths: ----------- vision/images/test7.PNG vision/videos/cuauvFinalForward.avi Added: vision/images/test7.PNG =================================================================== (Binary files differ) Property changes on: vision/images/test7.PNG ___________________________________________________________________ Added: svn:mime-type + application/octet-stream Modified: vision/src/main.cpp =================================================================== --- vision/src/main.cpp 2010-05-30 02:07:09 UTC (rev 16) +++ vision/src/main.cpp 2010-05-31 11:17:12 UTC (rev 17) @@ -177,9 +177,14 @@ int sthreshold = 86, erode = 4, dialate = 8; - int hlower = 127, hupper = 25;/* - here hlower is the lower cut off and the hupper is the upper cut off for hue values of red.*/ + int hlower = 127, hupper = 25; + //int sthreshold = 11, erode = 3, dialate = 6; + + //int hlower = 127, hupper = 45; + + /*here hlower is the lower cut off and the hupper is the upper cut off for hue values of red.*/ + int i, j, k;//for iterations int temp = 0;//if we use a temporary var @@ -303,7 +308,7 @@ } -/* + if(retElipse.angle!=-1) { cvLine(monoimgbot, cvPoint(monoimgbot->width / 2, monoimgbot->height / 2), cvPoint((monoimgbot->width / 2) + (100 * (sin((-retElipse.angle) @@ -323,8 +328,8 @@ } -*/ + // Show image. HighGUI use. @@ -344,6 +349,7 @@ CvCapture* capture = cvCreateFileCapture("videos/pipe3.avi"); //CvCapture* capture = cvCreateFileCapture("videos/ets2007pipe.avi"); //CvCapture* capture = cvCreateFileCapture("videos/ets2007buoy.avi"); + //CvCapture* capture = cvCreateFileCapture("videos/cuauvFinalForward.avi"); IplImage *frame; Modified: vision/src/test2.cpp =================================================================== --- vision/src/test2.cpp 2010-05-30 02:07:09 UTC (rev 16) +++ vision/src/test2.cpp 2010-05-31 11:17:12 UTC (rev 17) @@ -5,7 +5,7 @@ #include"cv.h" #include"highgui.h" #include"stdio.h" -int bmain() { +int nmain() { int sthreshold = 68, erode = 4, dialate = 8; @@ -50,8 +50,8 @@ //frame = cvLoadImage("images/3dballs.jpg", 1); //frame=cvLoadImage("images/flipper.png",1); - frame=cvLoadImage("images/test6.png",1); - //frame=cvLoadImage("images/pipe.png",1); + //frame=cvLoadImage("images/test7.png",1); + frame=cvLoadImage("images/pipe.png",1); if (frame == NULL) { puts("unable to load the frame"); Added: vision/videos/cuauvFinalForward.avi =================================================================== (Binary files differ) Property changes on: vision/videos/cuauvFinalForward.avi ___________________________________________________________________ Added: svn:mime-type + application/octet-stream This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <phi...@us...> - 2010-05-31 11:17:21
|
Revision: 17 http://robotvision.svn.sourceforge.net/robotvision/?rev=17&view=rev Author: phildavidson Date: 2010-05-31 11:17:12 +0000 (Mon, 31 May 2010) Log Message: ----------- Final pipe Modified Paths: -------------- vision/src/main.cpp vision/src/test2.cpp Added Paths: ----------- vision/images/test7.PNG vision/videos/cuauvFinalForward.avi Added: vision/images/test7.PNG =================================================================== (Binary files differ) Property changes on: vision/images/test7.PNG ___________________________________________________________________ Added: svn:mime-type + application/octet-stream Modified: vision/src/main.cpp =================================================================== --- vision/src/main.cpp 2010-05-30 02:07:09 UTC (rev 16) +++ vision/src/main.cpp 2010-05-31 11:17:12 UTC (rev 17) @@ -177,9 +177,14 @@ int sthreshold = 86, erode = 4, dialate = 8; - int hlower = 127, hupper = 25;/* - here hlower is the lower cut off and the hupper is the upper cut off for hue values of red.*/ + int hlower = 127, hupper = 25; + //int sthreshold = 11, erode = 3, dialate = 6; + + //int hlower = 127, hupper = 45; + + /*here hlower is the lower cut off and the hupper is the upper cut off for hue values of red.*/ + int i, j, k;//for iterations int temp = 0;//if we use a temporary var @@ -303,7 +308,7 @@ } -/* + if(retElipse.angle!=-1) { cvLine(monoimgbot, cvPoint(monoimgbot->width / 2, monoimgbot->height / 2), cvPoint((monoimgbot->width / 2) + (100 * (sin((-retElipse.angle) @@ -323,8 +328,8 @@ } -*/ + // Show image. HighGUI use. @@ -344,6 +349,7 @@ CvCapture* capture = cvCreateFileCapture("videos/pipe3.avi"); //CvCapture* capture = cvCreateFileCapture("videos/ets2007pipe.avi"); //CvCapture* capture = cvCreateFileCapture("videos/ets2007buoy.avi"); + //CvCapture* capture = cvCreateFileCapture("videos/cuauvFinalForward.avi"); IplImage *frame; Modified: vision/src/test2.cpp =================================================================== --- vision/src/test2.cpp 2010-05-30 02:07:09 UTC (rev 16) +++ vision/src/test2.cpp 2010-05-31 11:17:12 UTC (rev 17) @@ -5,7 +5,7 @@ #include"cv.h" #include"highgui.h" #include"stdio.h" -int bmain() { +int nmain() { int sthreshold = 68, erode = 4, dialate = 8; @@ -50,8 +50,8 @@ //frame = cvLoadImage("images/3dballs.jpg", 1); //frame=cvLoadImage("images/flipper.png",1); - frame=cvLoadImage("images/test6.png",1); - //frame=cvLoadImage("images/pipe.png",1); + //frame=cvLoadImage("images/test7.png",1); + frame=cvLoadImage("images/pipe.png",1); if (frame == NULL) { puts("unable to load the frame"); Added: vision/videos/cuauvFinalForward.avi =================================================================== (Binary files differ) Property changes on: vision/videos/cuauvFinalForward.avi ___________________________________________________________________ Added: svn:mime-type + application/octet-stream This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <bre...@us...> - 2010-06-02 03:02:32
|
Revision: 18 http://robotvision.svn.sourceforge.net/robotvision/?rev=18&view=rev Author: brendasegal Date: 2010-06-02 03:02:26 +0000 (Wed, 02 Jun 2010) Log Message: ----------- This is some stuff I added. I'll add more tomorrow and throughout the week. Modified Paths: -------------- vision/src/findBuoy.c Added Paths: ----------- vision/config/ vision/config/buoy.txt vision/config/hedge.txt vision/config/pipe.txt vision/images/buoy.jpg Removed Paths: ------------- vision/src/main.cpp Added: vision/config/buoy.txt =================================================================== --- vision/config/buoy.txt (rev 0) +++ vision/config/buoy.txt 2010-06-02 03:02:26 UTC (rev 18) @@ -0,0 +1,5 @@ +sthreshold 11 +hupper 45 +hlower 127 +erode 4 +dilate 8 \ No newline at end of file Added: vision/config/hedge.txt =================================================================== --- vision/config/hedge.txt (rev 0) +++ vision/config/hedge.txt 2010-06-02 03:02:26 UTC (rev 18) @@ -0,0 +1,5 @@ +sthreshold 0 +hupper 0 +hlower 0 +erode 0 +dilate 0 Added: vision/config/pipe.txt =================================================================== --- vision/config/pipe.txt (rev 0) +++ vision/config/pipe.txt 2010-06-02 03:02:26 UTC (rev 18) @@ -0,0 +1,5 @@ +sthreshold 86 +erode 4 +dilate 8 +hlower 127 +hupper 25 Added: vision/images/buoy.jpg =================================================================== (Binary files differ) Property changes on: vision/images/buoy.jpg ___________________________________________________________________ Added: svn:mime-type + application/octet-stream Modified: vision/src/findBuoy.c =================================================================== --- vision/src/findBuoy.c 2010-05-31 11:17:12 UTC (rev 17) +++ vision/src/findBuoy.c 2010-06-02 03:02:26 UTC (rev 18) @@ -238,8 +238,13 @@ if(strcmp(argv[1], "-v")==0){ - if (argc <= 3){ + } + + else if(strcmp(argv[1], "-v")==0){ + + if (argc <= 4){ + printf("not enough arguments\n"); return 1; Deleted: vision/src/main.cpp =================================================================== --- vision/src/main.cpp 2010-05-31 11:17:12 UTC (rev 17) +++ vision/src/main.cpp 2010-06-02 03:02:26 UTC (rev 18) @@ -1,426 +0,0 @@ -#ifdef _CH_ -#pragma package <opencv> -#endif - -#define CV_NO_BACKWARD_COMPATIBILITY - -#include <cv.h> -#include <highgui.h> -#include <stdio.h> -#include <math.h> -#include <string.h> -//#include "pipe.cpp" - -using namespace std; - -//using namespace pipe; - -//the struct is what will be used to return the values in the form of an ordered pair (x,y) - - -typedef struct retValue { - - double x; - double y; - -} point; - - -typedef struct elipse { - - float angle; - int total; - CvPoint center; - CvSize size; - - -} elipse; - -//need to show the method headers -/*point findBuoy(IplImage* img); - point findPipe(IplImage* img); - point findHeading(IplImage* img); - */ - -//the convert function converts a gStreamer object to an OpenCV image -/* - - IplImage* convert(GSTBuffer gBuffer){ - - - - - } - */ - -//For the findBuoy function, the center of mass is returned as (x,y) coordinates -//center of mass will either be found by averaging white pixels in binary image -//or by fitting an ellipse around the buoy - -point findBuoy(IplImage* img) { - - point p; - p.x = 0.0; - p.y = 0.0; - - //these are the threshold values - int sthreshold = 194;//210; - double hlower = 178; - double hupper = 3; - - //create the windows: - //this is for the original image - cvNamedWindow("orig", CV_WINDOW_AUTOSIZE); - //this is for the smoothed image - cvNamedWindow("smooth", CV_WINDOW_AUTOSIZE); - //this is for the binary image (thresholding) - cvNamedWindow("binary", CV_WINDOW_AUTOSIZE); - - //display the original image - cvShowImage("orig", img); - - //we smooth the image and store the smooth img back in img - cvSmooth(img, img, CV_GAUSSIAN, 3, 3, 0, 0); - - //display the smoothed image - cvShowImage("smooth", img); - - //these are the properties of the image - //we will use them to loop through the data array (the image buffer) - int height = img->height; - int width = img->width; - int step = img->widthStep; - int nChannels = img->nChannels; - - //this is the image buffer - uchar *data = (uchar*) img->imageData; - - int i; - int j; - - for (i = 0; i < height; i++) { - - for (j = 0; j < width; j++) { - - if ((data[i * step + j * nChannels + 2] >= hlower) && (data[i - * step + j * nChannels + 2] >= hupper)) { - - if ((data[i * step + j * nChannels + 2]) > sthreshold) { - - data[i * step + j * nChannels + 0] = 255; - - data[i * step + j * nChannels + 1] = 255; - - data[i * step + j * nChannels + 2] = 255; - - } else { - data[i * step + j * nChannels + 0] = 0; - - data[i * step + j * nChannels + 1] = 0; - - data[i * step + j * nChannels + 2] = 0; - - } - - } else { - - data[i * step + j * nChannels + 0] = 0; - - data[i * step + j * nChannels + 1] = 0; - - data[i * step + j * nChannels + 2] = 0; - - } - - }//end inner for loop - - }//end outer for loop - - cvErode(img, img, 0, 6); - cvDilate(img, img, 0, 10); - - //display the binary image - cvShowImage("binary", img); - - cvWaitKey(0); - - cvDestroyWindow("orig"); - cvDestroyWindow("smooth"); - cvDestroyWindow("binary"); - - cvWaitKey(0); - - return p; - -} - -//the findHedge function will have to be used with a fake image we create -//(I suggest manipulating the buoy image and drawing a green hedge within it) -//since we don't have any ones to base ourselves on -//how are we going to return the values? Are we going to return a struct with three points, -//each corresponding to the center of each rectangle? Will it have to be done in the same way -//as finding the heading of the pipe? -//will we need to make a new struct then for this return value? - -/*point? findHedge(IplImage* img){ - - - } - */ - -//The findPipe function works in quite the same way as findBuoy - - - - -elipse finalFindPipe(IplImage *src) { - - int sthreshold = 86, erode = 4, dialate = 8; - - int hlower = 127, hupper = 25; - - //int sthreshold = 11, erode = 3, dialate = 6; - - //int hlower = 127, hupper = 45; - - /*here hlower is the lower cut off and the hupper is the upper cut off for hue values of red.*/ - - int i, j, k;//for iterations - int temp = 0;//if we use a temporary var - - int heighthsv, widthhsv, stephsv, channelshsv; - int heightmono, widthmono, stepmono, channelsmono; - uchar *datahsv, *datamono; - - IplImage *colimgbot; - - IplImage *monoimgbot; - - //printf("frame loaded"); - - colimgbot = cvCreateImage(cvGetSize(src), 8, 3); - - monoimgbot = cvCreateImage(cvGetSize(src), 8, 1); - - cvCvtColor(src, colimgbot, CV_RGB2HSV); - - //\x97\x97\x97\x97\x97\x97\x97\x97\x97\x97\x97\x97\x97\x97\x97\x97\x97\x97\x97\x97\x97\x97 - - heighthsv = colimgbot->height; - widthhsv = colimgbot->width; - stephsv = colimgbot->widthStep; - channelshsv = colimgbot->nChannels; - datahsv = (uchar *) colimgbot->imageData; - //\x97\x97\x97\x97\x97\x97\x97\x97\x96 - - heightmono = monoimgbot ->height; - widthmono = monoimgbot->width; - stepmono = monoimgbot->widthStep; - channelsmono = monoimgbot->nChannels; - datamono = (uchar *) monoimgbot->imageData; - - for (i = 0; i < (heighthsv); i++) { - for (j = 0; j < (widthhsv); j++) { - if ((datahsv[(i) * stephsv + j * channelshsv] <= hlower) - && (datahsv[(i) * stephsv + j * channelshsv] >= hupper)) { - if ((datahsv[(i) * stephsv + j * (channelshsv) + 1]) - > sthreshold) { - datamono[i * stepmono + j * channelsmono] = 255; - } else - /*A very simple concept with the loops here if the hue values are in the aforementioned range and the - threshold is met then logic one else logic zero*/ - - datamono[i * stepmono + j * channelsmono] = 0; - } - } - } - - - //crosscheck all are either black or white - for (i = 0; i < (heighthsv); i++) { - for (j = 0; j < (widthhsv); j++) { - if (!(datamono[i * stepmono + j * channelsmono] == 0 || datamono[i - * stepmono + j * channelsmono] == 255)) - datamono[i * stepmono + j * channelsmono] = 0; - } - } - - - // get rid of noise - cvErode(monoimgbot, monoimgbot, 0, erode); - cvDilate(monoimgbot, monoimgbot, 0, dialate); - - CvMemStorage* storage; - CvSeq* contour; - - // Create dynamic structure and sequence. - storage = cvCreateMemStorage(0); - contour = cvCreateSeq(CV_SEQ_ELTYPE_POINT, sizeof(CvSeq), sizeof(CvPoint), - storage); - - - cvShowImage("processed", monoimgbot); - - // Find all contours. - cvFindContours(monoimgbot, storage, &contour, sizeof(CvContour), CV_RETR_LIST, - CV_CHAIN_APPROX_NONE, cvPoint(0, 0)); - - elipse retElipse; - retElipse.total=0; - retElipse.angle=-1; - - // This cycle draw all contours and approximate it by ellipses. - for(;contour;contour = contour->h_next) - { - - - int count = contour->total; // This is number point in contour - - CvBox2D box; - - // Number point must be more than or equal to 6 (for cvFitEllipse_32f). - if (count < 6) - continue; - - CvMat* points_f = cvCreateMat(1, count, CV_32FC2 ); - CvMat points_i = cvMat(1, count, CV_32SC2, points_f->data.ptr); - cvCvtSeqToArray(contour, points_f->data.ptr, CV_WHOLE_SEQ ); - cvConvert( &points_i, points_f ); - - // Fits ellipse to current contour. - box = cvFitEllipse2(points_f); - - // Draw current contour. - //cvDrawContours(image04,contour,CV_RGB(255,255,255),CV_RGB(255,255,255),0,1,8,cvPoint(0,0)); - - // Convert ellipse data from float to integer representation. - - if(count>retElipse.total) { - - retElipse.total = count; - retElipse.angle = box.angle; - retElipse.center = cvPointFrom32f(box.center); - retElipse.size.width = cvRound(box.size.width*0.5); - retElipse.size.height = cvRound(box.size.height*0.5); - } - - cvReleaseMat(&points_f); - - } - - - if(retElipse.angle!=-1) { - cvLine(monoimgbot, cvPoint(monoimgbot->width / 2, monoimgbot->height / 2), - cvPoint((monoimgbot->width / 2) + (100 * (sin((-retElipse.angle) - * 3.14159265 / 180))), (monoimgbot->height / 2) + (100 - * (cos(-retElipse.angle * 3.14159265 / 180)))), - CV_RGB(0,0,255), 5); - - cvCircle(monoimgbot, cvPoint(monoimgbot->width / 2, monoimgbot->height / 2), 10, - CV_RGB(0,0,255), 10); - - // Draw ellipse. - cvEllipse(monoimgbot, retElipse.center, retElipse.size, -retElipse.angle, 0, 360, CV_RGB(255,0,255), - 1, CV_AA, 0); - - - cvCircle(monoimgbot, retElipse.center, 20, CV_RGB(0,255,0), 3); - - - } - - - // Show image. HighGUI use. - - - cvReleaseImage(&colimgbot); - cvReleaseImage(&monoimgbot); - cvReleaseMemStorage(&storage); - - return retElipse; -} - -int main(int argc, char** argv) { - - cvNamedWindow("original", CV_WINDOW_AUTOSIZE); - - cvNamedWindow("processed", CV_WINDOW_AUTOSIZE); - - CvCapture* capture = cvCreateFileCapture("videos/pipe3.avi"); - //CvCapture* capture = cvCreateFileCapture("videos/ets2007pipe.avi"); - //CvCapture* capture = cvCreateFileCapture("videos/ets2007buoy.avi"); - //CvCapture* capture = cvCreateFileCapture("videos/cuauvFinalForward.avi"); - - IplImage *frame; - - if (!capture) { - - printf("Cannot open video file!\n"); - - return (1); - - } - - - for (;;) {/*keep looping till we are out of frames...*/ - - if (!cvGrabFrame(capture)) { - - break; - - } - - - frame = cvRetrieveFrame(capture); - - if (frame == NULL) { - puts("unable to load the frame"); - return 0; - } - - elipse retElipse = finalFindPipe(frame); - - if(retElipse.angle!=-1) { - cvLine(frame, cvPoint(frame->width / 2, frame->height / 2), - cvPoint((frame->width / 2) + (100 * (sin((-retElipse.angle) - * 3.14159265 / 180))), (frame->height / 2) + (100 - * (cos(-retElipse.angle * 3.14159265 / 180)))), - CV_RGB(0,0,255), 5); - - cvCircle(frame, cvPoint(frame->width / 2, frame->height / 2), 10, - CV_RGB(0,0,255), 10); - - // Draw ellipse. - cvEllipse(frame, retElipse.center, retElipse.size, -retElipse.angle, 0, 360, CV_RGB(255,0,255), - 1, CV_AA, 0); - - - cvCircle(frame, retElipse.center, 10, CV_RGB(0,255,0), 5); - - - } - - - cvShowImage("original", frame); - - - int c = cvWaitKey(150); - if ((char) c == 27) - break; - - } - - /* free memory */ - - - cvDestroyWindow("processed"); - cvDestroyWindow("original"); - - cvReleaseCapture(&capture); - - return 0; -} - - - - This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <bre...@us...> - 2010-06-02 03:02:32
|
Revision: 18 http://robotvision.svn.sourceforge.net/robotvision/?rev=18&view=rev Author: brendasegal Date: 2010-06-02 03:02:26 +0000 (Wed, 02 Jun 2010) Log Message: ----------- This is some stuff I added. I'll add more tomorrow and throughout the week. Modified Paths: -------------- vision/src/findBuoy.c Added Paths: ----------- vision/config/ vision/config/buoy.txt vision/config/hedge.txt vision/config/pipe.txt vision/images/buoy.jpg Removed Paths: ------------- vision/src/main.cpp Added: vision/config/buoy.txt =================================================================== --- vision/config/buoy.txt (rev 0) +++ vision/config/buoy.txt 2010-06-02 03:02:26 UTC (rev 18) @@ -0,0 +1,5 @@ +sthreshold 11 +hupper 45 +hlower 127 +erode 4 +dilate 8 \ No newline at end of file Added: vision/config/hedge.txt =================================================================== --- vision/config/hedge.txt (rev 0) +++ vision/config/hedge.txt 2010-06-02 03:02:26 UTC (rev 18) @@ -0,0 +1,5 @@ +sthreshold 0 +hupper 0 +hlower 0 +erode 0 +dilate 0 Added: vision/config/pipe.txt =================================================================== --- vision/config/pipe.txt (rev 0) +++ vision/config/pipe.txt 2010-06-02 03:02:26 UTC (rev 18) @@ -0,0 +1,5 @@ +sthreshold 86 +erode 4 +dilate 8 +hlower 127 +hupper 25 Added: vision/images/buoy.jpg =================================================================== (Binary files differ) Property changes on: vision/images/buoy.jpg ___________________________________________________________________ Added: svn:mime-type + application/octet-stream Modified: vision/src/findBuoy.c =================================================================== --- vision/src/findBuoy.c 2010-05-31 11:17:12 UTC (rev 17) +++ vision/src/findBuoy.c 2010-06-02 03:02:26 UTC (rev 18) @@ -238,8 +238,13 @@ if(strcmp(argv[1], "-v")==0){ - if (argc <= 3){ + } + + else if(strcmp(argv[1], "-v")==0){ + + if (argc <= 4){ + printf("not enough arguments\n"); return 1; Deleted: vision/src/main.cpp =================================================================== --- vision/src/main.cpp 2010-05-31 11:17:12 UTC (rev 17) +++ vision/src/main.cpp 2010-06-02 03:02:26 UTC (rev 18) @@ -1,426 +0,0 @@ -#ifdef _CH_ -#pragma package <opencv> -#endif - -#define CV_NO_BACKWARD_COMPATIBILITY - -#include <cv.h> -#include <highgui.h> -#include <stdio.h> -#include <math.h> -#include <string.h> -//#include "pipe.cpp" - -using namespace std; - -//using namespace pipe; - -//the struct is what will be used to return the values in the form of an ordered pair (x,y) - - -typedef struct retValue { - - double x; - double y; - -} point; - - -typedef struct elipse { - - float angle; - int total; - CvPoint center; - CvSize size; - - -} elipse; - -//need to show the method headers -/*point findBuoy(IplImage* img); - point findPipe(IplImage* img); - point findHeading(IplImage* img); - */ - -//the convert function converts a gStreamer object to an OpenCV image -/* - - IplImage* convert(GSTBuffer gBuffer){ - - - - - } - */ - -//For the findBuoy function, the center of mass is returned as (x,y) coordinates -//center of mass will either be found by averaging white pixels in binary image -//or by fitting an ellipse around the buoy - -point findBuoy(IplImage* img) { - - point p; - p.x = 0.0; - p.y = 0.0; - - //these are the threshold values - int sthreshold = 194;//210; - double hlower = 178; - double hupper = 3; - - //create the windows: - //this is for the original image - cvNamedWindow("orig", CV_WINDOW_AUTOSIZE); - //this is for the smoothed image - cvNamedWindow("smooth", CV_WINDOW_AUTOSIZE); - //this is for the binary image (thresholding) - cvNamedWindow("binary", CV_WINDOW_AUTOSIZE); - - //display the original image - cvShowImage("orig", img); - - //we smooth the image and store the smooth img back in img - cvSmooth(img, img, CV_GAUSSIAN, 3, 3, 0, 0); - - //display the smoothed image - cvShowImage("smooth", img); - - //these are the properties of the image - //we will use them to loop through the data array (the image buffer) - int height = img->height; - int width = img->width; - int step = img->widthStep; - int nChannels = img->nChannels; - - //this is the image buffer - uchar *data = (uchar*) img->imageData; - - int i; - int j; - - for (i = 0; i < height; i++) { - - for (j = 0; j < width; j++) { - - if ((data[i * step + j * nChannels + 2] >= hlower) && (data[i - * step + j * nChannels + 2] >= hupper)) { - - if ((data[i * step + j * nChannels + 2]) > sthreshold) { - - data[i * step + j * nChannels + 0] = 255; - - data[i * step + j * nChannels + 1] = 255; - - data[i * step + j * nChannels + 2] = 255; - - } else { - data[i * step + j * nChannels + 0] = 0; - - data[i * step + j * nChannels + 1] = 0; - - data[i * step + j * nChannels + 2] = 0; - - } - - } else { - - data[i * step + j * nChannels + 0] = 0; - - data[i * step + j * nChannels + 1] = 0; - - data[i * step + j * nChannels + 2] = 0; - - } - - }//end inner for loop - - }//end outer for loop - - cvErode(img, img, 0, 6); - cvDilate(img, img, 0, 10); - - //display the binary image - cvShowImage("binary", img); - - cvWaitKey(0); - - cvDestroyWindow("orig"); - cvDestroyWindow("smooth"); - cvDestroyWindow("binary"); - - cvWaitKey(0); - - return p; - -} - -//the findHedge function will have to be used with a fake image we create -//(I suggest manipulating the buoy image and drawing a green hedge within it) -//since we don't have any ones to base ourselves on -//how are we going to return the values? Are we going to return a struct with three points, -//each corresponding to the center of each rectangle? Will it have to be done in the same way -//as finding the heading of the pipe? -//will we need to make a new struct then for this return value? - -/*point? findHedge(IplImage* img){ - - - } - */ - -//The findPipe function works in quite the same way as findBuoy - - - - -elipse finalFindPipe(IplImage *src) { - - int sthreshold = 86, erode = 4, dialate = 8; - - int hlower = 127, hupper = 25; - - //int sthreshold = 11, erode = 3, dialate = 6; - - //int hlower = 127, hupper = 45; - - /*here hlower is the lower cut off and the hupper is the upper cut off for hue values of red.*/ - - int i, j, k;//for iterations - int temp = 0;//if we use a temporary var - - int heighthsv, widthhsv, stephsv, channelshsv; - int heightmono, widthmono, stepmono, channelsmono; - uchar *datahsv, *datamono; - - IplImage *colimgbot; - - IplImage *monoimgbot; - - //printf("frame loaded"); - - colimgbot = cvCreateImage(cvGetSize(src), 8, 3); - - monoimgbot = cvCreateImage(cvGetSize(src), 8, 1); - - cvCvtColor(src, colimgbot, CV_RGB2HSV); - - //\x97\x97\x97\x97\x97\x97\x97\x97\x97\x97\x97\x97\x97\x97\x97\x97\x97\x97\x97\x97\x97\x97 - - heighthsv = colimgbot->height; - widthhsv = colimgbot->width; - stephsv = colimgbot->widthStep; - channelshsv = colimgbot->nChannels; - datahsv = (uchar *) colimgbot->imageData; - //\x97\x97\x97\x97\x97\x97\x97\x97\x96 - - heightmono = monoimgbot ->height; - widthmono = monoimgbot->width; - stepmono = monoimgbot->widthStep; - channelsmono = monoimgbot->nChannels; - datamono = (uchar *) monoimgbot->imageData; - - for (i = 0; i < (heighthsv); i++) { - for (j = 0; j < (widthhsv); j++) { - if ((datahsv[(i) * stephsv + j * channelshsv] <= hlower) - && (datahsv[(i) * stephsv + j * channelshsv] >= hupper)) { - if ((datahsv[(i) * stephsv + j * (channelshsv) + 1]) - > sthreshold) { - datamono[i * stepmono + j * channelsmono] = 255; - } else - /*A very simple concept with the loops here if the hue values are in the aforementioned range and the - threshold is met then logic one else logic zero*/ - - datamono[i * stepmono + j * channelsmono] = 0; - } - } - } - - - //crosscheck all are either black or white - for (i = 0; i < (heighthsv); i++) { - for (j = 0; j < (widthhsv); j++) { - if (!(datamono[i * stepmono + j * channelsmono] == 0 || datamono[i - * stepmono + j * channelsmono] == 255)) - datamono[i * stepmono + j * channelsmono] = 0; - } - } - - - // get rid of noise - cvErode(monoimgbot, monoimgbot, 0, erode); - cvDilate(monoimgbot, monoimgbot, 0, dialate); - - CvMemStorage* storage; - CvSeq* contour; - - // Create dynamic structure and sequence. - storage = cvCreateMemStorage(0); - contour = cvCreateSeq(CV_SEQ_ELTYPE_POINT, sizeof(CvSeq), sizeof(CvPoint), - storage); - - - cvShowImage("processed", monoimgbot); - - // Find all contours. - cvFindContours(monoimgbot, storage, &contour, sizeof(CvContour), CV_RETR_LIST, - CV_CHAIN_APPROX_NONE, cvPoint(0, 0)); - - elipse retElipse; - retElipse.total=0; - retElipse.angle=-1; - - // This cycle draw all contours and approximate it by ellipses. - for(;contour;contour = contour->h_next) - { - - - int count = contour->total; // This is number point in contour - - CvBox2D box; - - // Number point must be more than or equal to 6 (for cvFitEllipse_32f). - if (count < 6) - continue; - - CvMat* points_f = cvCreateMat(1, count, CV_32FC2 ); - CvMat points_i = cvMat(1, count, CV_32SC2, points_f->data.ptr); - cvCvtSeqToArray(contour, points_f->data.ptr, CV_WHOLE_SEQ ); - cvConvert( &points_i, points_f ); - - // Fits ellipse to current contour. - box = cvFitEllipse2(points_f); - - // Draw current contour. - //cvDrawContours(image04,contour,CV_RGB(255,255,255),CV_RGB(255,255,255),0,1,8,cvPoint(0,0)); - - // Convert ellipse data from float to integer representation. - - if(count>retElipse.total) { - - retElipse.total = count; - retElipse.angle = box.angle; - retElipse.center = cvPointFrom32f(box.center); - retElipse.size.width = cvRound(box.size.width*0.5); - retElipse.size.height = cvRound(box.size.height*0.5); - } - - cvReleaseMat(&points_f); - - } - - - if(retElipse.angle!=-1) { - cvLine(monoimgbot, cvPoint(monoimgbot->width / 2, monoimgbot->height / 2), - cvPoint((monoimgbot->width / 2) + (100 * (sin((-retElipse.angle) - * 3.14159265 / 180))), (monoimgbot->height / 2) + (100 - * (cos(-retElipse.angle * 3.14159265 / 180)))), - CV_RGB(0,0,255), 5); - - cvCircle(monoimgbot, cvPoint(monoimgbot->width / 2, monoimgbot->height / 2), 10, - CV_RGB(0,0,255), 10); - - // Draw ellipse. - cvEllipse(monoimgbot, retElipse.center, retElipse.size, -retElipse.angle, 0, 360, CV_RGB(255,0,255), - 1, CV_AA, 0); - - - cvCircle(monoimgbot, retElipse.center, 20, CV_RGB(0,255,0), 3); - - - } - - - // Show image. HighGUI use. - - - cvReleaseImage(&colimgbot); - cvReleaseImage(&monoimgbot); - cvReleaseMemStorage(&storage); - - return retElipse; -} - -int main(int argc, char** argv) { - - cvNamedWindow("original", CV_WINDOW_AUTOSIZE); - - cvNamedWindow("processed", CV_WINDOW_AUTOSIZE); - - CvCapture* capture = cvCreateFileCapture("videos/pipe3.avi"); - //CvCapture* capture = cvCreateFileCapture("videos/ets2007pipe.avi"); - //CvCapture* capture = cvCreateFileCapture("videos/ets2007buoy.avi"); - //CvCapture* capture = cvCreateFileCapture("videos/cuauvFinalForward.avi"); - - IplImage *frame; - - if (!capture) { - - printf("Cannot open video file!\n"); - - return (1); - - } - - - for (;;) {/*keep looping till we are out of frames...*/ - - if (!cvGrabFrame(capture)) { - - break; - - } - - - frame = cvRetrieveFrame(capture); - - if (frame == NULL) { - puts("unable to load the frame"); - return 0; - } - - elipse retElipse = finalFindPipe(frame); - - if(retElipse.angle!=-1) { - cvLine(frame, cvPoint(frame->width / 2, frame->height / 2), - cvPoint((frame->width / 2) + (100 * (sin((-retElipse.angle) - * 3.14159265 / 180))), (frame->height / 2) + (100 - * (cos(-retElipse.angle * 3.14159265 / 180)))), - CV_RGB(0,0,255), 5); - - cvCircle(frame, cvPoint(frame->width / 2, frame->height / 2), 10, - CV_RGB(0,0,255), 10); - - // Draw ellipse. - cvEllipse(frame, retElipse.center, retElipse.size, -retElipse.angle, 0, 360, CV_RGB(255,0,255), - 1, CV_AA, 0); - - - cvCircle(frame, retElipse.center, 10, CV_RGB(0,255,0), 5); - - - } - - - cvShowImage("original", frame); - - - int c = cvWaitKey(150); - if ((char) c == 27) - break; - - } - - /* free memory */ - - - cvDestroyWindow("processed"); - cvDestroyWindow("original"); - - cvReleaseCapture(&capture); - - return 0; -} - - - - This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <luc...@us...> - 2010-06-03 03:50:31
|
Revision: 22 http://robotvision.svn.sourceforge.net/robotvision/?rev=22&view=rev Author: lucyyuan Date: 2010-06-03 03:50:24 +0000 (Thu, 03 Jun 2010) Log Message: ----------- Added AutomatedTask entity class. Modified Paths: -------------- vision/.cproject vision/config/hedge.txt vision/src/main.cpp vision/src/test2.cpp Added Paths: ----------- vision/images/wire.png vision/images/wire2.png vision/images/wire3.png vision/images/wire4.png vision/images/wire5.png vision/videos/wire2.avi Modified: vision/.cproject =================================================================== --- vision/.cproject 2010-06-03 03:37:42 UTC (rev 21) +++ vision/.cproject 2010-06-03 03:50:24 UTC (rev 22) @@ -60,7 +60,7 @@ </folderInfo> <sourceEntries> <entry excluding="src" flags="VALUE_WORKSPACE_PATH|RESOLVED" kind="sourcePath" name=""/> -<entry flags="VALUE_WORKSPACE_PATH|RESOLVED" kind="sourcePath" name="src"/> +<entry excluding="ellipse.cpp|findBuoy.c|pipe.cpp|squares.c" flags="VALUE_WORKSPACE_PATH" kind="sourcePath" name="src"/> </sourceEntries> </configuration> </storageModule> @@ -607,7 +607,7 @@ <tool id="cdt.managedbuild.tool.gnu.cpp.compiler.mingw.exe.release.1039220343" name="GCC C++ Compiler" superClass="cdt.managedbuild.tool.gnu.cpp.compiler.mingw.exe.release"> <option id="gnu.cpp.compiler.mingw.exe.release.option.optimization.level.630178120" name="Optimization Level" superClass="gnu.cpp.compiler.mingw.exe.release.option.optimization.level" value="gnu.cpp.compiler.optimization.level.most" valueType="enumerated"/> <option id="gnu.cpp.compiler.mingw.exe.release.option.debugging.level.1662296820" name="Debug Level" superClass="gnu.cpp.compiler.mingw.exe.release.option.debugging.level" value="gnu.cpp.compiler.debugging.level.none" valueType="enumerated"/> -<option id="gnu.cpp.compiler.option.include.paths.1558332788" superClass="gnu.cpp.compiler.option.include.paths" valueType="includePath"> +<option id="gnu.cpp.compiler.option.include.paths.1558332788" name="Include paths (-I)" superClass="gnu.cpp.compiler.option.include.paths" valueType="includePath"> <listOptionValue builtIn="false" value=""C:\OpenCV2.1\include\opencv""/> </option> <inputType id="cdt.managedbuild.tool.gnu.cpp.compiler.input.394920570" superClass="cdt.managedbuild.tool.gnu.cpp.compiler.input"/> @@ -615,21 +615,21 @@ <tool id="cdt.managedbuild.tool.gnu.c.compiler.mingw.exe.release.1960648874" name="GCC C Compiler" superClass="cdt.managedbuild.tool.gnu.c.compiler.mingw.exe.release"> <option defaultValue="gnu.c.optimization.level.most" id="gnu.c.compiler.mingw.exe.release.option.optimization.level.201552392" name="Optimization Level" superClass="gnu.c.compiler.mingw.exe.release.option.optimization.level" valueType="enumerated"/> <option id="gnu.c.compiler.mingw.exe.release.option.debugging.level.89770317" name="Debug Level" superClass="gnu.c.compiler.mingw.exe.release.option.debugging.level" value="gnu.c.debugging.level.none" valueType="enumerated"/> -<option id="gnu.c.compiler.option.include.paths.1683514941" superClass="gnu.c.compiler.option.include.paths" valueType="includePath"> +<option id="gnu.c.compiler.option.include.paths.1683514941" name="Include paths (-I)" superClass="gnu.c.compiler.option.include.paths" valueType="includePath"> <listOptionValue builtIn="false" value=""C:\OpenCV2.1\include\opencv""/> </option> <inputType id="cdt.managedbuild.tool.gnu.c.compiler.input.425612201" superClass="cdt.managedbuild.tool.gnu.c.compiler.input"/> </tool> <tool id="cdt.managedbuild.tool.gnu.c.linker.mingw.exe.release.1609582156" name="MinGW C Linker" superClass="cdt.managedbuild.tool.gnu.c.linker.mingw.exe.release"/> <tool id="cdt.managedbuild.tool.gnu.cpp.linker.mingw.exe.release.1364150050" name="MinGW C++ Linker" superClass="cdt.managedbuild.tool.gnu.cpp.linker.mingw.exe.release"> -<option id="gnu.cpp.link.option.libs.1043700432" superClass="gnu.cpp.link.option.libs" valueType="libs"> +<option id="gnu.cpp.link.option.libs.1043700432" name="Libraries (-l)" superClass="gnu.cpp.link.option.libs" valueType="libs"> <listOptionValue builtIn="false" value="cv210"/> <listOptionValue builtIn="false" value="cvaux210"/> <listOptionValue builtIn="false" value="cxcore210"/> <listOptionValue builtIn="false" value="highgui210"/> <listOptionValue builtIn="false" value="ml210"/> </option> -<option id="gnu.cpp.link.option.paths.452181845" superClass="gnu.cpp.link.option.paths" valueType="libPaths"> +<option id="gnu.cpp.link.option.paths.452181845" name="Library search path (-L)" superClass="gnu.cpp.link.option.paths" valueType="libPaths"> <listOptionValue builtIn="false" value=""C:\OpenCV2.1\bin""/> </option> <inputType id="cdt.managedbuild.tool.gnu.cpp.linker.input.162577737" superClass="cdt.managedbuild.tool.gnu.cpp.linker.input"> Modified: vision/config/hedge.txt =================================================================== --- vision/config/hedge.txt 2010-06-03 03:37:42 UTC (rev 21) +++ vision/config/hedge.txt 2010-06-03 03:50:24 UTC (rev 22) @@ -1,5 +1,5 @@ -sthreshold 0 -hupper 0 -hlower 0 -erode 0 -dilate 0 +sthreshold 158 +hlower 60 +hupper 43 +erode 1 +dilate 5 Added: vision/images/wire.png =================================================================== (Binary files differ) Property changes on: vision/images/wire.png ___________________________________________________________________ Added: svn:mime-type + application/octet-stream Added: vision/images/wire2.png =================================================================== (Binary files differ) Property changes on: vision/images/wire2.png ___________________________________________________________________ Added: svn:mime-type + application/octet-stream Added: vision/images/wire3.png =================================================================== (Binary files differ) Property changes on: vision/images/wire3.png ___________________________________________________________________ Added: svn:mime-type + application/octet-stream Added: vision/images/wire4.png =================================================================== (Binary files differ) Property changes on: vision/images/wire4.png ___________________________________________________________________ Added: svn:mime-type + application/octet-stream Added: vision/images/wire5.png =================================================================== (Binary files differ) Property changes on: vision/images/wire5.png ___________________________________________________________________ Added: svn:mime-type + application/octet-stream Modified: vision/src/main.cpp =================================================================== --- vision/src/main.cpp 2010-06-03 03:37:42 UTC (rev 21) +++ vision/src/main.cpp 2010-06-03 03:50:24 UTC (rev 22) @@ -34,7 +34,6 @@ CvPoint center; CvSize size; - } elipse; int sthresholdbuoy=0, hupperbuoy=0, hlowerbuoy=0, erodebuoy=0, dilatebuoy=0; @@ -345,17 +344,166 @@ //as finding the heading of the pipe? //will we need to make a new struct then for this return value? -/*point? findHedge(IplImage* img){ +elipse findHedge(IplImage *src) { + int i, j, k;//for iterations + int temp = 0;//if we use a temporary var - } - */ + int heighthsv, widthhsv, stephsv, channelshsv; + int heightmono, widthmono, stepmono, channelsmono; + uchar *datahsv, *datamono; -//The findPipe function works in quite the same way as findBuoy + IplImage *colimgbot; + IplImage *monoimgbot; + //printf("frame loaded"); + colimgbot = cvCreateImage(cvGetSize(src), 8, 3); + monoimgbot = cvCreateImage(cvGetSize(src), 8, 1); + + cvCvtColor(src, colimgbot, CV_RGB2HSV); + + //\x97\x97\x97\x97\x97\x97\x97\x97\x97\x97\x97\x97\x97\x97\x97\x97\x97\x97\x97\x97\x97\x97 + + heighthsv = colimgbot->height; + widthhsv = colimgbot->width; + stephsv = colimgbot->widthStep; + channelshsv = colimgbot->nChannels; + datahsv = (uchar *) colimgbot->imageData; + //\x97\x97\x97\x97\x97\x97\x97\x97\x96 + + heightmono = monoimgbot ->height; + widthmono = monoimgbot->width; + stepmono = monoimgbot->widthStep; + channelsmono = monoimgbot->nChannels; + datamono = (uchar *) monoimgbot->imageData; + + for (i = 0; i < (heighthsv); i++) { + for (j = 0; j < (widthhsv); j++) { + if ((datahsv[(i) * stephsv + j * channelshsv] <= hlowerhedge) + && (datahsv[(i) * stephsv + j * channelshsv] >= hupperhedge)) { + if ((datahsv[(i) * stephsv + j * (channelshsv) + 1]) + > sthresholdhedge) { + datamono[i * stepmono + j * channelsmono] = 255; + } else + /*A very simple concept with the loops here if the hue values are in the aforementioned range and the + threshold is met then logic one else logic zero*/ + + datamono[i * stepmono + j * channelsmono] = 0; + } + } + } + + + //crosscheck all are either black or white + for (i = 0; i < (heighthsv); i++) { + for (j = 0; j < (widthhsv); j++) { + if (!(datamono[i * stepmono + j * channelsmono] == 0 || datamono[i + * stepmono + j * channelsmono] == 255)) + datamono[i * stepmono + j * channelsmono] = 0; + } + } + + + // get rid of noise + cvErode(monoimgbot, monoimgbot, 0, erodehedge); + cvDilate(monoimgbot, monoimgbot, 0, dilatehedge); + + CvMemStorage* storage; + CvSeq* contour; + + // Create dynamic structure and sequence. + storage = cvCreateMemStorage(0); + contour = cvCreateSeq(CV_SEQ_ELTYPE_POINT, sizeof(CvSeq), sizeof(CvPoint), + storage); + + + cvShowImage("processed", monoimgbot); + + // Find all contours. + cvFindContours(monoimgbot, storage, &contour, sizeof(CvContour), CV_RETR_LIST, + CV_CHAIN_APPROX_NONE, cvPoint(0, 0)); + + elipse retElipse; + retElipse.total=0; + retElipse.angle=-1; + + // This cycle draw all contours and approximate it by ellipses. + for(;contour;contour = contour->h_next) + { + + + int count = contour->total; // This is number point in contour + + CvBox2D box; + + // Number point must be more than or equal to 6 (for cvFitEllipse_32f). + if (count < 6) + continue; + + CvMat* points_f = cvCreateMat(1, count, CV_32FC2 ); + CvMat points_i = cvMat(1, count, CV_32SC2, points_f->data.ptr); + cvCvtSeqToArray(contour, points_f->data.ptr, CV_WHOLE_SEQ ); + cvConvert( &points_i, points_f ); + + // Fits ellipse to current contour. + box = cvFitEllipse2(points_f); + + // Draw current contour. + //cvDrawContours(image04,contour,CV_RGB(255,255,255),CV_RGB(255,255,255),0,1,8,cvPoint(0,0)); + + // Convert ellipse data from float to integer representation. + + if(count>retElipse.total) { + + retElipse.total = count; + retElipse.angle = box.angle; + retElipse.center = cvPointFrom32f(box.center); + retElipse.size.width = cvRound(box.size.width*0.5); + retElipse.size.height = cvRound(box.size.height*0.5); + } + + cvReleaseMat(&points_f); + + } + + + if(retElipse.angle!=-1) { +// cvLine(monoimgbot, cvPoint(monoimgbot->width / 2, monoimgbot->height / 2), +// cvPoint((monoimgbot->width / 2) + (100 * (sin((-retElipse.angle) +// * 3.14159265 / 180))), (monoimgbot->height / 2) + (100 +// * (cos(-retElipse.angle * 3.14159265 / 180)))), +// CV_RGB(0,0,255), 5); + +// cvCircle(monoimgbot, cvPoint(monoimgbot->width / 2, monoimgbot->height / 2), 10, +// CV_RGB(0,0,255), 10); + + // Draw ellipse. + cvEllipse(monoimgbot, retElipse.center, retElipse.size, -retElipse.angle, 0, 360, CV_RGB(255,0,255), + 1, CV_AA, 0); + + + cvCircle(monoimgbot, retElipse.center, 20, CV_RGB(0,255,0), 3); + + + } + + + // Show image. HighGUI use. + + + cvReleaseImage(&colimgbot); + cvReleaseImage(&monoimgbot); + cvReleaseMemStorage(&storage); + + return retElipse; +} + +//The findPipe function works in quite the same way as findBuoy + + elipse finalFindPipe(IplImage *src) { //int sthreshold = 86, erode = 4, dialate = 8; @@ -560,9 +708,6 @@ for (;;) { - - - i = j = k = 0;/*initializing the iteraiton variables to be zero*/ @@ -678,6 +823,9 @@ finalFindPipe(image); } + else if (strcmp(functionName, "findHedge") == 0) { + findHedge(image); + } cvWaitKey(0); @@ -739,6 +887,9 @@ retElipse = finalFindPipe(frame); } + else if (strcmp("findHedge", functionName) == 0) { + retElipse = findHedge(frame); + } if(retElipse.angle!=-1) { cvLine(frame, cvPoint(frame->width / 2, frame->height / 2), @@ -786,19 +937,6 @@ int main(int argc, char** argv) { - - //this part is for the reading of the config files - //thus setting the threshold values on the fly - readFile("config/buoy.txt", 1); - readFile("config/pipe.txt", 2); - //readFile("config/hedge.txt", 3); - - - //playVideo("finalFindPipe", "videos/pipe3.avi"); - //showImage("findBuoy", "images/buoy.jpg"); - //playVideo("finalFindPipe", "videos/ets2007buoy.avi"); - //playVideo("findBuoy", "videos/ets2007buoy.avi"); - if(argc<=1){ char readuser[100]; @@ -880,7 +1018,6 @@ } - } else if(strcmp(readuser, "4")==0){ @@ -902,18 +1039,15 @@ } - }//end while - - - - - - } else{ + readFile("config/buoy.txt", 1); + readFile("config/pipe.txt", 2); + readFile("config/hedge.txt", 3); + if(strcmp(argv[1], "-v")==0){ //then the person wants to play a video @@ -969,15 +1103,7 @@ } - - } - - return 0; } - - - - Modified: vision/src/test2.cpp =================================================================== --- vision/src/test2.cpp 2010-06-03 03:37:42 UTC (rev 21) +++ vision/src/test2.cpp 2010-06-03 03:50:24 UTC (rev 22) @@ -5,13 +5,71 @@ #include"cv.h" #include"highgui.h" #include"stdio.h" + +#define CONFIG "config/hedge.txt" +#define IMAGE "images/wire5.png" + +int sthreshold=0, hupper=0, hlower=0, erode=0, dilate=0; + +void readFile(char* filename){ + + FILE* filereader; + + filereader = fopen(filename, "r"); + char line[100]; + char* line2 = (char*)malloc(sizeof(char)*100); + + char var[100]; + char value[100]; + + if(filereader!=NULL){ + + while(fgets(line, sizeof(line), filereader)!=NULL){ + + strcpy(line2, line); + strcpy(var,""); + strcpy(value,""); + + sscanf(line, "%s %s", var, value); + + if(strncmp("sthreshold ", line, 11)==0) + sthreshold=atoi(value); + else if(strncmp("hupper ", line, 7)==0) + hupper=atoi(value); + else if(strncmp("hlower ", line, 7)==0) + hlower=atoi(value); + else if(strncmp("erode ", line, 6)==0) + erode=atoi(value); + else if(strncmp("dilate ", line, 7)==0) + dilate=atoi(value); + + }//end while + + } + else{ + + printf("Can't read from file.\n"); + } +} + +void saveFile(char* filename) { + FILE* filewriter; + + filewriter = fopen(filename, "w"); + + if(filewriter!=NULL){ + fprintf(filewriter, "sthreshold %d\n", sthreshold); + fprintf(filewriter, "hlower %d\n", hlower); + fprintf(filewriter, "hupper %d\n", hupper); + fprintf(filewriter, "erode %d\n", erode); + fprintf(filewriter, "dilate %d\n", dilate); + } +} + int nmain() { - int sthreshold = 68, erode = 4, dialate = 8; + readFile(CONFIG); - int hlower = 127, hupper = 25;/* - here hlower is the lower cut off and the hupper is the upper cut off for hue values of red.*/ - cvNamedWindow("original", CV_WINDOW_AUTOSIZE); cvNamedWindow("Monochrome Of red Blob", CV_WINDOW_AUTOSIZE); @@ -21,7 +79,7 @@ cvCreateTrackbar("hlower", "Monochrome Of red Blob", &hlower, 255, 0); cvCreateTrackbar("hupper", "Monochrome Of red Blob", &hupper, 255, 0); cvCreateTrackbar("erode", "Monochrome Of red Blob", &erode, 20, 0); - cvCreateTrackbar("dialate", "Monochrome Of red Blob", &dialate, 20, 0); + cvCreateTrackbar("dilate", "Monochrome Of red Blob", &dilate, 20, 0); int i, j, k;//for iterations int temp = 0;//if we use a temporary var @@ -42,16 +100,13 @@ for (;;) { - - - i = j = k = 0;/*initializing the iteraiton variables to be zero*/ //frame = cvLoadImage("images/3dballs.jpg", 1); //frame=cvLoadImage("images/flipper.png",1); //frame=cvLoadImage("images/test7.png",1); - frame=cvLoadImage("images/pipe.png",1); + frame=cvLoadImage(IMAGE, 1); if (frame == NULL) { puts("unable to load the frame"); @@ -111,7 +166,7 @@ or erosion*/ cvErode(monoimgbot, monoimgbot, 0, erode); - cvDilate(monoimgbot, monoimgbot, 0, dialate); + cvDilate(monoimgbot, monoimgbot, 0, dilate); /*here i have experimented with the values by changing them\x85and i have found that i come to a good result by applying erosion 6 times and dilation 15 times you can comment/uncomment play with the values and see what is going on @@ -132,5 +187,8 @@ } cvDestroyWindow("Monochrome Of red Blob"); cvDestroyWindow("original"); + + saveFile(CONFIG); + return 0; } Added: vision/videos/wire2.avi =================================================================== (Binary files differ) Property changes on: vision/videos/wire2.avi ___________________________________________________________________ Added: svn:mime-type + application/octet-stream This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <luc...@us...> - 2010-06-03 03:50:31
|
Revision: 22 http://robotvision.svn.sourceforge.net/robotvision/?rev=22&view=rev Author: lucyyuan Date: 2010-06-03 03:50:24 +0000 (Thu, 03 Jun 2010) Log Message: ----------- Added AutomatedTask entity class. Modified Paths: -------------- vision/.cproject vision/config/hedge.txt vision/src/main.cpp vision/src/test2.cpp Added Paths: ----------- vision/images/wire.png vision/images/wire2.png vision/images/wire3.png vision/images/wire4.png vision/images/wire5.png vision/videos/wire2.avi Modified: vision/.cproject =================================================================== --- vision/.cproject 2010-06-03 03:37:42 UTC (rev 21) +++ vision/.cproject 2010-06-03 03:50:24 UTC (rev 22) @@ -60,7 +60,7 @@ </folderInfo> <sourceEntries> <entry excluding="src" flags="VALUE_WORKSPACE_PATH|RESOLVED" kind="sourcePath" name=""/> -<entry flags="VALUE_WORKSPACE_PATH|RESOLVED" kind="sourcePath" name="src"/> +<entry excluding="ellipse.cpp|findBuoy.c|pipe.cpp|squares.c" flags="VALUE_WORKSPACE_PATH" kind="sourcePath" name="src"/> </sourceEntries> </configuration> </storageModule> @@ -607,7 +607,7 @@ <tool id="cdt.managedbuild.tool.gnu.cpp.compiler.mingw.exe.release.1039220343" name="GCC C++ Compiler" superClass="cdt.managedbuild.tool.gnu.cpp.compiler.mingw.exe.release"> <option id="gnu.cpp.compiler.mingw.exe.release.option.optimization.level.630178120" name="Optimization Level" superClass="gnu.cpp.compiler.mingw.exe.release.option.optimization.level" value="gnu.cpp.compiler.optimization.level.most" valueType="enumerated"/> <option id="gnu.cpp.compiler.mingw.exe.release.option.debugging.level.1662296820" name="Debug Level" superClass="gnu.cpp.compiler.mingw.exe.release.option.debugging.level" value="gnu.cpp.compiler.debugging.level.none" valueType="enumerated"/> -<option id="gnu.cpp.compiler.option.include.paths.1558332788" superClass="gnu.cpp.compiler.option.include.paths" valueType="includePath"> +<option id="gnu.cpp.compiler.option.include.paths.1558332788" name="Include paths (-I)" superClass="gnu.cpp.compiler.option.include.paths" valueType="includePath"> <listOptionValue builtIn="false" value=""C:\OpenCV2.1\include\opencv""/> </option> <inputType id="cdt.managedbuild.tool.gnu.cpp.compiler.input.394920570" superClass="cdt.managedbuild.tool.gnu.cpp.compiler.input"/> @@ -615,21 +615,21 @@ <tool id="cdt.managedbuild.tool.gnu.c.compiler.mingw.exe.release.1960648874" name="GCC C Compiler" superClass="cdt.managedbuild.tool.gnu.c.compiler.mingw.exe.release"> <option defaultValue="gnu.c.optimization.level.most" id="gnu.c.compiler.mingw.exe.release.option.optimization.level.201552392" name="Optimization Level" superClass="gnu.c.compiler.mingw.exe.release.option.optimization.level" valueType="enumerated"/> <option id="gnu.c.compiler.mingw.exe.release.option.debugging.level.89770317" name="Debug Level" superClass="gnu.c.compiler.mingw.exe.release.option.debugging.level" value="gnu.c.debugging.level.none" valueType="enumerated"/> -<option id="gnu.c.compiler.option.include.paths.1683514941" superClass="gnu.c.compiler.option.include.paths" valueType="includePath"> +<option id="gnu.c.compiler.option.include.paths.1683514941" name="Include paths (-I)" superClass="gnu.c.compiler.option.include.paths" valueType="includePath"> <listOptionValue builtIn="false" value=""C:\OpenCV2.1\include\opencv""/> </option> <inputType id="cdt.managedbuild.tool.gnu.c.compiler.input.425612201" superClass="cdt.managedbuild.tool.gnu.c.compiler.input"/> </tool> <tool id="cdt.managedbuild.tool.gnu.c.linker.mingw.exe.release.1609582156" name="MinGW C Linker" superClass="cdt.managedbuild.tool.gnu.c.linker.mingw.exe.release"/> <tool id="cdt.managedbuild.tool.gnu.cpp.linker.mingw.exe.release.1364150050" name="MinGW C++ Linker" superClass="cdt.managedbuild.tool.gnu.cpp.linker.mingw.exe.release"> -<option id="gnu.cpp.link.option.libs.1043700432" superClass="gnu.cpp.link.option.libs" valueType="libs"> +<option id="gnu.cpp.link.option.libs.1043700432" name="Libraries (-l)" superClass="gnu.cpp.link.option.libs" valueType="libs"> <listOptionValue builtIn="false" value="cv210"/> <listOptionValue builtIn="false" value="cvaux210"/> <listOptionValue builtIn="false" value="cxcore210"/> <listOptionValue builtIn="false" value="highgui210"/> <listOptionValue builtIn="false" value="ml210"/> </option> -<option id="gnu.cpp.link.option.paths.452181845" superClass="gnu.cpp.link.option.paths" valueType="libPaths"> +<option id="gnu.cpp.link.option.paths.452181845" name="Library search path (-L)" superClass="gnu.cpp.link.option.paths" valueType="libPaths"> <listOptionValue builtIn="false" value=""C:\OpenCV2.1\bin""/> </option> <inputType id="cdt.managedbuild.tool.gnu.cpp.linker.input.162577737" superClass="cdt.managedbuild.tool.gnu.cpp.linker.input"> Modified: vision/config/hedge.txt =================================================================== --- vision/config/hedge.txt 2010-06-03 03:37:42 UTC (rev 21) +++ vision/config/hedge.txt 2010-06-03 03:50:24 UTC (rev 22) @@ -1,5 +1,5 @@ -sthreshold 0 -hupper 0 -hlower 0 -erode 0 -dilate 0 +sthreshold 158 +hlower 60 +hupper 43 +erode 1 +dilate 5 Added: vision/images/wire.png =================================================================== (Binary files differ) Property changes on: vision/images/wire.png ___________________________________________________________________ Added: svn:mime-type + application/octet-stream Added: vision/images/wire2.png =================================================================== (Binary files differ) Property changes on: vision/images/wire2.png ___________________________________________________________________ Added: svn:mime-type + application/octet-stream Added: vision/images/wire3.png =================================================================== (Binary files differ) Property changes on: vision/images/wire3.png ___________________________________________________________________ Added: svn:mime-type + application/octet-stream Added: vision/images/wire4.png =================================================================== (Binary files differ) Property changes on: vision/images/wire4.png ___________________________________________________________________ Added: svn:mime-type + application/octet-stream Added: vision/images/wire5.png =================================================================== (Binary files differ) Property changes on: vision/images/wire5.png ___________________________________________________________________ Added: svn:mime-type + application/octet-stream Modified: vision/src/main.cpp =================================================================== --- vision/src/main.cpp 2010-06-03 03:37:42 UTC (rev 21) +++ vision/src/main.cpp 2010-06-03 03:50:24 UTC (rev 22) @@ -34,7 +34,6 @@ CvPoint center; CvSize size; - } elipse; int sthresholdbuoy=0, hupperbuoy=0, hlowerbuoy=0, erodebuoy=0, dilatebuoy=0; @@ -345,17 +344,166 @@ //as finding the heading of the pipe? //will we need to make a new struct then for this return value? -/*point? findHedge(IplImage* img){ +elipse findHedge(IplImage *src) { + int i, j, k;//for iterations + int temp = 0;//if we use a temporary var - } - */ + int heighthsv, widthhsv, stephsv, channelshsv; + int heightmono, widthmono, stepmono, channelsmono; + uchar *datahsv, *datamono; -//The findPipe function works in quite the same way as findBuoy + IplImage *colimgbot; + IplImage *monoimgbot; + //printf("frame loaded"); + colimgbot = cvCreateImage(cvGetSize(src), 8, 3); + monoimgbot = cvCreateImage(cvGetSize(src), 8, 1); + + cvCvtColor(src, colimgbot, CV_RGB2HSV); + + //\x97\x97\x97\x97\x97\x97\x97\x97\x97\x97\x97\x97\x97\x97\x97\x97\x97\x97\x97\x97\x97\x97 + + heighthsv = colimgbot->height; + widthhsv = colimgbot->width; + stephsv = colimgbot->widthStep; + channelshsv = colimgbot->nChannels; + datahsv = (uchar *) colimgbot->imageData; + //\x97\x97\x97\x97\x97\x97\x97\x97\x96 + + heightmono = monoimgbot ->height; + widthmono = monoimgbot->width; + stepmono = monoimgbot->widthStep; + channelsmono = monoimgbot->nChannels; + datamono = (uchar *) monoimgbot->imageData; + + for (i = 0; i < (heighthsv); i++) { + for (j = 0; j < (widthhsv); j++) { + if ((datahsv[(i) * stephsv + j * channelshsv] <= hlowerhedge) + && (datahsv[(i) * stephsv + j * channelshsv] >= hupperhedge)) { + if ((datahsv[(i) * stephsv + j * (channelshsv) + 1]) + > sthresholdhedge) { + datamono[i * stepmono + j * channelsmono] = 255; + } else + /*A very simple concept with the loops here if the hue values are in the aforementioned range and the + threshold is met then logic one else logic zero*/ + + datamono[i * stepmono + j * channelsmono] = 0; + } + } + } + + + //crosscheck all are either black or white + for (i = 0; i < (heighthsv); i++) { + for (j = 0; j < (widthhsv); j++) { + if (!(datamono[i * stepmono + j * channelsmono] == 0 || datamono[i + * stepmono + j * channelsmono] == 255)) + datamono[i * stepmono + j * channelsmono] = 0; + } + } + + + // get rid of noise + cvErode(monoimgbot, monoimgbot, 0, erodehedge); + cvDilate(monoimgbot, monoimgbot, 0, dilatehedge); + + CvMemStorage* storage; + CvSeq* contour; + + // Create dynamic structure and sequence. + storage = cvCreateMemStorage(0); + contour = cvCreateSeq(CV_SEQ_ELTYPE_POINT, sizeof(CvSeq), sizeof(CvPoint), + storage); + + + cvShowImage("processed", monoimgbot); + + // Find all contours. + cvFindContours(monoimgbot, storage, &contour, sizeof(CvContour), CV_RETR_LIST, + CV_CHAIN_APPROX_NONE, cvPoint(0, 0)); + + elipse retElipse; + retElipse.total=0; + retElipse.angle=-1; + + // This cycle draw all contours and approximate it by ellipses. + for(;contour;contour = contour->h_next) + { + + + int count = contour->total; // This is number point in contour + + CvBox2D box; + + // Number point must be more than or equal to 6 (for cvFitEllipse_32f). + if (count < 6) + continue; + + CvMat* points_f = cvCreateMat(1, count, CV_32FC2 ); + CvMat points_i = cvMat(1, count, CV_32SC2, points_f->data.ptr); + cvCvtSeqToArray(contour, points_f->data.ptr, CV_WHOLE_SEQ ); + cvConvert( &points_i, points_f ); + + // Fits ellipse to current contour. + box = cvFitEllipse2(points_f); + + // Draw current contour. + //cvDrawContours(image04,contour,CV_RGB(255,255,255),CV_RGB(255,255,255),0,1,8,cvPoint(0,0)); + + // Convert ellipse data from float to integer representation. + + if(count>retElipse.total) { + + retElipse.total = count; + retElipse.angle = box.angle; + retElipse.center = cvPointFrom32f(box.center); + retElipse.size.width = cvRound(box.size.width*0.5); + retElipse.size.height = cvRound(box.size.height*0.5); + } + + cvReleaseMat(&points_f); + + } + + + if(retElipse.angle!=-1) { +// cvLine(monoimgbot, cvPoint(monoimgbot->width / 2, monoimgbot->height / 2), +// cvPoint((monoimgbot->width / 2) + (100 * (sin((-retElipse.angle) +// * 3.14159265 / 180))), (monoimgbot->height / 2) + (100 +// * (cos(-retElipse.angle * 3.14159265 / 180)))), +// CV_RGB(0,0,255), 5); + +// cvCircle(monoimgbot, cvPoint(monoimgbot->width / 2, monoimgbot->height / 2), 10, +// CV_RGB(0,0,255), 10); + + // Draw ellipse. + cvEllipse(monoimgbot, retElipse.center, retElipse.size, -retElipse.angle, 0, 360, CV_RGB(255,0,255), + 1, CV_AA, 0); + + + cvCircle(monoimgbot, retElipse.center, 20, CV_RGB(0,255,0), 3); + + + } + + + // Show image. HighGUI use. + + + cvReleaseImage(&colimgbot); + cvReleaseImage(&monoimgbot); + cvReleaseMemStorage(&storage); + + return retElipse; +} + +//The findPipe function works in quite the same way as findBuoy + + elipse finalFindPipe(IplImage *src) { //int sthreshold = 86, erode = 4, dialate = 8; @@ -560,9 +708,6 @@ for (;;) { - - - i = j = k = 0;/*initializing the iteraiton variables to be zero*/ @@ -678,6 +823,9 @@ finalFindPipe(image); } + else if (strcmp(functionName, "findHedge") == 0) { + findHedge(image); + } cvWaitKey(0); @@ -739,6 +887,9 @@ retElipse = finalFindPipe(frame); } + else if (strcmp("findHedge", functionName) == 0) { + retElipse = findHedge(frame); + } if(retElipse.angle!=-1) { cvLine(frame, cvPoint(frame->width / 2, frame->height / 2), @@ -786,19 +937,6 @@ int main(int argc, char** argv) { - - //this part is for the reading of the config files - //thus setting the threshold values on the fly - readFile("config/buoy.txt", 1); - readFile("config/pipe.txt", 2); - //readFile("config/hedge.txt", 3); - - - //playVideo("finalFindPipe", "videos/pipe3.avi"); - //showImage("findBuoy", "images/buoy.jpg"); - //playVideo("finalFindPipe", "videos/ets2007buoy.avi"); - //playVideo("findBuoy", "videos/ets2007buoy.avi"); - if(argc<=1){ char readuser[100]; @@ -880,7 +1018,6 @@ } - } else if(strcmp(readuser, "4")==0){ @@ -902,18 +1039,15 @@ } - }//end while - - - - - - } else{ + readFile("config/buoy.txt", 1); + readFile("config/pipe.txt", 2); + readFile("config/hedge.txt", 3); + if(strcmp(argv[1], "-v")==0){ //then the person wants to play a video @@ -969,15 +1103,7 @@ } - - } - - return 0; } - - - - Modified: vision/src/test2.cpp =================================================================== --- vision/src/test2.cpp 2010-06-03 03:37:42 UTC (rev 21) +++ vision/src/test2.cpp 2010-06-03 03:50:24 UTC (rev 22) @@ -5,13 +5,71 @@ #include"cv.h" #include"highgui.h" #include"stdio.h" + +#define CONFIG "config/hedge.txt" +#define IMAGE "images/wire5.png" + +int sthreshold=0, hupper=0, hlower=0, erode=0, dilate=0; + +void readFile(char* filename){ + + FILE* filereader; + + filereader = fopen(filename, "r"); + char line[100]; + char* line2 = (char*)malloc(sizeof(char)*100); + + char var[100]; + char value[100]; + + if(filereader!=NULL){ + + while(fgets(line, sizeof(line), filereader)!=NULL){ + + strcpy(line2, line); + strcpy(var,""); + strcpy(value,""); + + sscanf(line, "%s %s", var, value); + + if(strncmp("sthreshold ", line, 11)==0) + sthreshold=atoi(value); + else if(strncmp("hupper ", line, 7)==0) + hupper=atoi(value); + else if(strncmp("hlower ", line, 7)==0) + hlower=atoi(value); + else if(strncmp("erode ", line, 6)==0) + erode=atoi(value); + else if(strncmp("dilate ", line, 7)==0) + dilate=atoi(value); + + }//end while + + } + else{ + + printf("Can't read from file.\n"); + } +} + +void saveFile(char* filename) { + FILE* filewriter; + + filewriter = fopen(filename, "w"); + + if(filewriter!=NULL){ + fprintf(filewriter, "sthreshold %d\n", sthreshold); + fprintf(filewriter, "hlower %d\n", hlower); + fprintf(filewriter, "hupper %d\n", hupper); + fprintf(filewriter, "erode %d\n", erode); + fprintf(filewriter, "dilate %d\n", dilate); + } +} + int nmain() { - int sthreshold = 68, erode = 4, dialate = 8; + readFile(CONFIG); - int hlower = 127, hupper = 25;/* - here hlower is the lower cut off and the hupper is the upper cut off for hue values of red.*/ - cvNamedWindow("original", CV_WINDOW_AUTOSIZE); cvNamedWindow("Monochrome Of red Blob", CV_WINDOW_AUTOSIZE); @@ -21,7 +79,7 @@ cvCreateTrackbar("hlower", "Monochrome Of red Blob", &hlower, 255, 0); cvCreateTrackbar("hupper", "Monochrome Of red Blob", &hupper, 255, 0); cvCreateTrackbar("erode", "Monochrome Of red Blob", &erode, 20, 0); - cvCreateTrackbar("dialate", "Monochrome Of red Blob", &dialate, 20, 0); + cvCreateTrackbar("dilate", "Monochrome Of red Blob", &dilate, 20, 0); int i, j, k;//for iterations int temp = 0;//if we use a temporary var @@ -42,16 +100,13 @@ for (;;) { - - - i = j = k = 0;/*initializing the iteraiton variables to be zero*/ //frame = cvLoadImage("images/3dballs.jpg", 1); //frame=cvLoadImage("images/flipper.png",1); //frame=cvLoadImage("images/test7.png",1); - frame=cvLoadImage("images/pipe.png",1); + frame=cvLoadImage(IMAGE, 1); if (frame == NULL) { puts("unable to load the frame"); @@ -111,7 +166,7 @@ or erosion*/ cvErode(monoimgbot, monoimgbot, 0, erode); - cvDilate(monoimgbot, monoimgbot, 0, dialate); + cvDilate(monoimgbot, monoimgbot, 0, dilate); /*here i have experimented with the values by changing them\x85and i have found that i come to a good result by applying erosion 6 times and dilation 15 times you can comment/uncomment play with the values and see what is going on @@ -132,5 +187,8 @@ } cvDestroyWindow("Monochrome Of red Blob"); cvDestroyWindow("original"); + + saveFile(CONFIG); + return 0; } Added: vision/videos/wire2.avi =================================================================== (Binary files differ) Property changes on: vision/videos/wire2.avi ___________________________________________________________________ Added: svn:mime-type + application/octet-stream This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <luc...@us...> - 2010-06-03 04:17:24
|
Revision: 24 http://robotvision.svn.sourceforge.net/robotvision/?rev=24&view=rev Author: lucyyuan Date: 2010-06-03 04:17:18 +0000 (Thu, 03 Jun 2010) Log Message: ----------- Slider autosaves config values on exit. Modified Paths: -------------- vision/.cproject vision/src/main.cpp Modified: vision/.cproject =================================================================== --- vision/.cproject 2010-06-03 03:56:47 UTC (rev 23) +++ vision/.cproject 2010-06-03 04:17:18 UTC (rev 24) @@ -60,7 +60,7 @@ </folderInfo> <sourceEntries> <entry excluding="src" flags="VALUE_WORKSPACE_PATH|RESOLVED" kind="sourcePath" name=""/> -<entry excluding="ellipse.cpp|findBuoy.c|pipe.cpp|squares.c" flags="VALUE_WORKSPACE_PATH" kind="sourcePath" name="src"/> +<entry excluding="test2.cpp|ellipse.cpp|findBuoy.c|pipe.cpp|squares.c" flags="VALUE_WORKSPACE_PATH" kind="sourcePath" name="src"/> </sourceEntries> </configuration> </storageModule> Modified: vision/src/main.cpp =================================================================== --- vision/src/main.cpp 2010-06-03 03:56:47 UTC (rev 23) +++ vision/src/main.cpp 2010-06-03 04:17:18 UTC (rev 24) @@ -35,12 +35,13 @@ int sthresholdbuoy=0, hupperbuoy=0, hlowerbuoy=0, erodebuoy=0, dilatebuoy=0; int sthresholdpipe=0, hupperpipe=0, hlowerpipe=0, erodepipe=0, dilatepipe=0; int sthresholdhedge=0, hupperhedge=0, hlowerhedge=0, erodehedge=0, dilatehedge=0; +int sthreshold=0, hupper=0, hlower=0, erode=0, dilate=0; // for slider //the following function is used by all of the find functions //in order to set their threshold values on the fly //using a config file -//type 1 is the buoy, type 2 is the pipe, type 3 is the hedge +//type 1 is the buoy, type 2 is the pipe, type 3 is the hedge, type 4 is slider void readFile(char* filename, int type){ FILE* filereader; @@ -69,6 +70,7 @@ case(1):sthresholdbuoy=atoi(value);break; case(2):sthresholdpipe=atoi(value);break; case(3):sthresholdhedge=atoi(value);break; + case(4):sthreshold=atoi(value);break; } @@ -82,6 +84,7 @@ case(1):hupperbuoy=atoi(value);break; case(2):hupperpipe=atoi(value);break; case(3):hupperhedge=atoi(value);break; + case(4):hupper=atoi(value);break; } @@ -94,6 +97,7 @@ case(1):hlowerbuoy=atoi(value);break; case(2):hlowerpipe=atoi(value);break; case(3):hlowerhedge=atoi(value);break; + case(4):hlower=atoi(value);break; } @@ -105,6 +109,7 @@ case(1):erodebuoy=atoi(value);break; case(2):erodepipe=atoi(value);break; case(3):erodehedge=atoi(value);break; + case(4):erode=atoi(value);break; } @@ -116,6 +121,7 @@ case(1):dilatebuoy=atoi(value);break; case(2):dilatepipe=atoi(value);break; case(3):dilatehedge=atoi(value);break; + case(4):dilate=atoi(value);break; } @@ -131,6 +137,22 @@ } } + +void saveFile(char* filename) { + FILE* filewriter; + + filewriter = fopen(filename, "w"); + + if(filewriter!=NULL){ + fprintf(filewriter, "sthreshold %d\n", sthreshold); + fprintf(filewriter, "hlower %d\n", hlower); + fprintf(filewriter, "hupper %d\n", hupper); + fprintf(filewriter, "erode %d\n", erode); + fprintf(filewriter, "dilate %d\n", dilate); + } +} + + //need to show the method headers /*point findBuoy(IplImage* img); point findPipe(IplImage* img); @@ -667,13 +689,18 @@ return retElipse; } -int slider(char* imageFile) { +int slider(char* functionName, char* imageFile) { - int sthreshold = 68, erode = 4, dialate = 8; + if(strcmp(functionName, "findBuoy") == 0) { + readFile("config/buoy.txt", 4); + } + else if(strcmp(functionName, "finalFindPipe") == 0) { + readFile("config/pipe.txt", 4); + } + else{ + readFile("config/hedge.txt", 4); + } - int hlower = 127, hupper = 25;/* - here hlower is the lower cut off and the hupper is the upper cut off for hue values of red.*/ - cvNamedWindow("original", CV_WINDOW_AUTOSIZE); cvNamedWindow("Monochrome Of red Blob", CV_WINDOW_AUTOSIZE); @@ -683,7 +710,7 @@ cvCreateTrackbar("hlower", "Monochrome Of red Blob", &hlower, 255, 0); cvCreateTrackbar("hupper", "Monochrome Of red Blob", &hupper, 255, 0); cvCreateTrackbar("erode", "Monochrome Of red Blob", &erode, 20, 0); - cvCreateTrackbar("dialate", "Monochrome Of red Blob", &dialate, 20, 0); + cvCreateTrackbar("dilate", "Monochrome Of red Blob", &dilate, 20, 0); int i, j, k;//for iterations int temp = 0;//if we use a temporary var @@ -770,7 +797,7 @@ or erosion*/ cvErode(monoimgbot, monoimgbot, 0, erode); - cvDilate(monoimgbot, monoimgbot, 0, dialate); + cvDilate(monoimgbot, monoimgbot, 0, dilate); /*here i have experimented with the values by changing them\x85and i have found that i come to a good result by applying erosion 6 times and dilation 15 times you can comment/uncomment play with the values and see what is going on @@ -791,6 +818,17 @@ } cvDestroyWindow("Monochrome Of red Blob"); cvDestroyWindow("original"); + + if(strcmp(functionName, "findBuoy") == 0) { + saveFile("config/buoy.txt"); + } + else if(strcmp(functionName, "finalFindPipe") == 0) { + saveFile("config/pipe.txt"); + } + else{ + saveFile("config/hedge.txt"); + } + return 0; } @@ -1026,8 +1064,28 @@ printf("Image file? Remember: images/...\n"); printf("%**>"); gets(fileName); - slider(fileName); + printf("Type 1 for findBuoy, 2 for findPipe, 3 for findHedge\n"); + printf("%**>"); + gets(functionName); + + type = atoi(functionName); + + if(type==1){ + + slider("findBuoy", fileName); + + } + else if(type==2){ + + slider("finalFindPipe", fileName); + } + else{ + + slider("findHedge", fileName); + + } + } else{ @@ -1082,20 +1140,21 @@ //make sure that the person puts the name of the method //as well as the name of the video - if(argc<3){ + if(argc<4){ printf("Insufficient number of arguments.\n"); } else{ - slider(argv[2]); + slider(argv[2], argv[3]); } } else{ printf("To view a video type vision.exe -v functionName video\n " - "To view an image type vision.exe -i functionName image"); + "To view an image type vision.exe -i functionName image\n" + "To view the slider utility type vision.exe -s functionName image\n"); } This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <luc...@us...> - 2010-06-03 04:17:24
|
Revision: 24 http://robotvision.svn.sourceforge.net/robotvision/?rev=24&view=rev Author: lucyyuan Date: 2010-06-03 04:17:18 +0000 (Thu, 03 Jun 2010) Log Message: ----------- Slider autosaves config values on exit. Modified Paths: -------------- vision/.cproject vision/src/main.cpp Modified: vision/.cproject =================================================================== --- vision/.cproject 2010-06-03 03:56:47 UTC (rev 23) +++ vision/.cproject 2010-06-03 04:17:18 UTC (rev 24) @@ -60,7 +60,7 @@ </folderInfo> <sourceEntries> <entry excluding="src" flags="VALUE_WORKSPACE_PATH|RESOLVED" kind="sourcePath" name=""/> -<entry excluding="ellipse.cpp|findBuoy.c|pipe.cpp|squares.c" flags="VALUE_WORKSPACE_PATH" kind="sourcePath" name="src"/> +<entry excluding="test2.cpp|ellipse.cpp|findBuoy.c|pipe.cpp|squares.c" flags="VALUE_WORKSPACE_PATH" kind="sourcePath" name="src"/> </sourceEntries> </configuration> </storageModule> Modified: vision/src/main.cpp =================================================================== --- vision/src/main.cpp 2010-06-03 03:56:47 UTC (rev 23) +++ vision/src/main.cpp 2010-06-03 04:17:18 UTC (rev 24) @@ -35,12 +35,13 @@ int sthresholdbuoy=0, hupperbuoy=0, hlowerbuoy=0, erodebuoy=0, dilatebuoy=0; int sthresholdpipe=0, hupperpipe=0, hlowerpipe=0, erodepipe=0, dilatepipe=0; int sthresholdhedge=0, hupperhedge=0, hlowerhedge=0, erodehedge=0, dilatehedge=0; +int sthreshold=0, hupper=0, hlower=0, erode=0, dilate=0; // for slider //the following function is used by all of the find functions //in order to set their threshold values on the fly //using a config file -//type 1 is the buoy, type 2 is the pipe, type 3 is the hedge +//type 1 is the buoy, type 2 is the pipe, type 3 is the hedge, type 4 is slider void readFile(char* filename, int type){ FILE* filereader; @@ -69,6 +70,7 @@ case(1):sthresholdbuoy=atoi(value);break; case(2):sthresholdpipe=atoi(value);break; case(3):sthresholdhedge=atoi(value);break; + case(4):sthreshold=atoi(value);break; } @@ -82,6 +84,7 @@ case(1):hupperbuoy=atoi(value);break; case(2):hupperpipe=atoi(value);break; case(3):hupperhedge=atoi(value);break; + case(4):hupper=atoi(value);break; } @@ -94,6 +97,7 @@ case(1):hlowerbuoy=atoi(value);break; case(2):hlowerpipe=atoi(value);break; case(3):hlowerhedge=atoi(value);break; + case(4):hlower=atoi(value);break; } @@ -105,6 +109,7 @@ case(1):erodebuoy=atoi(value);break; case(2):erodepipe=atoi(value);break; case(3):erodehedge=atoi(value);break; + case(4):erode=atoi(value);break; } @@ -116,6 +121,7 @@ case(1):dilatebuoy=atoi(value);break; case(2):dilatepipe=atoi(value);break; case(3):dilatehedge=atoi(value);break; + case(4):dilate=atoi(value);break; } @@ -131,6 +137,22 @@ } } + +void saveFile(char* filename) { + FILE* filewriter; + + filewriter = fopen(filename, "w"); + + if(filewriter!=NULL){ + fprintf(filewriter, "sthreshold %d\n", sthreshold); + fprintf(filewriter, "hlower %d\n", hlower); + fprintf(filewriter, "hupper %d\n", hupper); + fprintf(filewriter, "erode %d\n", erode); + fprintf(filewriter, "dilate %d\n", dilate); + } +} + + //need to show the method headers /*point findBuoy(IplImage* img); point findPipe(IplImage* img); @@ -667,13 +689,18 @@ return retElipse; } -int slider(char* imageFile) { +int slider(char* functionName, char* imageFile) { - int sthreshold = 68, erode = 4, dialate = 8; + if(strcmp(functionName, "findBuoy") == 0) { + readFile("config/buoy.txt", 4); + } + else if(strcmp(functionName, "finalFindPipe") == 0) { + readFile("config/pipe.txt", 4); + } + else{ + readFile("config/hedge.txt", 4); + } - int hlower = 127, hupper = 25;/* - here hlower is the lower cut off and the hupper is the upper cut off for hue values of red.*/ - cvNamedWindow("original", CV_WINDOW_AUTOSIZE); cvNamedWindow("Monochrome Of red Blob", CV_WINDOW_AUTOSIZE); @@ -683,7 +710,7 @@ cvCreateTrackbar("hlower", "Monochrome Of red Blob", &hlower, 255, 0); cvCreateTrackbar("hupper", "Monochrome Of red Blob", &hupper, 255, 0); cvCreateTrackbar("erode", "Monochrome Of red Blob", &erode, 20, 0); - cvCreateTrackbar("dialate", "Monochrome Of red Blob", &dialate, 20, 0); + cvCreateTrackbar("dilate", "Monochrome Of red Blob", &dilate, 20, 0); int i, j, k;//for iterations int temp = 0;//if we use a temporary var @@ -770,7 +797,7 @@ or erosion*/ cvErode(monoimgbot, monoimgbot, 0, erode); - cvDilate(monoimgbot, monoimgbot, 0, dialate); + cvDilate(monoimgbot, monoimgbot, 0, dilate); /*here i have experimented with the values by changing them\x85and i have found that i come to a good result by applying erosion 6 times and dilation 15 times you can comment/uncomment play with the values and see what is going on @@ -791,6 +818,17 @@ } cvDestroyWindow("Monochrome Of red Blob"); cvDestroyWindow("original"); + + if(strcmp(functionName, "findBuoy") == 0) { + saveFile("config/buoy.txt"); + } + else if(strcmp(functionName, "finalFindPipe") == 0) { + saveFile("config/pipe.txt"); + } + else{ + saveFile("config/hedge.txt"); + } + return 0; } @@ -1026,8 +1064,28 @@ printf("Image file? Remember: images/...\n"); printf("%**>"); gets(fileName); - slider(fileName); + printf("Type 1 for findBuoy, 2 for findPipe, 3 for findHedge\n"); + printf("%**>"); + gets(functionName); + + type = atoi(functionName); + + if(type==1){ + + slider("findBuoy", fileName); + + } + else if(type==2){ + + slider("finalFindPipe", fileName); + } + else{ + + slider("findHedge", fileName); + + } + } else{ @@ -1082,20 +1140,21 @@ //make sure that the person puts the name of the method //as well as the name of the video - if(argc<3){ + if(argc<4){ printf("Insufficient number of arguments.\n"); } else{ - slider(argv[2]); + slider(argv[2], argv[3]); } } else{ printf("To view a video type vision.exe -v functionName video\n " - "To view an image type vision.exe -i functionName image"); + "To view an image type vision.exe -i functionName image\n" + "To view the slider utility type vision.exe -s functionName image\n"); } This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <phi...@us...> - 2010-06-07 23:12:31
|
Revision: 26 http://robotvision.svn.sourceforge.net/robotvision/?rev=26&view=rev Author: phildavidson Date: 2010-06-07 23:12:24 +0000 (Mon, 07 Jun 2010) Log Message: ----------- Modified Paths: -------------- vision/src/ellipse.cpp Added Paths: ----------- vision/images/pipeEllipse.png vision/images/pipeSquareSideBySide.png vision/images/testFlipper.png vision/src/test5.cpp vision/src/test6.cpp Added: vision/images/pipeEllipse.png =================================================================== (Binary files differ) Property changes on: vision/images/pipeEllipse.png ___________________________________________________________________ Added: svn:mime-type + application/octet-stream Added: vision/images/pipeSquareSideBySide.png =================================================================== (Binary files differ) Property changes on: vision/images/pipeSquareSideBySide.png ___________________________________________________________________ Added: svn:mime-type + application/octet-stream Added: vision/images/testFlipper.png =================================================================== (Binary files differ) Property changes on: vision/images/testFlipper.png ___________________________________________________________________ Added: svn:mime-type + application/octet-stream Modified: vision/src/ellipse.cpp =================================================================== --- vision/src/ellipse.cpp 2010-06-06 19:11:40 UTC (rev 25) +++ vision/src/ellipse.cpp 2010-06-07 23:12:24 UTC (rev 26) @@ -186,7 +186,7 @@ return retElipse; } -int zmain(int argc, char** argv) { +int tmain(int argc, char** argv) { cvNamedWindow("original", CV_WINDOW_AUTOSIZE); Copied: vision/src/test5.cpp (from rev 14, vision/src/test.cpp) =================================================================== --- vision/src/test5.cpp (rev 0) +++ vision/src/test5.cpp 2010-06-07 23:12:24 UTC (rev 26) @@ -0,0 +1,330 @@ +#include "iostream" +#include "stdlib.h" +#include "stdio.h" +#include "cv.h" +#include "highgui.h" +#include "cstring" + +/*the includes*/ +/*This program is not done in CVBlob library*/ +/*Purpose of the program to track the blob */ +using namespace std; + +/*Note:The detection algorithm is the same as the one you can find in one of my previous posts + + The same algorithm is copied from that post and pasted in this + post only the values of the "sthreshold" and the "hupper" and the "hlower" are different....*/ + +double anglet(CvPoint* pt1, CvPoint* pt2, CvPoint* pt0) { + double dx1 = pt1->x - pt0->x; + double dy1 = pt1->y - pt0->y; + double dx2 = pt2->x - pt0->x; + double dy2 = pt2->y - pt0->y; + return (dx1 * dx2 + dy1 * dy2) / sqrt((dx1 * dx1 + dy1 * dy1) * (dx2 * dx2 + + dy2 * dy2) + 1e-10); +} + +// returns sequence of squares detected on the image. +// the sequence is stored in the specified memory storage +CvSeq* findSquares4t(IplImage* img) { + int thresh = 50; + CvSeq* contours; + int i, c, l, N = 11; + CvSize sz = cvSize(img->width & -2, img->height & -2); + IplImage* timg = cvCloneImage(img); // make a copy of input image + IplImage* gray = cvCreateImage(sz, 8, 1); + IplImage* pyr = cvCreateImage(cvSize(sz.width / 2, sz.height / 2), 8, 3); + IplImage* tgray; + CvSeq* result; + double s, t; + + CvMemStorage* storage = 0; + + storage = cvCreateMemStorage(0); + + // create empty sequence that will contain points - + // 4 points per square (the square's vertices) + CvSeq* squares = cvCreateSeq(0, sizeof(CvSeq), sizeof(CvPoint), storage); + + // select the maximum ROI in the image + // with the width and height divisible by 2 + cvSetImageROI(timg, cvRect(0, 0, sz.width, sz.height)); + + // down-scale and upscale the image to filter out the noise + cvPyrDown(timg, pyr, 7); + cvPyrUp(pyr, timg, 7); + tgray = cvCreateImage(sz, 8, 1); + + // find squares in every color plane of the image + for (c = 0; c < 3; c++) { + // extract the c-th color plane + cvSetImageCOI(timg, c + 1); + cvCopy(timg, tgray, 0); + + // try several threshold levels + for (l = 0; l < N; l++) { + // hack: use Canny instead of zero threshold level. + // Canny helps to catch squares with gradient shading + if (l == 0) { + // apply Canny. Take the upper threshold from slider + // and set the lower to 0 (which forces edges merging) + cvCanny(tgray, gray, 0, thresh, 5); + // dilate canny output to remove potential + // holes between edge segments + cvDilate(gray, gray, 0, 1); + } else { + // apply threshold if l!=0: + // tgray(x,y) = gray(x,y) < (l+1)*255/N ? 255 : 0 + cvThreshold(tgray, gray, (l + 1) * 255 / N, 255, + CV_THRESH_BINARY ); + } + + // find contours and store them all as a list + cvFindContours(gray, storage, &contours, sizeof(CvContour), + CV_RETR_LIST, CV_CHAIN_APPROX_SIMPLE, cvPoint(0, 0)); + + // test each contour + while (contours) { + // approximate contour with accuracy proportional + // to the contour perimeter + result = cvApproxPoly(contours, sizeof(CvContour), storage, + CV_POLY_APPROX_DP, cvContourPerimeter(contours) * 0.02, + 0); + // square contours should have 4 vertices after approximation + // relatively large area (to filter out noisy contours) + // and be convex. + // Note: absolute value of an area is used because + // area may be positive or negative - in accordance with the + // contour orientation + if (result->total == 4 + && cvContourArea(result, CV_WHOLE_SEQ, 0) > 1000 + && cvCheckContourConvexity(result)) { + s = 0; + + for (i = 0; i < 5; i++) { + // find minimum angle between joint + // edges (maximum of cosine) + if (i >= 2) { + t = fabs(anglet((CvPoint*) cvGetSeqElem(result, i), + (CvPoint*) cvGetSeqElem(result, i - 2), + (CvPoint*) cvGetSeqElem(result, i - 1))); + s = s > t ? s : t; + } + } + + // if cosines of all angles are small + // (all angles are ~90 degree) then write quandrange + // vertices to resultant sequence + if (s < 0.3) + for (i = 0; i < 4; i++) + cvSeqPush(squares, (CvPoint*) cvGetSeqElem(result, + i)); + } + + // take the next contour + contours = contours->h_next; + } + } + } + + // release all the temporary images + cvReleaseImage(&gray); + cvReleaseImage(&pyr); + cvReleaseImage(&tgray); + cvReleaseImage(&timg); + cvClearMemStorage(storage); + return squares; +} + +// the function draws all the squares in the image +void drawSquarest(IplImage* img, CvSeq* squares) { + CvSeqReader reader; + //IplImage* cpy = cvCloneImage( img ); + int i; + + // initialize reader of the sequence + cvStartReadSeq(squares, &reader, 0); + + // read 4 sequence elements at a time (all vertices of a square) + for (i = 0; i < squares->total; i += 4) { + CvPoint pt[4], *rect = pt; + int count = 4; + + // read 4 vertices + CV_READ_SEQ_ELEM( pt[0], reader ); + CV_READ_SEQ_ELEM( pt[1], reader ); + CV_READ_SEQ_ELEM( pt[2], reader ); + CV_READ_SEQ_ELEM( pt[3], reader ); + + // draw the square as a closed polyline + cvPolyLine(img, &rect, &count, 1, 1, CV_RGB(0,255,0), 3, CV_AA, 0); + } + + // show the resultant image + //cvReleaseImage( &cpy ); +} + +int zmain(int argc, char** argv) + +{ + int sthreshold = 86, erode = 4, dialate = 8; + + int hlower = 127, hupper = 18; + + cvNamedWindow("original", CV_WINDOW_AUTOSIZE); + + cvNamedWindow("processed", CV_WINDOW_AUTOSIZE); + + //cvCreateTrackbar("sthreshold", "Monochrome Of red Blob", &sthreshold, 255, 0); + //cvCreateTrackbar("hlower", "Monochrome Of red Blob", &hlower, 255, 0); + //cvCreateTrackbar("hupper", "Monochrome Of red Blob", &hupper, 255, 0); + //cvCreateTrackbar("erode", "Monochrome Of red Blob", &erode, 20, 0); + //cvCreateTrackbar("dialate", "Monochrome Of red Blob", &dialate, 20, 0); + + int i, j, k;//for iterations + int temp = 0;//if we use a temporary var + int delay=100; + + cvCreateTrackbar("delay", "original", &delay, 150, 0); + + int heighthsv, widthhsv, stephsv, channelshsv; + int heightmono, widthmono, stepmono, channelsmono; + uchar *datahsv, *datamono; + + IplImage *frame; + IplImage *colimgbot; + + IplImage *monoimgbot; + + CvCapture* capture = cvCreateFileCapture("videos/pipe3.avi"); + //CvCapture* capture = cvCreateFileCapture("videos/ets2007pipe.avi"); + + + if (!capture) { + + printf("Cannot open video file!\n"); + + return (1); + + } + + + + for (;;) { + + if (!cvGrabFrame(capture)) { + + break; + + } + + frame = cvRetrieveFrame(capture); + + if (frame == NULL) { + puts("unable to load the frame"); + exit(0); + } + //printf("frame loaded"); + + colimgbot = cvCreateImage(cvGetSize(frame), 8, 3); + + monoimgbot = cvCreateImage(cvGetSize(frame), 8, 1); + + cvCvtColor(frame, colimgbot, CV_RGB2HSV); + + //\x97\x97\x97\x97\x97\x97\x97\x97\x97\x97\x97\x97\x97\x97\x97\x97\x97\x97\x97\x97\x97\x97 + + heighthsv = colimgbot->height; + widthhsv = colimgbot->width; + stephsv = colimgbot->widthStep; + channelshsv = colimgbot->nChannels; + datahsv = (uchar *) colimgbot->imageData; + //\x97\x97\x97\x97\x97\x97\x97\x97\x96 + + heightmono = monoimgbot ->height; + widthmono = monoimgbot->width; + stepmono = monoimgbot->widthStep; + channelsmono = monoimgbot->nChannels; + datamono = (uchar *) monoimgbot->imageData; + + for (i = 0; i < (heighthsv); i++) { + for (j = 0; j < (widthhsv); j++) { + if ((datahsv[(i) * stephsv + j * channelshsv] <= hlower) + && (datahsv[(i) * stephsv + j * channelshsv] >= hupper)) { + if ((datahsv[(i) * stephsv + j * (channelshsv) + 1]) + > sthreshold) { + datamono[i * stepmono + j * channelsmono] = 255; + } else + datamono[i * stepmono + j * channelsmono] = 0; + } + } + } + + for (i = 0; i < (heighthsv); i++) { + for (j = 0; j < (widthhsv); j++) { + if (!(datamono[i * stepmono + j * channelsmono] == 0 + || datamono[i * stepmono + j * channelsmono] == 255)) + datamono[i * stepmono + j * channelsmono] = 0; + } + } + + cvErode(monoimgbot, monoimgbot, 0, erode); + cvDilate(monoimgbot, monoimgbot, 0, dialate); + + int w = 0; + int countw = 0; + int h = 0; + int counth = 0; + + for (i = 0; i < (heighthsv); i++) { + for (j = 0; j < (widthhsv); j++) { + if (datamono[i * stepmono + j * channelsmono] == 255) { + + w += j; + countw++; + h += i; + counth++; + } + } + } + + cvSaveImage("testimg.png", monoimgbot); + //cvCvtColor(monoimgbot, img2, CV_GRAY2RGB); + + + IplImage * img2 = cvLoadImage("testimg.png", 1); + + drawSquarest(img2, findSquares4t(img2)); + + if (countw != 0 && counth != 0) { + w = w / countw; + h = h / counth; + + cvCircle(frame, cvPoint(w, h), 20, cvScalar(0, 255, 0), 1); + + cvCircle(img2, cvPoint(w, h), 20, cvScalar(0, 255, 0), 1); + + } + + + cvShowImage("original", frame); + //cvSaveImage("red-ballmonochrome.jpg",monoimgbot);/*if you want to save the image*/ + cvShowImage("processed", img2); + int c = cvWaitKey(delay); + if ((char) c == 27) + break; + + } + + /* free memory */ + + //cvReleaseVideoWriter(&writer); + + cvDestroyWindow("processed"); + cvDestroyWindow("original"); + + cvReleaseCapture(&capture); + + exit(0); +} + Copied: vision/src/test6.cpp (from rev 14, vision/src/test2.cpp) =================================================================== --- vision/src/test6.cpp (rev 0) +++ vision/src/test6.cpp 2010-06-07 23:12:24 UTC (rev 26) @@ -0,0 +1,134 @@ +/*ALL the necessary header files*/ + +#include"math.h" +#include"conio.h" +#include"cv.h" +#include"highgui.h" +#include"stdio.h" +int bmain() { + + int sthreshold = 68, erode = 6, dialate = 10; + + int hlower = 127, hupper = 5;/* + here hlower is the lower cut off and the hupper is the upper cut off for hue values of red.*/ + + cvNamedWindow("original", CV_WINDOW_AUTOSIZE); + + cvNamedWindow("processed", CV_WINDOW_AUTOSIZE); + + cvCreateTrackbar("sthreshold", "processed", &sthreshold, 255, + 0); + cvCreateTrackbar("hlower", "processed", &hlower, 255, 0); + cvCreateTrackbar("hupper", "processed", &hupper, 255, 0); + cvCreateTrackbar("erode", "processed", &erode, 20, 0); + cvCreateTrackbar("dialate", "processed", &dialate, 20, 0); + + int i, j, k;//for iterations + int temp = 0;//if we use a temporary var + /*here lets look at the word \x93heighthsv\x94 \x85now lets breadk up this word\x85here height means + + height as a regular IplImage Structure has now the addition \x93hsv\x94 to the word heigh means this + height attribute is for the image which is color converted to the hsv,Similar conventions + for the monochrome image\x85so you may find the attribute height for the monochrome image to be + heightmono\x85So i believe it is easy\x85*/ + int heighthsv, widthhsv, stephsv, channelshsv; + int heightmono, widthmono, stepmono, channelsmono; + uchar *datahsv, *datamono; + + IplImage *frame; + IplImage *colimgbot; + + IplImage *monoimgbot; + + for (;;) { + + + + + i = j = k = 0;/*initializing the iteraiton variables to be zero*/ + + + //frame = cvLoadImage("images/3dballs.jpg", 1); + frame=cvLoadImage("images/flipper.png",1); + + if (frame == NULL) { + puts("unable to load the frame"); + exit(0); + } + //printf("frame loaded"); + colimgbot = cvCreateImage(cvGetSize(frame), 8, 3); + + monoimgbot = cvCreateImage(cvGetSize(frame), 8, 1); + + cvCvtColor(frame, colimgbot, CV_RGB2HSV); + + //\x97\x97\x97\x97\x97\x97\x97\x97\x97\x97\x97\x97\x97\x97\x97\x97\x97\x97\x97\x97\x97\x97 + + heighthsv = colimgbot->height; + widthhsv = colimgbot->width; + stephsv = colimgbot->widthStep; + channelshsv = colimgbot->nChannels; + datahsv = (uchar *) colimgbot->imageData; + //\x97\x97\x97\x97\x97\x97\x97\x97\x96 + + heightmono = monoimgbot ->height; + widthmono = monoimgbot->width; + stepmono = monoimgbot->widthStep; + channelsmono = monoimgbot->nChannels; + datamono = (uchar *) monoimgbot->imageData; + + for (i = 0; i < (heighthsv); i++) { + for (j = 0; j < (widthhsv); j++) { + if ((datahsv[(i) * stephsv + j * channelshsv] <= hlower) + && (datahsv[(i) * stephsv + j * channelshsv] >= hupper)) { + if ((datahsv[(i) * stephsv + j * (channelshsv) + 1]) + > sthreshold) { + datamono[i * stepmono + j * channelsmono] = 255; + } else + /*A very simple concept with the loops here if the hue values are in the aforementioned range and the + threshold is met then logic one else logic zero*/ + datamono[i * stepmono + j * channelsmono] = 0; + } + } + } + + for (i = 0; i < (heighthsv); i++) { + for (j = 0; j < (widthhsv); j++) { + if (!(datamono[i * stepmono + j * channelsmono] == 0 + || datamono[i * stepmono + j * channelsmono] == 255)) + datamono[i * stepmono + j * channelsmono] = 0; + } + }/*Just a cross chek to ensure whether all the pixels have only + either 0 or 255*/ + /*Please check these links for the explanation of the erosion and dilation functions + + http://www.dca.fee.unicamp.br/dipcourse/html-dip/c9/s4/front-page.html*/ + + /*so now the last parameter in the function indicates how many times you want to apply dilation + + or erosion*/ + + cvErode(monoimgbot, monoimgbot, 0, erode); + cvDilate(monoimgbot, monoimgbot, 0, dialate); + /*here i have experimented with the values by changing them\x85and i have found + that i come to a good result by applying erosion 6 times and dilation 15 times + you can comment/uncomment play with the values and see what is going on + Sometimes you will find the areas which are shining in the image also get detected\x85 + + Please think why and then try to post a comment the best commment would get visible on this page*/ + + cvShowImage("original", frame); + //cvSaveImage("red-ballmonochrome.jpg",monoimgbot);/*if you want to save the image*/ + cvShowImage("processed", monoimgbot); + int c = cvWaitKey(0); + if ((char) c == 27) + break; + /*for all the other clarifications you can check the other posts\x85. you will find an answer + People who are getting started with the Opencv must make sure you + + check the other posts on this blog*/ + } + cvDestroyWindow("processed"); + cvDestroyWindow("original"); + return 0; +} This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <phi...@us...> - 2010-06-07 23:12:31
|
Revision: 26 http://robotvision.svn.sourceforge.net/robotvision/?rev=26&view=rev Author: phildavidson Date: 2010-06-07 23:12:24 +0000 (Mon, 07 Jun 2010) Log Message: ----------- Modified Paths: -------------- vision/src/ellipse.cpp Added Paths: ----------- vision/images/pipeEllipse.png vision/images/pipeSquareSideBySide.png vision/images/testFlipper.png vision/src/test5.cpp vision/src/test6.cpp Added: vision/images/pipeEllipse.png =================================================================== (Binary files differ) Property changes on: vision/images/pipeEllipse.png ___________________________________________________________________ Added: svn:mime-type + application/octet-stream Added: vision/images/pipeSquareSideBySide.png =================================================================== (Binary files differ) Property changes on: vision/images/pipeSquareSideBySide.png ___________________________________________________________________ Added: svn:mime-type + application/octet-stream Added: vision/images/testFlipper.png =================================================================== (Binary files differ) Property changes on: vision/images/testFlipper.png ___________________________________________________________________ Added: svn:mime-type + application/octet-stream Modified: vision/src/ellipse.cpp =================================================================== --- vision/src/ellipse.cpp 2010-06-06 19:11:40 UTC (rev 25) +++ vision/src/ellipse.cpp 2010-06-07 23:12:24 UTC (rev 26) @@ -186,7 +186,7 @@ return retElipse; } -int zmain(int argc, char** argv) { +int tmain(int argc, char** argv) { cvNamedWindow("original", CV_WINDOW_AUTOSIZE); Copied: vision/src/test5.cpp (from rev 14, vision/src/test.cpp) =================================================================== --- vision/src/test5.cpp (rev 0) +++ vision/src/test5.cpp 2010-06-07 23:12:24 UTC (rev 26) @@ -0,0 +1,330 @@ +#include "iostream" +#include "stdlib.h" +#include "stdio.h" +#include "cv.h" +#include "highgui.h" +#include "cstring" + +/*the includes*/ +/*This program is not done in CVBlob library*/ +/*Purpose of the program to track the blob */ +using namespace std; + +/*Note:The detection algorithm is the same as the one you can find in one of my previous posts + + The same algorithm is copied from that post and pasted in this + post only the values of the "sthreshold" and the "hupper" and the "hlower" are different....*/ + +double anglet(CvPoint* pt1, CvPoint* pt2, CvPoint* pt0) { + double dx1 = pt1->x - pt0->x; + double dy1 = pt1->y - pt0->y; + double dx2 = pt2->x - pt0->x; + double dy2 = pt2->y - pt0->y; + return (dx1 * dx2 + dy1 * dy2) / sqrt((dx1 * dx1 + dy1 * dy1) * (dx2 * dx2 + + dy2 * dy2) + 1e-10); +} + +// returns sequence of squares detected on the image. +// the sequence is stored in the specified memory storage +CvSeq* findSquares4t(IplImage* img) { + int thresh = 50; + CvSeq* contours; + int i, c, l, N = 11; + CvSize sz = cvSize(img->width & -2, img->height & -2); + IplImage* timg = cvCloneImage(img); // make a copy of input image + IplImage* gray = cvCreateImage(sz, 8, 1); + IplImage* pyr = cvCreateImage(cvSize(sz.width / 2, sz.height / 2), 8, 3); + IplImage* tgray; + CvSeq* result; + double s, t; + + CvMemStorage* storage = 0; + + storage = cvCreateMemStorage(0); + + // create empty sequence that will contain points - + // 4 points per square (the square's vertices) + CvSeq* squares = cvCreateSeq(0, sizeof(CvSeq), sizeof(CvPoint), storage); + + // select the maximum ROI in the image + // with the width and height divisible by 2 + cvSetImageROI(timg, cvRect(0, 0, sz.width, sz.height)); + + // down-scale and upscale the image to filter out the noise + cvPyrDown(timg, pyr, 7); + cvPyrUp(pyr, timg, 7); + tgray = cvCreateImage(sz, 8, 1); + + // find squares in every color plane of the image + for (c = 0; c < 3; c++) { + // extract the c-th color plane + cvSetImageCOI(timg, c + 1); + cvCopy(timg, tgray, 0); + + // try several threshold levels + for (l = 0; l < N; l++) { + // hack: use Canny instead of zero threshold level. + // Canny helps to catch squares with gradient shading + if (l == 0) { + // apply Canny. Take the upper threshold from slider + // and set the lower to 0 (which forces edges merging) + cvCanny(tgray, gray, 0, thresh, 5); + // dilate canny output to remove potential + // holes between edge segments + cvDilate(gray, gray, 0, 1); + } else { + // apply threshold if l!=0: + // tgray(x,y) = gray(x,y) < (l+1)*255/N ? 255 : 0 + cvThreshold(tgray, gray, (l + 1) * 255 / N, 255, + CV_THRESH_BINARY ); + } + + // find contours and store them all as a list + cvFindContours(gray, storage, &contours, sizeof(CvContour), + CV_RETR_LIST, CV_CHAIN_APPROX_SIMPLE, cvPoint(0, 0)); + + // test each contour + while (contours) { + // approximate contour with accuracy proportional + // to the contour perimeter + result = cvApproxPoly(contours, sizeof(CvContour), storage, + CV_POLY_APPROX_DP, cvContourPerimeter(contours) * 0.02, + 0); + // square contours should have 4 vertices after approximation + // relatively large area (to filter out noisy contours) + // and be convex. + // Note: absolute value of an area is used because + // area may be positive or negative - in accordance with the + // contour orientation + if (result->total == 4 + && cvContourArea(result, CV_WHOLE_SEQ, 0) > 1000 + && cvCheckContourConvexity(result)) { + s = 0; + + for (i = 0; i < 5; i++) { + // find minimum angle between joint + // edges (maximum of cosine) + if (i >= 2) { + t = fabs(anglet((CvPoint*) cvGetSeqElem(result, i), + (CvPoint*) cvGetSeqElem(result, i - 2), + (CvPoint*) cvGetSeqElem(result, i - 1))); + s = s > t ? s : t; + } + } + + // if cosines of all angles are small + // (all angles are ~90 degree) then write quandrange + // vertices to resultant sequence + if (s < 0.3) + for (i = 0; i < 4; i++) + cvSeqPush(squares, (CvPoint*) cvGetSeqElem(result, + i)); + } + + // take the next contour + contours = contours->h_next; + } + } + } + + // release all the temporary images + cvReleaseImage(&gray); + cvReleaseImage(&pyr); + cvReleaseImage(&tgray); + cvReleaseImage(&timg); + cvClearMemStorage(storage); + return squares; +} + +// the function draws all the squares in the image +void drawSquarest(IplImage* img, CvSeq* squares) { + CvSeqReader reader; + //IplImage* cpy = cvCloneImage( img ); + int i; + + // initialize reader of the sequence + cvStartReadSeq(squares, &reader, 0); + + // read 4 sequence elements at a time (all vertices of a square) + for (i = 0; i < squares->total; i += 4) { + CvPoint pt[4], *rect = pt; + int count = 4; + + // read 4 vertices + CV_READ_SEQ_ELEM( pt[0], reader ); + CV_READ_SEQ_ELEM( pt[1], reader ); + CV_READ_SEQ_ELEM( pt[2], reader ); + CV_READ_SEQ_ELEM( pt[3], reader ); + + // draw the square as a closed polyline + cvPolyLine(img, &rect, &count, 1, 1, CV_RGB(0,255,0), 3, CV_AA, 0); + } + + // show the resultant image + //cvReleaseImage( &cpy ); +} + +int zmain(int argc, char** argv) + +{ + int sthreshold = 86, erode = 4, dialate = 8; + + int hlower = 127, hupper = 18; + + cvNamedWindow("original", CV_WINDOW_AUTOSIZE); + + cvNamedWindow("processed", CV_WINDOW_AUTOSIZE); + + //cvCreateTrackbar("sthreshold", "Monochrome Of red Blob", &sthreshold, 255, 0); + //cvCreateTrackbar("hlower", "Monochrome Of red Blob", &hlower, 255, 0); + //cvCreateTrackbar("hupper", "Monochrome Of red Blob", &hupper, 255, 0); + //cvCreateTrackbar("erode", "Monochrome Of red Blob", &erode, 20, 0); + //cvCreateTrackbar("dialate", "Monochrome Of red Blob", &dialate, 20, 0); + + int i, j, k;//for iterations + int temp = 0;//if we use a temporary var + int delay=100; + + cvCreateTrackbar("delay", "original", &delay, 150, 0); + + int heighthsv, widthhsv, stephsv, channelshsv; + int heightmono, widthmono, stepmono, channelsmono; + uchar *datahsv, *datamono; + + IplImage *frame; + IplImage *colimgbot; + + IplImage *monoimgbot; + + CvCapture* capture = cvCreateFileCapture("videos/pipe3.avi"); + //CvCapture* capture = cvCreateFileCapture("videos/ets2007pipe.avi"); + + + if (!capture) { + + printf("Cannot open video file!\n"); + + return (1); + + } + + + + for (;;) { + + if (!cvGrabFrame(capture)) { + + break; + + } + + frame = cvRetrieveFrame(capture); + + if (frame == NULL) { + puts("unable to load the frame"); + exit(0); + } + //printf("frame loaded"); + + colimgbot = cvCreateImage(cvGetSize(frame), 8, 3); + + monoimgbot = cvCreateImage(cvGetSize(frame), 8, 1); + + cvCvtColor(frame, colimgbot, CV_RGB2HSV); + + //\x97\x97\x97\x97\x97\x97\x97\x97\x97\x97\x97\x97\x97\x97\x97\x97\x97\x97\x97\x97\x97\x97 + + heighthsv = colimgbot->height; + widthhsv = colimgbot->width; + stephsv = colimgbot->widthStep; + channelshsv = colimgbot->nChannels; + datahsv = (uchar *) colimgbot->imageData; + //\x97\x97\x97\x97\x97\x97\x97\x97\x96 + + heightmono = monoimgbot ->height; + widthmono = monoimgbot->width; + stepmono = monoimgbot->widthStep; + channelsmono = monoimgbot->nChannels; + datamono = (uchar *) monoimgbot->imageData; + + for (i = 0; i < (heighthsv); i++) { + for (j = 0; j < (widthhsv); j++) { + if ((datahsv[(i) * stephsv + j * channelshsv] <= hlower) + && (datahsv[(i) * stephsv + j * channelshsv] >= hupper)) { + if ((datahsv[(i) * stephsv + j * (channelshsv) + 1]) + > sthreshold) { + datamono[i * stepmono + j * channelsmono] = 255; + } else + datamono[i * stepmono + j * channelsmono] = 0; + } + } + } + + for (i = 0; i < (heighthsv); i++) { + for (j = 0; j < (widthhsv); j++) { + if (!(datamono[i * stepmono + j * channelsmono] == 0 + || datamono[i * stepmono + j * channelsmono] == 255)) + datamono[i * stepmono + j * channelsmono] = 0; + } + } + + cvErode(monoimgbot, monoimgbot, 0, erode); + cvDilate(monoimgbot, monoimgbot, 0, dialate); + + int w = 0; + int countw = 0; + int h = 0; + int counth = 0; + + for (i = 0; i < (heighthsv); i++) { + for (j = 0; j < (widthhsv); j++) { + if (datamono[i * stepmono + j * channelsmono] == 255) { + + w += j; + countw++; + h += i; + counth++; + } + } + } + + cvSaveImage("testimg.png", monoimgbot); + //cvCvtColor(monoimgbot, img2, CV_GRAY2RGB); + + + IplImage * img2 = cvLoadImage("testimg.png", 1); + + drawSquarest(img2, findSquares4t(img2)); + + if (countw != 0 && counth != 0) { + w = w / countw; + h = h / counth; + + cvCircle(frame, cvPoint(w, h), 20, cvScalar(0, 255, 0), 1); + + cvCircle(img2, cvPoint(w, h), 20, cvScalar(0, 255, 0), 1); + + } + + + cvShowImage("original", frame); + //cvSaveImage("red-ballmonochrome.jpg",monoimgbot);/*if you want to save the image*/ + cvShowImage("processed", img2); + int c = cvWaitKey(delay); + if ((char) c == 27) + break; + + } + + /* free memory */ + + //cvReleaseVideoWriter(&writer); + + cvDestroyWindow("processed"); + cvDestroyWindow("original"); + + cvReleaseCapture(&capture); + + exit(0); +} + Copied: vision/src/test6.cpp (from rev 14, vision/src/test2.cpp) =================================================================== --- vision/src/test6.cpp (rev 0) +++ vision/src/test6.cpp 2010-06-07 23:12:24 UTC (rev 26) @@ -0,0 +1,134 @@ +/*ALL the necessary header files*/ + +#include"math.h" +#include"conio.h" +#include"cv.h" +#include"highgui.h" +#include"stdio.h" +int bmain() { + + int sthreshold = 68, erode = 6, dialate = 10; + + int hlower = 127, hupper = 5;/* + here hlower is the lower cut off and the hupper is the upper cut off for hue values of red.*/ + + cvNamedWindow("original", CV_WINDOW_AUTOSIZE); + + cvNamedWindow("processed", CV_WINDOW_AUTOSIZE); + + cvCreateTrackbar("sthreshold", "processed", &sthreshold, 255, + 0); + cvCreateTrackbar("hlower", "processed", &hlower, 255, 0); + cvCreateTrackbar("hupper", "processed", &hupper, 255, 0); + cvCreateTrackbar("erode", "processed", &erode, 20, 0); + cvCreateTrackbar("dialate", "processed", &dialate, 20, 0); + + int i, j, k;//for iterations + int temp = 0;//if we use a temporary var + /*here lets look at the word \x93heighthsv\x94 \x85now lets breadk up this word\x85here height means + + height as a regular IplImage Structure has now the addition \x93hsv\x94 to the word heigh means this + height attribute is for the image which is color converted to the hsv,Similar conventions + for the monochrome image\x85so you may find the attribute height for the monochrome image to be + heightmono\x85So i believe it is easy\x85*/ + int heighthsv, widthhsv, stephsv, channelshsv; + int heightmono, widthmono, stepmono, channelsmono; + uchar *datahsv, *datamono; + + IplImage *frame; + IplImage *colimgbot; + + IplImage *monoimgbot; + + for (;;) { + + + + + i = j = k = 0;/*initializing the iteraiton variables to be zero*/ + + + //frame = cvLoadImage("images/3dballs.jpg", 1); + frame=cvLoadImage("images/flipper.png",1); + + if (frame == NULL) { + puts("unable to load the frame"); + exit(0); + } + //printf("frame loaded"); + colimgbot = cvCreateImage(cvGetSize(frame), 8, 3); + + monoimgbot = cvCreateImage(cvGetSize(frame), 8, 1); + + cvCvtColor(frame, colimgbot, CV_RGB2HSV); + + //\x97\x97\x97\x97\x97\x97\x97\x97\x97\x97\x97\x97\x97\x97\x97\x97\x97\x97\x97\x97\x97\x97 + + heighthsv = colimgbot->height; + widthhsv = colimgbot->width; + stephsv = colimgbot->widthStep; + channelshsv = colimgbot->nChannels; + datahsv = (uchar *) colimgbot->imageData; + //\x97\x97\x97\x97\x97\x97\x97\x97\x96 + + heightmono = monoimgbot ->height; + widthmono = monoimgbot->width; + stepmono = monoimgbot->widthStep; + channelsmono = monoimgbot->nChannels; + datamono = (uchar *) monoimgbot->imageData; + + for (i = 0; i < (heighthsv); i++) { + for (j = 0; j < (widthhsv); j++) { + if ((datahsv[(i) * stephsv + j * channelshsv] <= hlower) + && (datahsv[(i) * stephsv + j * channelshsv] >= hupper)) { + if ((datahsv[(i) * stephsv + j * (channelshsv) + 1]) + > sthreshold) { + datamono[i * stepmono + j * channelsmono] = 255; + } else + /*A very simple concept with the loops here if the hue values are in the aforementioned range and the + threshold is met then logic one else logic zero*/ + datamono[i * stepmono + j * channelsmono] = 0; + } + } + } + + for (i = 0; i < (heighthsv); i++) { + for (j = 0; j < (widthhsv); j++) { + if (!(datamono[i * stepmono + j * channelsmono] == 0 + || datamono[i * stepmono + j * channelsmono] == 255)) + datamono[i * stepmono + j * channelsmono] = 0; + } + }/*Just a cross chek to ensure whether all the pixels have only + either 0 or 255*/ + /*Please check these links for the explanation of the erosion and dilation functions + + http://www.dca.fee.unicamp.br/dipcourse/html-dip/c9/s4/front-page.html*/ + + /*so now the last parameter in the function indicates how many times you want to apply dilation + + or erosion*/ + + cvErode(monoimgbot, monoimgbot, 0, erode); + cvDilate(monoimgbot, monoimgbot, 0, dialate); + /*here i have experimented with the values by changing them\x85and i have found + that i come to a good result by applying erosion 6 times and dilation 15 times + you can comment/uncomment play with the values and see what is going on + Sometimes you will find the areas which are shining in the image also get detected\x85 + + Please think why and then try to post a comment the best commment would get visible on this page*/ + + cvShowImage("original", frame); + //cvSaveImage("red-ballmonochrome.jpg",monoimgbot);/*if you want to save the image*/ + cvShowImage("processed", monoimgbot); + int c = cvWaitKey(0); + if ((char) c == 27) + break; + /*for all the other clarifications you can check the other posts\x85. you will find an answer + People who are getting started with the Opencv must make sure you + + check the other posts on this blog*/ + } + cvDestroyWindow("processed"); + cvDestroyWindow("original"); + return 0; +} This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <phi...@us...> - 2010-06-08 00:08:28
|
Revision: 27 http://robotvision.svn.sourceforge.net/robotvision/?rev=27&view=rev Author: phildavidson Date: 2010-06-08 00:08:21 +0000 (Tue, 08 Jun 2010) Log Message: ----------- Some small additions - mostly delay bar to speed up video... Modified Paths: -------------- vision/src/main.cpp vision/src/test2.cpp vision/src/test5.cpp vision/testimg.png Added Paths: ----------- vision/vision.exe Modified: vision/src/main.cpp =================================================================== --- vision/src/main.cpp 2010-06-07 23:12:24 UTC (rev 26) +++ vision/src/main.cpp 2010-06-08 00:08:21 UTC (rev 27) @@ -32,97 +32,131 @@ } elipse; -int sthresholdbuoy=0, hupperbuoy=0, hlowerbuoy=0, erodebuoy=0, dilatebuoy=0; -int sthresholdpipe=0, hupperpipe=0, hlowerpipe=0, erodepipe=0, dilatepipe=0; -int sthresholdhedge=0, hupperhedge=0, hlowerhedge=0, erodehedge=0, dilatehedge=0; -int sthreshold=0, hupper=0, hlower=0, erode=0, dilate=0; // for slider +int sthresholdbuoy = 0, hupperbuoy = 0, hlowerbuoy = 0, erodebuoy = 0, + dilatebuoy = 0; +int sthresholdpipe = 0, hupperpipe = 0, hlowerpipe = 0, erodepipe = 0, + dilatepipe = 0; +int sthresholdhedge = 0, hupperhedge = 0, hlowerhedge = 0, erodehedge = 0, + dilatehedge = 0; +int sthreshold = 0, hupper = 0, hlower = 0, erode = 0, dilate = 0; // for slider //the following function is used by all of the find functions //in order to set their threshold values on the fly //using a config file //type 1 is the buoy, type 2 is the pipe, type 3 is the hedge, type 4 is slider -void readFile(char* filename, int type){ +void readFile(char* filename, int type) { FILE* filereader; filereader = fopen(filename, "r"); char line[100]; - char* line2 = (char*)malloc(sizeof(char)*100); + char* line2 = (char*) malloc(sizeof(char) * 100); char var[100]; char value[100]; - if(filereader!=NULL){ + if (filereader != NULL) { - while(fgets(line, sizeof(line), filereader)!=NULL){ + while (fgets(line, sizeof(line), filereader) != NULL) { strcpy(line2, line); - strcpy(var,""); - strcpy(value,""); + strcpy(var, ""); + strcpy(value, ""); sscanf(line, "%s %s", var, value); - if(strncmp("sthreshold ", line, 11)==0){ + if (strncmp("sthreshold ", line, 11) == 0) { - switch(type){ + switch (type) { - case(1):sthresholdbuoy=atoi(value);break; - case(2):sthresholdpipe=atoi(value);break; - case(3):sthresholdhedge=atoi(value);break; - case(4):sthreshold=atoi(value);break; + case (1): + sthresholdbuoy = atoi(value); + break; + case (2): + sthresholdpipe = atoi(value); + break; + case (3): + sthresholdhedge = atoi(value); + break; + case (4): + sthreshold = atoi(value); + break; } + } else if (strncmp("hupper ", line, 7) == 0) { - } - else if(strncmp("hupper ", line, 7)==0){ + switch (type) { + case (1): + hupperbuoy = atoi(value); + break; + case (2): + hupperpipe = atoi(value); + break; + case (3): + hupperhedge = atoi(value); + break; + case (4): + hupper = atoi(value); + break; - switch(type){ - - case(1):hupperbuoy=atoi(value);break; - case(2):hupperpipe=atoi(value);break; - case(3):hupperhedge=atoi(value);break; - case(4):hupper=atoi(value);break; - } - } - else if(strncmp("hlower ", line, 7)==0){ + } else if (strncmp("hlower ", line, 7) == 0) { + switch (type) { - switch(type){ + case (1): + hlowerbuoy = atoi(value); + break; + case (2): + hlowerpipe = atoi(value); + break; + case (3): + hlowerhedge = atoi(value); + break; + case (4): + hlower = atoi(value); + break; - case(1):hlowerbuoy=atoi(value);break; - case(2):hlowerpipe=atoi(value);break; - case(3):hlowerhedge=atoi(value);break; - case(4):hlower=atoi(value);break; - } + } else if (strncmp("erode ", line, 6) == 0) { - } - else if(strncmp("erode ", line, 6)==0){ - - switch(type){ - case(1):erodebuoy=atoi(value);break; - case(2):erodepipe=atoi(value);break; - case(3):erodehedge=atoi(value);break; - case(4):erode=atoi(value);break; + switch (type) { + case (1): + erodebuoy = atoi(value); + break; + case (2): + erodepipe = atoi(value); + break; + case (3): + erodehedge = atoi(value); + break; + case (4): + erode = atoi(value); + break; } + } else if (strncmp("dilate ", line, 7) == 0) { - } - else if(strncmp("dilate ", line, 7)==0){ + switch (type) { - switch(type){ + case (1): + dilatebuoy = atoi(value); + break; + case (2): + dilatepipe = atoi(value); + break; + case (3): + dilatehedge = atoi(value); + break; + case (4): + dilate = atoi(value); + break; - case(1):dilatebuoy=atoi(value);break; - case(2):dilatepipe=atoi(value);break; - case(3):dilatehedge=atoi(value);break; - case(4):dilate=atoi(value);break; - } } @@ -130,20 +164,18 @@ }//end while - } - else{ + } else { printf("Can't read from file.\n"); } } - void saveFile(char* filename) { FILE* filewriter; filewriter = fopen(filename, "w"); - if(filewriter!=NULL){ + if (filewriter != NULL) { fprintf(filewriter, "sthreshold %d\n", sthreshold); fprintf(filewriter, "hlower %d\n", hlower); fprintf(filewriter, "hupper %d\n", hupper); @@ -152,7 +184,6 @@ } } - //need to show the method headers /*point findBuoy(IplImage* img); point findPipe(IplImage* img); @@ -179,19 +210,14 @@ //we will return our values //as an ellipse elipse retElipse; - retElipse.angle=-1; - retElipse.total=0; + retElipse.angle = -1; + retElipse.total = 0; //these are the threshold values - //this is a copy of src - IplImage* img = cvCreateImage( - cvGetSize(src), - IPL_DEPTH_8U, - 3 - ); + IplImage* img = cvCreateImage(cvGetSize(src), IPL_DEPTH_8U, 3); //we smooth the image and store the smooth img back in img //cvSmooth(img, img, CV_GAUSSIAN, 3, 3, 0, 0); @@ -200,12 +226,16 @@ cvCvtColor(src, img, CV_RGB2HSV); //initialization of properties of the actual image - int height; int width; int step; int channels; + int height; + int width; + int step; + int channels; //initialization of properties of the thresholded image - int heightmono; int widthmono; int stepmono; int nChannelsmono; + int heightmono; + int widthmono; + int stepmono; + int nChannelsmono; - - //these are the properties of the image //we will use them to loop through the data array (the image buffer) height = img->height; @@ -213,61 +243,49 @@ step = img->widthStep; channels = img->nChannels; - //this is the image buffer of the current unchanged image uchar *data = (uchar*) img->imageData; //this is the going to hold the binary image formed //by thresholding the image img - IplImage* monoimgbot = cvCreateImage( - cvGetSize(img), - IPL_DEPTH_8U, - 1 - ); + IplImage* monoimgbot = cvCreateImage(cvGetSize(img), IPL_DEPTH_8U, 1); heightmono = monoimgbot->height; widthmono = monoimgbot->width; stepmono = monoimgbot->widthStep; nChannelsmono = monoimgbot->nChannels; - uchar *datamono = (uchar *)monoimgbot->imageData; + uchar *datamono = (uchar *) monoimgbot->imageData; - - int i, j; //this part makes a thresholded image out of img //and stores it in the image buffer called datamono - for( i = 0 ; i < height ; i++ ) { + for (i = 0; i < height; i++) { + for (j = 0; j < width; j++) { - for( j = 0 ; j < width ; j++ ) { + if ((data[i * step + j * channels] <= hlowerbuoy) && (data[i * step + + j * channels] >= hupperbuoy)) { + if ((data[i * step + j * channels + 1]) > sthresholdbuoy) { - if((data[i*step + j*channels]<=hlowerbuoy) && ( data[i*step + j*channels]>=hupperbuoy)){ + datamono[i * stepmono + j * nChannelsmono + 0] = 255; - if( ( data[i*step + j*channels + 1] ) >sthresholdbuoy){ + } else { + datamono[i * stepmono + j * nChannelsmono + 0] = 0; - datamono[i*stepmono + j*nChannelsmono + 0] = 255; - - } - else{ - datamono[i*stepmono + j*nChannelsmono + 0] = 0; - - - } - - } - else{ - datamono[i*stepmono + j*nChannelsmono + 0] = 0; - } + } else { + datamono[i * stepmono + j * nChannelsmono + 0] = 0; - }//end inner for loop + } + }//end inner for loop + }//end outer for loop cvErode(monoimgbot, monoimgbot, 0, erodebuoy); @@ -278,75 +296,74 @@ //and the center of the ellipse will represent //the approximate center of the buoy - CvMemStorage* storage; - CvSeq* contour; + CvMemStorage* storage; + CvSeq* contour; // Create dynamic structure and sequence. storage = cvCreateMemStorage(0); - contour = cvCreateSeq(CV_SEQ_ELTYPE_POINT, sizeof(CvSeq), sizeof(CvPoint) , storage); + contour = cvCreateSeq(CV_SEQ_ELTYPE_POINT, sizeof(CvSeq), sizeof(CvPoint), + storage); cvShowImage("processed", monoimgbot); // Find all contours. - cvFindContours( monoimgbot, storage, &contour, sizeof(CvContour), - CV_RETR_LIST, CV_CHAIN_APPROX_NONE, cvPoint(0,0)); + cvFindContours(monoimgbot, storage, &contour, sizeof(CvContour), + CV_RETR_LIST, CV_CHAIN_APPROX_NONE, cvPoint(0, 0)); // This cycle draw all contours and approximate it by ellipses. - for(;contour;contour = contour->h_next){ + for (; contour; contour = contour->h_next) { int count = contour->total; // This is number point in contour - CvPoint center; - CvSize size; - CvBox2D box; + CvPoint center; + CvSize size; + CvBox2D box; // Number point must be more than or equal to 6 (for cvFitEllipse_32f). - if( count < 6 ) + if (count < 6) continue; - CvMat* points_f = cvCreateMat( 1, count, CV_32FC2 ); - CvMat points_i = cvMat( 1, count, CV_32SC2, points_f->data.ptr ); - cvCvtSeqToArray( contour, points_f->data.ptr, CV_WHOLE_SEQ ); + CvMat* points_f = cvCreateMat(1, count, CV_32FC2 ); + CvMat points_i = cvMat(1, count, CV_32SC2, points_f->data.ptr); + cvCvtSeqToArray(contour, points_f->data.ptr, CV_WHOLE_SEQ ); cvConvert( &points_i, points_f ); // Fits ellipse to current contour. - box = cvFitEllipse2( points_f ); + box = cvFitEllipse2(points_f); //we draw an ellipse from these points //iff there are more points in this current contour //than for the last one to which we fit an ellipse - if(count>retElipse.total) { + if (count > retElipse.total) { retElipse.total = count; retElipse.angle = box.angle; retElipse.center = cvPointFrom32f(box.center); - retElipse.size.width = cvRound(box.size.width*0.5); - retElipse.size.height = cvRound(box.size.height*0.5); + retElipse.size.width = cvRound(box.size.width * 0.5); + retElipse.size.height = cvRound(box.size.height * 0.5); } cvReleaseMat(&points_f); }//end for - if(retElipse.angle!=-1) { - cvLine(monoimgbot, cvPoint(monoimgbot->width / 2, monoimgbot->height / 2), - cvPoint((monoimgbot->width / 2) + (100 * (sin((-retElipse.angle) - * 3.14159265 / 180))), (monoimgbot->height / 2) + (100 - * (cos(-retElipse.angle * 3.14159265 / 180)))), - CV_RGB(0,0,255), 5); + if (retElipse.angle != -1) { + cvLine(monoimgbot, cvPoint(monoimgbot->width / 2, monoimgbot->height + / 2), cvPoint((monoimgbot->width / 2) + (100 * (sin( + (-retElipse.angle) * 3.14159265 / 180))), (monoimgbot->height + / 2) + (100 * (cos(-retElipse.angle * 3.14159265 / 180)))), + CV_RGB(0,0,255), 5); - cvCircle(monoimgbot, cvPoint(monoimgbot->width / 2, monoimgbot->height / 2), 10, - CV_RGB(0,0,255), 10); + cvCircle(monoimgbot, cvPoint(monoimgbot->width / 2, monoimgbot->height + / 2), 10, CV_RGB(0,0,255), 10); - // Draw ellipse. - cvEllipse(monoimgbot, retElipse.center, retElipse.size, -retElipse.angle, 0, 360, CV_RGB(255,0,255), - 1, CV_AA, 0); + // Draw ellipse. + cvEllipse(monoimgbot, retElipse.center, retElipse.size, + -retElipse.angle, 0, 360, CV_RGB(255,0,255), 1, CV_AA, 0); + cvCircle(monoimgbot, retElipse.center, 20, CV_RGB(0,255,0), 3); - cvCircle(monoimgbot, retElipse.center, 20, CV_RGB(0,255,0), 3); + } - - } - cvReleaseMemStorage(&storage); cvReleaseImage(&monoimgbot); @@ -414,7 +431,6 @@ } } - //crosscheck all are either black or white for (i = 0; i < (heighthsv); i++) { for (j = 0; j < (widthhsv); j++) { @@ -424,7 +440,6 @@ } } - // get rid of noise cvErode(monoimgbot, monoimgbot, 0, erodehedge); cvDilate(monoimgbot, monoimgbot, 0, dilatehedge); @@ -437,22 +452,19 @@ contour = cvCreateSeq(CV_SEQ_ELTYPE_POINT, sizeof(CvSeq), sizeof(CvPoint), storage); - cvShowImage("processed", monoimgbot); // Find all contours. - cvFindContours(monoimgbot, storage, &contour, sizeof(CvContour), CV_RETR_LIST, - CV_CHAIN_APPROX_NONE, cvPoint(0, 0)); + cvFindContours(monoimgbot, storage, &contour, sizeof(CvContour), + CV_RETR_LIST, CV_CHAIN_APPROX_NONE, cvPoint(0, 0)); elipse retElipse; - retElipse.total=0; - retElipse.angle=-1; + retElipse.total = 0; + retElipse.angle = -1; // This cycle draw all contours and approximate it by ellipses. - for(;contour;contour = contour->h_next) - { + for (; contour; contour = contour->h_next) { - int count = contour->total; // This is number point in contour CvBox2D box; @@ -474,41 +486,37 @@ // Convert ellipse data from float to integer representation. - if(count>retElipse.total) { + if (count > retElipse.total) { retElipse.total = count; retElipse.angle = box.angle; retElipse.center = cvPointFrom32f(box.center); - retElipse.size.width = cvRound(box.size.width*0.5); - retElipse.size.height = cvRound(box.size.height*0.5); + retElipse.size.width = cvRound(box.size.width * 0.5); + retElipse.size.height = cvRound(box.size.height * 0.5); } cvReleaseMat(&points_f); } + if (retElipse.angle != -1) { + // cvLine(monoimgbot, cvPoint(monoimgbot->width / 2, monoimgbot->height / 2), + // cvPoint((monoimgbot->width / 2) + (100 * (sin((-retElipse.angle) + // * 3.14159265 / 180))), (monoimgbot->height / 2) + (100 + // * (cos(-retElipse.angle * 3.14159265 / 180)))), + // CV_RGB(0,0,255), 5); - if(retElipse.angle!=-1) { -// cvLine(monoimgbot, cvPoint(monoimgbot->width / 2, monoimgbot->height / 2), -// cvPoint((monoimgbot->width / 2) + (100 * (sin((-retElipse.angle) -// * 3.14159265 / 180))), (monoimgbot->height / 2) + (100 -// * (cos(-retElipse.angle * 3.14159265 / 180)))), -// CV_RGB(0,0,255), 5); + // cvCircle(monoimgbot, cvPoint(monoimgbot->width / 2, monoimgbot->height / 2), 10, + // CV_RGB(0,0,255), 10); -// cvCircle(monoimgbot, cvPoint(monoimgbot->width / 2, monoimgbot->height / 2), 10, -// CV_RGB(0,0,255), 10); + // Draw ellipse. + cvEllipse(monoimgbot, retElipse.center, retElipse.size, + -retElipse.angle, 0, 360, CV_RGB(255,0,255), 1, CV_AA, 0); - // Draw ellipse. - cvEllipse(monoimgbot, retElipse.center, retElipse.size, -retElipse.angle, 0, 360, CV_RGB(255,0,255), - 1, CV_AA, 0); + cvCircle(monoimgbot, retElipse.center, 20, CV_RGB(0,255,0), 3); - - cvCircle(monoimgbot, retElipse.center, 20, CV_RGB(0,255,0), 3); - - } - // Show image. HighGUI use. @@ -584,7 +592,6 @@ } } - //crosscheck all are either black or white for (i = 0; i < (heighthsv); i++) { for (j = 0; j < (widthhsv); j++) { @@ -594,7 +601,6 @@ } } - // get rid of noise cvErode(monoimgbot, monoimgbot, 0, erodepipe); cvDilate(monoimgbot, monoimgbot, 0, dilatepipe); @@ -607,22 +613,19 @@ contour = cvCreateSeq(CV_SEQ_ELTYPE_POINT, sizeof(CvSeq), sizeof(CvPoint), storage); - cvShowImage("processed", monoimgbot); // Find all contours. - cvFindContours(monoimgbot, storage, &contour, sizeof(CvContour), CV_RETR_LIST, - CV_CHAIN_APPROX_NONE, cvPoint(0, 0)); + cvFindContours(monoimgbot, storage, &contour, sizeof(CvContour), + CV_RETR_LIST, CV_CHAIN_APPROX_NONE, cvPoint(0, 0)); elipse retElipse; - retElipse.total=0; - retElipse.angle=-1; + retElipse.total = 0; + retElipse.angle = -1; // This cycle draw all contours and approximate it by ellipses. - for(;contour;contour = contour->h_next) - { + for (; contour; contour = contour->h_next) { - int count = contour->total; // This is number point in contour CvBox2D box; @@ -644,41 +647,37 @@ // Convert ellipse data from float to integer representation. - if(count>retElipse.total) { + if (count > retElipse.total) { retElipse.total = count; retElipse.angle = box.angle; retElipse.center = cvPointFrom32f(box.center); - retElipse.size.width = cvRound(box.size.width*0.5); - retElipse.size.height = cvRound(box.size.height*0.5); + retElipse.size.width = cvRound(box.size.width * 0.5); + retElipse.size.height = cvRound(box.size.height * 0.5); } cvReleaseMat(&points_f); } + if (retElipse.angle != -1) { + cvLine(monoimgbot, cvPoint(monoimgbot->width / 2, monoimgbot->height + / 2), cvPoint((monoimgbot->width / 2) + (100 * (sin( + (-retElipse.angle) * 3.14159265 / 180))), (monoimgbot->height + / 2) + (100 * (cos(-retElipse.angle * 3.14159265 / 180)))), + CV_RGB(0,0,255), 5); - if(retElipse.angle!=-1) { - cvLine(monoimgbot, cvPoint(monoimgbot->width / 2, monoimgbot->height / 2), - cvPoint((monoimgbot->width / 2) + (100 * (sin((-retElipse.angle) - * 3.14159265 / 180))), (monoimgbot->height / 2) + (100 - * (cos(-retElipse.angle * 3.14159265 / 180)))), - CV_RGB(0,0,255), 5); + cvCircle(monoimgbot, cvPoint(monoimgbot->width / 2, monoimgbot->height + / 2), 10, CV_RGB(0,0,255), 10); - cvCircle(monoimgbot, cvPoint(monoimgbot->width / 2, monoimgbot->height / 2), 10, - CV_RGB(0,0,255), 10); + // Draw ellipse. + cvEllipse(monoimgbot, retElipse.center, retElipse.size, + -retElipse.angle, 0, 360, CV_RGB(255,0,255), 1, CV_AA, 0); - // Draw ellipse. - cvEllipse(monoimgbot, retElipse.center, retElipse.size, -retElipse.angle, 0, 360, CV_RGB(255,0,255), - 1, CV_AA, 0); + cvCircle(monoimgbot, retElipse.center, 20, CV_RGB(0,255,0), 3); - - cvCircle(monoimgbot, retElipse.center, 20, CV_RGB(0,255,0), 3); - - } - // Show image. HighGUI use. @@ -691,29 +690,27 @@ int slider(char* functionName, char* imageFile) { - if(strcmp(functionName, "findBuoy") == 0) { + if (strcmp(functionName, "findBuoy") == 0) { readFile("config/buoy.txt", 4); - } - else if(strcmp(functionName, "finalFindPipe") == 0) { + } else if (strcmp(functionName, "finalFindPipe") == 0) { readFile("config/pipe.txt", 4); - } - else{ + } else { readFile("config/hedge.txt", 4); } cvNamedWindow("original", CV_WINDOW_AUTOSIZE); - cvNamedWindow("Monochrome Of red Blob", CV_WINDOW_AUTOSIZE); + cvNamedWindow("Processed", CV_WINDOW_AUTOSIZE); - cvCreateTrackbar("sthreshold", "Monochrome Of red Blob", &sthreshold, 255, - 0); - cvCreateTrackbar("hlower", "Monochrome Of red Blob", &hlower, 255, 0); - cvCreateTrackbar("hupper", "Monochrome Of red Blob", &hupper, 255, 0); - cvCreateTrackbar("erode", "Monochrome Of red Blob", &erode, 20, 0); - cvCreateTrackbar("dilate", "Monochrome Of red Blob", &dilate, 20, 0); + cvCreateTrackbar("sthreshold", "Processed", &sthreshold, 255, 0); + cvCreateTrackbar("hlower", "Processed", &hlower, 255, 0); + cvCreateTrackbar("hupper", "Processed", &hupper, 255, 0); + cvCreateTrackbar("erode", "Processed", &erode, 20, 0); + cvCreateTrackbar("dilate", "Processed", &dilate, 20, 0); int i, j, k;//for iterations int temp = 0;//if we use a temporary var + /*here lets look at the word \x93heighthsv\x94 \x85now lets breadk up this word\x85here height means height as a regular IplImage Structure has now the addition \x93hsv\x94 to the word heigh means this @@ -733,11 +730,10 @@ i = j = k = 0;/*initializing the iteraiton variables to be zero*/ - //frame = cvLoadImage("images/3dballs.jpg", 1); //frame=cvLoadImage("images/flipper.png",1); //frame=cvLoadImage("images/test7.png",1); - frame=cvLoadImage(imageFile,1); + frame = cvLoadImage(imageFile, 1); if (frame == NULL) { puts("unable to load the frame"); @@ -807,7 +803,7 @@ cvShowImage("original", frame); //cvSaveImage("red-ballmonochrome.jpg",monoimgbot);/*if you want to save the image*/ - cvShowImage("Monochrome Of red Blob", monoimgbot); + cvShowImage("Processed", monoimgbot); int c = cvWaitKey(0); if ((char) c == 27) break; @@ -816,48 +812,43 @@ check the other posts on this blog*/ } - cvDestroyWindow("Monochrome Of red Blob"); + cvDestroyWindow("Processed"); cvDestroyWindow("original"); - if(strcmp(functionName, "findBuoy") == 0) { + if (strcmp(functionName, "findBuoy") == 0) { saveFile("config/buoy.txt"); - } - else if(strcmp(functionName, "finalFindPipe") == 0) { + } else if (strcmp(functionName, "finalFindPipe") == 0) { saveFile("config/pipe.txt"); - } - else{ + } else { saveFile("config/hedge.txt"); } return 0; } -int showImage(char* functionName, char* img){ +int showImage(char* functionName, char* img) { - cvNamedWindow("original", CV_WINDOW_AUTOSIZE); cvNamedWindow("processed", CV_WINDOW_AUTOSIZE); - IplImage* image = cvLoadImage( img, CV_LOAD_IMAGE_COLOR ); + IplImage* image = cvLoadImage(img, CV_LOAD_IMAGE_COLOR ); if (image == NULL) { puts("unable to load the image"); exit(0); } - //display the original image + //display the original image cvShowImage("original", image); - if(strcmp(functionName, "findBuoy")==0){ + if (strcmp(functionName, "findBuoy") == 0) { findBuoy(image); - } - else if(strcmp(functionName, "finalFindPipe")==0){ + } else if (strcmp(functionName, "finalFindPipe") == 0) { finalFindPipe(image); - } - else if (strcmp(functionName, "findHedge") == 0) { + } else if (strcmp(functionName, "findHedge") == 0) { findHedge(image); } @@ -866,137 +857,125 @@ cvDestroyWindow("processed"); cvDestroyWindow("original"); - - } -int playVideo(char* functionName, char* video){ +int playVideo(char* functionName, char* video) { cvNamedWindow("original", CV_WINDOW_AUTOSIZE); cvNamedWindow("processed", CV_WINDOW_AUTOSIZE); - //CvCapture* capture = cvCreateFileCapture("videos/pipe3.avi"); - //CvCapture* capture = cvCreateFileCapture("videos/ets2007pipe.avi"); - //CvCapture* capture = cvCreateFileCapture("videos/ets2007buoy.avi"); - //CvCapture* capture = cvCreateFileCapture("videos/cuauvFinalForward.avi"); + int delay = 150; - CvCapture* capture = cvCreateFileCapture(video); + cvCreateTrackbar("Delay", "original", &delay, 150, 0); - IplImage *frame; + //CvCapture* capture = cvCreateFileCapture("videos/pipe3.avi"); + //CvCapture* capture = cvCreateFileCapture("videos/ets2007pipe.avi"); + //CvCapture* capture = cvCreateFileCapture("videos/ets2007buoy.avi"); + //CvCapture* capture = cvCreateFileCapture("videos/cuauvFinalForward.avi"); + CvCapture* capture = cvCreateFileCapture(video); + IplImage *frame; - if (!capture) { + if (!capture) { - printf("Cannot open video file!\n"); + printf("Cannot open video file!\n"); - exit(0); + exit(0); - } + } + for (;;) {/*keep looping till we are out of frames...*/ - for (;;) {/*keep looping till we are out of frames...*/ + if (!cvGrabFrame(capture)) { - if (!cvGrabFrame(capture)) { + break; - break; + } - } + frame = cvRetrieveFrame(capture); + if (frame == NULL) { + puts("unable to load the frame"); + exit(0); + } - frame = cvRetrieveFrame(capture); + elipse retElipse; + //elipse retElipse = finalFindPipe(frame); - if (frame == NULL) { - puts("unable to load the frame"); - exit(0); - } + if (strcmp("findBuoy", functionName) == 0) { - elipse retElipse; - //elipse retElipse = finalFindPipe(frame); + retElipse = findBuoy(frame); + } else if (strcmp("finalFindPipe", functionName) == 0) { - if(strcmp("findBuoy",functionName)==0){ + retElipse = finalFindPipe(frame); + } else if (strcmp("findHedge", functionName) == 0) { + retElipse = findHedge(frame); + } - retElipse = findBuoy(frame); - } - else if(strcmp("finalFindPipe",functionName)==0){ + if (retElipse.angle != -1) { + cvLine(frame, cvPoint(frame->width / 2, frame->height / 2), + cvPoint((frame->width / 2) + (100 * (sin((-retElipse.angle) + * 3.14159265 / 180))), (frame->height / 2) + (100 + * (cos(-retElipse.angle * 3.14159265 / 180)))), + CV_RGB(0,0,255), 5); - retElipse = finalFindPipe(frame); - } - else if (strcmp("findHedge", functionName) == 0) { - retElipse = findHedge(frame); - } + cvCircle(frame, cvPoint(frame->width / 2, frame->height / 2), 10, + CV_RGB(0,0,255), 10); - if(retElipse.angle!=-1) { - cvLine(frame, cvPoint(frame->width / 2, frame->height / 2), - cvPoint((frame->width / 2) + (100 * (sin((-retElipse.angle) - * 3.14159265 / 180))), (frame->height / 2) + (100 - * (cos(-retElipse.angle * 3.14159265 / 180)))), - CV_RGB(0,0,255), 5); + // Draw ellipse. + cvEllipse(frame, retElipse.center, retElipse.size, + -retElipse.angle, 0, 360, CV_RGB(255,0,255), 1, CV_AA, 0); - cvCircle(frame, cvPoint(frame->width / 2, frame->height / 2), 10, - CV_RGB(0,0,255), 10); + cvCircle(frame, retElipse.center, 10, CV_RGB(0,255,0), 5); - // Draw ellipse. - cvEllipse(frame, retElipse.center, retElipse.size, -retElipse.angle, 0, 360, CV_RGB(255,0,255), - 1, CV_AA, 0); + } + cvShowImage("original", frame); - cvCircle(frame, retElipse.center, 10, CV_RGB(0,255,0), 5); + int c = cvWaitKey(delay); + if ((char) c == 27) + break; + } - } + /* free memory */ + cvDestroyWindow("processed"); + cvDestroyWindow("original"); - cvShowImage("original", frame); + cvReleaseCapture(&capture); + return 1; - int c = cvWaitKey(150); - if ((char) c == 27) - break; - - } - - /* free memory */ - - - cvDestroyWindow("processed"); - cvDestroyWindow("original"); - - cvReleaseCapture(&capture); - - return 1; - } - - int main(int argc, char** argv) { readFile("config/buoy.txt", 1); readFile("config/pipe.txt", 2); readFile("config/hedge.txt", 3); + if (argc <= 1) { - if(argc<=1){ - char readuser[100]; char functionName[100]; char fileName[100]; int type = 1; - while(true){ + while (true) { - printf("\nMenu\n\n1: Video\n2: Image\n3: Config\n4: List of media\n5: Slider\n6: Exit\n\n"); + printf( + "\nMenu\n\n1: Video\n2: Image\n3: Config\n4: List of media\n5: Slider\n6: Exit\n\n"); printf("%**>"); gets(readuser); - if(strcmp(readuser, "q")==0||strcmp(readuser, "6")==0){ + if (strcmp(readuser, "q") == 0 || strcmp(readuser, "6") == 0) { //we exit the program exit(0); - } - else if(strcmp(readuser, "1")==0){ + } else if (strcmp(readuser, "1") == 0) { printf("Type 1 for findBuoy, 2 for findPipe, 3 for findHedge\n"); printf("%**>"); @@ -1007,17 +986,21 @@ type = atoi(functionName); - switch(type){ + switch (type) { - case(1): playVideo("findBuoy", fileName); break; - case(2): playVideo("finalFindPipe", fileName); break; - case(3): playVideo("findHedge", fileName); break; + case (1): + playVideo("findBuoy", fileName); + break; + case (2): + playVideo("finalFindPipe", fileName); + break; + case (3): + playVideo("findHedge", fileName); + break; } + } else if (strcmp(readuser, "2") == 0) { - } - else if(strcmp(readuser, "2")==0){ - printf("Type 1 for findBuoy, 2 for findPipe, 3 for findHedge\n"); printf("%**>"); gets(functionName); @@ -1027,46 +1010,49 @@ type = atoi(functionName); - switch(type){ + switch (type) { - case(1): showImage("findBuoy", fileName); break; - case(2): showImage("finalFindPipe", fileName); break; - case(3): showImage("findHedge", fileName); break; + case (1): + showImage("findBuoy", fileName); + break; + case (2): + showImage("finalFindPipe", fileName); + break; + case (3): + showImage("findHedge", fileName); + break; } + } else if (strcmp(readuser, "3") == 0) { - } - else if(strcmp(readuser, "3")==0){ - printf("Type 1 for findBuoy, 2 for findPipe, 3 for findHedge\n"); printf("%**>"); gets(functionName); type = atoi(functionName); - if(type==1){ + if (type == 1) { readFile("config/buoy.txt", type); - } - else if(type==2){ + } else if (type == 2) { readFile("config/pipe.txt", type); - } - else{ + } else { readFile("config/hedge.txt", type); } - } - else if(strcmp(readuser, "4")==0){ + } else if (strcmp(readuser, "4") == 0) { - printf("\nVideos\n******\nets2007buoy.avi\nets2007pipe.avi\npipe3.avi\ncuauvFinalForward.avi\nwire2.avi\n"); - printf("\nImages\n******\nbuoy.jpg\npipe.png\ntest2.png\ntest3.png\ntest4.png\ntest5.png\ntest6.png\nwire.png\nwire2.png\nwire3.png\nwire4.png\nwire5.png\n"); - printf("\nConfig Files\n************\npipe.txt\nhedge.txt\nbuoy.txt\n"); - } - else if(strcmp(readuser, "5")==0){ + printf( + "\nVideos\n******\nets2007buoy.avi\nets2007pipe.avi\npipe3.avi\ncuauvFinalForward.avi\nwire2.avi\n"); + printf( + "\nImages\n******\nbuoy.jpg\npipe.png\ntest2.png\ntest3.png\ntest4.png\ntest5.png\ntest6.png\nwire.png\nwire2.png\nwire3.png\nwire4.png\nwire5.png\n"); + printf( + "\nConfig Files\n************\npipe.txt\nhedge.txt\nbuoy.txt\n"); + } else if (strcmp(readuser, "5") == 0) { printf("Image file? Remember: images/...\n"); printf("%**>"); @@ -1078,23 +1064,20 @@ type = atoi(functionName); - if(type==1){ + if (type == 1) { slider("findBuoy", fileName); - } - else if(type==2){ + } else if (type == 2) { slider("finalFindPipe", fileName); - } - else{ + } else { slider("findHedge", fileName); } - } - else{ + } else { printf("\n You must choose an option from the menu\n"); @@ -1102,66 +1085,59 @@ }//end while - } - else{ + } else { readFile("config/buoy.txt", 1); readFile("config/pipe.txt", 2); readFile("config/hedge.txt", 3); - if(strcmp(argv[1], "-v")==0){ + if (strcmp(argv[1], "-v") == 0) { //then the person wants to play a video //make sure that the person puts the name of the method //as well as the name of the video - if(argc<4){ + if (argc < 4) { printf("Insufficient number of arguments.\n"); - } - else{ + } else { playVideo(argv[2], argv[3]); } - } - else if(strcmp(argv[1], "-i")==0){ + } else if (strcmp(argv[1], "-i") == 0) { - //then the person wants to play a video - //make sure that the person puts the name of the method - //as well as the name of the video + //then the person wants to play a video + //make sure that the person puts the name of the method + //as well as the name of the video - if(argc<4){ + if (argc < 4) { - printf("Insufficient number of arguments.\n"); - } - else{ + printf("Insufficient number of arguments.\n"); + } else { - showImage(argv[2], argv[3]); - } + showImage(argv[2], argv[3]); + } - } - else if(strcmp(argv[1], "-s")==0){ + } else if (strcmp(argv[1], "-s") == 0) { //then the person wants to play a video //make sure that the person puts the name of the method //as well as the name of the video - if(argc<4){ + if (argc < 4) { printf("Insufficient number of arguments.\n"); - } - else{ + } else { slider(argv[2], argv[3]); } - } - else{ + } else { printf("To view a video type vision.exe -v functionName video\n " - "To view an image type vision.exe -i functionName image\n" - "To view the slider utility type vision.exe -s functionName image\n"); + "To view an image type vision.exe -i functionName image\n" + "To view the slider utility type vision.exe -s functionName image\n"); } Modified: vision/src/test2.cpp =================================================================== --- vision/src/test2.cpp 2010-06-07 23:12:24 UTC (rev 26) +++ vision/src/test2.cpp 2010-06-08 00:08:21 UTC (rev 27) @@ -9,9 +9,9 @@ #define CONFIG "config/hedge.txt" #define IMAGE "images/wire5.png" -int sthreshold=0, hupper=0, hlower=0, erode=0, dilate=0; +int sthreshold1=0, hupper1=0, hlower1=0, erode1=0, dilate1=0; -void readFile(char* filename){ +void readFile1(char* filename){ FILE* filereader; @@ -33,15 +33,15 @@ sscanf(line, "%s %s", var, value); if(strncmp("sthreshold ", line, 11)==0) - sthreshold=atoi(value); + sthreshold1=atoi(value); else if(strncmp("hupper ", line, 7)==0) - hupper=atoi(value); + hupper1=atoi(value); else if(strncmp("hlower ", line, 7)==0) - hlower=atoi(value); + hlower1=atoi(value); else if(strncmp("erode ", line, 6)==0) - erode=atoi(value); + erode1=atoi(value); else if(strncmp("dilate ", line, 7)==0) - dilate=atoi(value); + dilate1=atoi(value); }//end while @@ -52,34 +52,34 @@ } } -void saveFile(char* filename) { +void saveFile1(char* filename) { FILE* filewriter; filewriter = fopen(filename, "w"); if(filewriter!=NULL){ - fprintf(filewriter, "sthreshold %d\n", sthreshold); - fprintf(filewriter, "hlower %d\n", hlower); - fprintf(filewriter, "hupper %d\n", hupper); - fprintf(filewriter, "erode %d\n", erode); - fprintf(filewriter, "dilate %d\n", dilate); + fprintf(filewriter, "sthreshold %d\n", sthreshold1); + fprintf(filewriter, "hlower %d\n", hlower1); + fprintf(filewriter, "hupper %d\n", hupper1); + fprintf(filewriter, "erode %d\n", erode1); + fprintf(filewriter, "dilate %d\n", dilate1); } } int nmain() { - readFile(CONFIG); + readFile1(CONFIG); cvNamedWindow("original", CV_WINDOW_AUTOSIZE); cvNamedWindow("Monochrome Of red Blob", CV_WINDOW_AUTOSIZE); - cvCreateTrackbar("sthreshold", "Monochrome Of red Blob", &sthreshold, 255, + cvCreateTrackbar("sthreshold", "Monochrome Of red Blob", &sthreshold1, 255, 0); - cvCreateTrackbar("hlower", "Monochrome Of red Blob", &hlower, 255, 0); - cvCreateTrackbar("hupper", "Monochrome Of red Blob", &hupper, 255, 0); - cvCreateTrackbar("erode", "Monochrome Of red Blob", &erode, 20, 0); - cvCreateTrackbar("dilate", "Monochrome Of red Blob", &dilate, 20, 0); + cvCreateTrackbar("hlower", "Monochrome Of red Blob", &hlower1, 255, 0); + cvCreateTrackbar("hupper", "Monochrome Of red Blob", &hupper1, 255, 0); + cvCreateTrackbar("erode", "Monochrome Of red Blob", &erode1, 20, 0); + cvCreateTrackbar("dilate", "Monochrome Of red Blob", &dilate1, 20, 0); int i, j, k;//for iterations int temp = 0;//if we use a temporary var @@ -136,10 +136,10 @@ for (i = 0; i < (heighthsv); i++) { for (j = 0; j < (widthhsv); j++) { - if ((datahsv[(i) * stephsv + j * channelshsv] <= hlower) - && (datahsv[(i) * stephsv + j * channelshsv] >= hupper)) { + if ((datahsv[(i) * stephsv + j * channelshsv] <= hlower1) + && (datahsv[(i) * stephsv + j * channelshsv] >= hupper1)) { if ((datahsv[(i) * stephsv + j * (channelshsv) + 1]) - > sthreshold) { + > sthreshold1) { datamono[i * stepmono + j * channelsmono] = 255; } else /*A very simple concept with the loops here if the hue values are in the aforementioned range and the @@ -165,8 +165,8 @@ or erosion*/ - cvErode(monoimgbot, monoimgbot, 0, erode); - cvDilate(monoimgbot, monoimgbot, 0, dilate); + cvErode(monoimgbot, monoimgbot, 0, erode1); + cvDilate(monoimgbot, monoimgbot, 0, dilate1); /*here i have experimented with the values by changing them\x85and i have found that i come to a good result by applying erosion 6 times and dilation 15 times you can comment/uncomment play with the values and see what is going on @@ -188,7 +188,7 @@ cvDestroyWindow("Monochrome Of red Blob"); cvDestroyWindow("original"); - saveFile(CONFIG); + saveFile1(CONFIG); return 0; } Modified: vision/src/test5.cpp =================================================================== --- vision/src/test5.cpp 2010-06-07 23:12:24 UTC (rev 26) +++ vision/src/test5.cpp 2010-06-08 00:08:21 UTC (rev 27) @@ -164,7 +164,7 @@ //cvReleaseImage( &cpy ); } -int zmain(int argc, char** argv) +int mmain(int argc, char** argv) { int sthreshold = 86, erode = 4, dialate = 8; Modified: vision/testimg.png =================================================================== (Binary files differ) Added: vision/vision.exe =================================================================== (Binary files differ) Property changes on: vision/vision.exe ___________________________________________________________________ Added: svn:mime-type + application/octet-stream This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <phi...@us...> - 2010-06-08 00:08:31
|
Revision: 27 http://robotvision.svn.sourceforge.net/robotvision/?rev=27&view=rev Author: phildavidson Date: 2010-06-08 00:08:21 +0000 (Tue, 08 Jun 2010) Log Message: ----------- Some small additions - mostly delay bar to speed up video... Modified Paths: -------------- vision/src/main.cpp vision/src/test2.cpp vision/src/test5.cpp vision/testimg.png Added Paths: ----------- vision/vision.exe Modified: vision/src/main.cpp =================================================================== --- vision/src/main.cpp 2010-06-07 23:12:24 UTC (rev 26) +++ vision/src/main.cpp 2010-06-08 00:08:21 UTC (rev 27) @@ -32,97 +32,131 @@ } elipse; -int sthresholdbuoy=0, hupperbuoy=0, hlowerbuoy=0, erodebuoy=0, dilatebuoy=0; -int sthresholdpipe=0, hupperpipe=0, hlowerpipe=0, erodepipe=0, dilatepipe=0; -int sthresholdhedge=0, hupperhedge=0, hlowerhedge=0, erodehedge=0, dilatehedge=0; -int sthreshold=0, hupper=0, hlower=0, erode=0, dilate=0; // for slider +int sthresholdbuoy = 0, hupperbuoy = 0, hlowerbuoy = 0, erodebuoy = 0, + dilatebuoy = 0; +int sthresholdpipe = 0, hupperpipe = 0, hlowerpipe = 0, erodepipe = 0, + dilatepipe = 0; +int sthresholdhedge = 0, hupperhedge = 0, hlowerhedge = 0, erodehedge = 0, + dilatehedge = 0; +int sthreshold = 0, hupper = 0, hlower = 0, erode = 0, dilate = 0; // for slider //the following function is used by all of the find functions //in order to set their threshold values on the fly //using a config file //type 1 is the buoy, type 2 is the pipe, type 3 is the hedge, type 4 is slider -void readFile(char* filename, int type){ +void readFile(char* filename, int type) { FILE* filereader; filereader = fopen(filename, "r"); char line[100]; - char* line2 = (char*)malloc(sizeof(char)*100); + char* line2 = (char*) malloc(sizeof(char) * 100); char var[100]; char value[100]; - if(filereader!=NULL){ + if (filereader != NULL) { - while(fgets(line, sizeof(line), filereader)!=NULL){ + while (fgets(line, sizeof(line), filereader) != NULL) { strcpy(line2, line); - strcpy(var,""); - strcpy(value,""); + strcpy(var, ""); + strcpy(value, ""); sscanf(line, "%s %s", var, value); - if(strncmp("sthreshold ", line, 11)==0){ + if (strncmp("sthreshold ", line, 11) == 0) { - switch(type){ + switch (type) { - case(1):sthresholdbuoy=atoi(value);break; - case(2):sthresholdpipe=atoi(value);break; - case(3):sthresholdhedge=atoi(value);break; - case(4):sthreshold=atoi(value);break; + case (1): + sthresholdbuoy = atoi(value); + break; + case (2): + sthresholdpipe = atoi(value); + break; + case (3): + sthresholdhedge = atoi(value); + break; + case (4): + sthreshold = atoi(value); + break; } + } else if (strncmp("hupper ", line, 7) == 0) { - } - else if(strncmp("hupper ", line, 7)==0){ + switch (type) { + case (1): + hupperbuoy = atoi(value); + break; + case (2): + hupperpipe = atoi(value); + break; + case (3): + hupperhedge = atoi(value); + break; + case (4): + hupper = atoi(value); + break; - switch(type){ - - case(1):hupperbuoy=atoi(value);break; - case(2):hupperpipe=atoi(value);break; - case(3):hupperhedge=atoi(value);break; - case(4):hupper=atoi(value);break; - } - } - else if(strncmp("hlower ", line, 7)==0){ + } else if (strncmp("hlower ", line, 7) == 0) { + switch (type) { - switch(type){ + case (1): + hlowerbuoy = atoi(value); + break; + case (2): + hlowerpipe = atoi(value); + break; + case (3): + hlowerhedge = atoi(value); + break; + case (4): + hlower = atoi(value); + break; - case(1):hlowerbuoy=atoi(value);break; - case(2):hlowerpipe=atoi(value);break; - case(3):hlowerhedge=atoi(value);break; - case(4):hlower=atoi(value);break; - } + } else if (strncmp("erode ", line, 6) == 0) { - } - else if(strncmp("erode ", line, 6)==0){ - - switch(type){ - case(1):erodebuoy=atoi(value);break; - case(2):erodepipe=atoi(value);break; - case(3):erodehedge=atoi(value);break; - case(4):erode=atoi(value);break; + switch (type) { + case (1): + erodebuoy = atoi(value); + break; + case (2): + erodepipe = atoi(value); + break; + case (3): + erodehedge = atoi(value); + break; + case (4): + erode = atoi(value); + break; } + } else if (strncmp("dilate ", line, 7) == 0) { - } - else if(strncmp("dilate ", line, 7)==0){ + switch (type) { - switch(type){ + case (1): + dilatebuoy = atoi(value); + break; + case (2): + dilatepipe = atoi(value); + break; + case (3): + dilatehedge = atoi(value); + break; + case (4): + dilate = atoi(value); + break; - case(1):dilatebuoy=atoi(value);break; - case(2):dilatepipe=atoi(value);break; - case(3):dilatehedge=atoi(value);break; - case(4):dilate=atoi(value);break; - } } @@ -130,20 +164,18 @@ }//end while - } - else{ + } else { printf("Can't read from file.\n"); } } - void saveFile(char* filename) { FILE* filewriter; filewriter = fopen(filename, "w"); - if(filewriter!=NULL){ + if (filewriter != NULL) { fprintf(filewriter, "sthreshold %d\n", sthreshold); fprintf(filewriter, "hlower %d\n", hlower); fprintf(filewriter, "hupper %d\n", hupper); @@ -152,7 +184,6 @@ } } - //need to show the method headers /*point findBuoy(IplImage* img); point findPipe(IplImage* img); @@ -179,19 +210,14 @@ //we will return our values //as an ellipse elipse retElipse; - retElipse.angle=-1; - retElipse.total=0; + retElipse.angle = -1; + retElipse.total = 0; //these are the threshold values - //this is a copy of src - IplImage* img = cvCreateImage( - cvGetSize(src), - IPL_DEPTH_8U, - 3 - ); + IplImage* img = cvCreateImage(cvGetSize(src), IPL_DEPTH_8U, 3); //we smooth the image and store the smooth img back in img //cvSmooth(img, img, CV_GAUSSIAN, 3, 3, 0, 0); @@ -200,12 +226,16 @@ cvCvtColor(src, img, CV_RGB2HSV); //initialization of properties of the actual image - int height; int width; int step; int channels; + int height; + int width; + int step; + int channels; //initialization of properties of the thresholded image - int heightmono; int widthmono; int stepmono; int nChannelsmono; + int heightmono; + int widthmono; + int stepmono; + int nChannelsmono; - - //these are the properties of the image //we will use them to loop through the data array (the image buffer) height = img->height; @@ -213,61 +243,49 @@ step = img->widthStep; channels = img->nChannels; - //this is the image buffer of the current unchanged image uchar *data = (uchar*) img->imageData; //this is the going to hold the binary image formed //by thresholding the image img - IplImage* monoimgbot = cvCreateImage( - cvGetSize(img), - IPL_DEPTH_8U, - 1 - ); + IplImage* monoimgbot = cvCreateImage(cvGetSize(img), IPL_DEPTH_8U, 1); heightmono = monoimgbot->height; widthmono = monoimgbot->width; stepmono = monoimgbot->widthStep; nChannelsmono = monoimgbot->nChannels; - uchar *datamono = (uchar *)monoimgbot->imageData; + uchar *datamono = (uchar *) monoimgbot->imageData; - - int i, j; //this part makes a thresholded image out of img //and stores it in the image buffer called datamono - for( i = 0 ; i < height ; i++ ) { + for (i = 0; i < height; i++) { + for (j = 0; j < width; j++) { - for( j = 0 ; j < width ; j++ ) { + if ((data[i * step + j * channels] <= hlowerbuoy) && (data[i * step + + j * channels] >= hupperbuoy)) { + if ((data[i * step + j * channels + 1]) > sthresholdbuoy) { - if((data[i*step + j*channels]<=hlowerbuoy) && ( data[i*step + j*channels]>=hupperbuoy)){ + datamono[i * stepmono + j * nChannelsmono + 0] = 255; - if( ( data[i*step + j*channels + 1] ) >sthresholdbuoy){ + } else { + datamono[i * stepmono + j * nChannelsmono + 0] = 0; - datamono[i*stepmono + j*nChannelsmono + 0] = 255; - - } - else{ - datamono[i*stepmono + j*nChannelsmono + 0] = 0; - - - } - - } - else{ - datamono[i*stepmono + j*nChannelsmono + 0] = 0; - } + } else { + datamono[i * stepmono + j * nChannelsmono + 0] = 0; - }//end inner for loop + } + }//end inner for loop + }//end outer for loop cvErode(monoimgbot, monoimgbot, 0, erodebuoy); @@ -278,75 +296,74 @@ //and the center of the ellipse will represent //the approximate center of the buoy - CvMemStorage* storage; - CvSeq* contour; + CvMemStorage* storage; + CvSeq* contour; // Create dynamic structure and sequence. storage = cvCreateMemStorage(0); - contour = cvCreateSeq(CV_SEQ_ELTYPE_POINT, sizeof(CvSeq), sizeof(CvPoint) , storage); + contour = cvCreateSeq(CV_SEQ_ELTYPE_POINT, sizeof(CvSeq), sizeof(CvPoint), + storage); cvShowImage("processed", monoimgbot); // Find all contours. - cvFindContours( monoimgbot, storage, &contour, sizeof(CvContour), - CV_RETR_LIST, CV_CHAIN_APPROX_NONE, cvPoint(0,0)); + cvFindContours(monoimgbot, storage, &contour, sizeof(CvContour), + CV_RETR_LIST, CV_CHAIN_APPROX_NONE, cvPoint(0, 0)); // This cycle draw all contours and approximate it by ellipses. - for(;contour;contour = contour->h_next){ + for (; contour; contour = contour->h_next) { int count = contour->total; // This is number point in contour - CvPoint center; - CvSize size; - CvBox2D box; + CvPoint center; + CvSize size; + CvBox2D box; // Number point must be more than or equal to 6 (for cvFitEllipse_32f). - if( count < 6 ) + if (count < 6) continue; - CvMat* points_f = cvCreateMat( 1, count, CV_32FC2 ); - CvMat points_i = cvMat( 1, count, CV_32SC2, points_f->data.ptr ); - cvCvtSeqToArray( contour, points_f->data.ptr, CV_WHOLE_SEQ ); + CvMat* points_f = cvCreateMat(1, count, CV_32FC2 ); + CvMat points_i = cvMat(1, count, CV_32SC2, points_f->data.ptr); + cvCvtSeqToArray(contour, points_f->data.ptr, CV_WHOLE_SEQ ); cvConvert( &points_i, points_f ); // Fits ellipse to current contour. - box = cvFitEllipse2( points_f ); + box = cvFitEllipse2(points_f); //we draw an ellipse from these points //iff there are more points in this current contour //than for the last one to which we fit an ellipse - if(count>retElipse.total) { + if (count > retElipse.total) { retElipse.total = count; retElipse.angle = box.angle; retElipse.center = cvPointFrom32f(box.center); - retElipse.size.width = cvRound(box.size.width*0.5); - retElipse.size.height = cvRound(box.size.height*0.5); + retElipse.size.width = cvRound(box.size.width * 0.5); + retElipse.size.height = cvRound(box.size.height * 0.5); } cvReleaseMat(&points_f); }//end for - if(retElipse.angle!=-1) { - cvLine(monoimgbot, cvPoint(monoimgbot->width / 2, monoimgbot->height / 2), - cvPoint((monoimgbot->width / 2) + (100 * (sin((-retElipse.angle) - * 3.14159265 / 180))), (monoimgbot->height / 2) + (100 - * (cos(-retElipse.angle * 3.14159265 / 180)))), - CV_RGB(0,0,255), 5); + if (retElipse.angle != -1) { + cvLine(monoimgbot, cvPoint(monoimgbot->width / 2, monoimgbot->height + / 2), cvPoint((monoimgbot->width / 2) + (100 * (sin( + (-retElipse.angle) * 3.14159265 / 180))), (monoimgbot->height + / 2) + (100 * (cos(-retElipse.angle * 3.14159265 / 180)))), + CV_RGB(0,0,255), 5); - cvCircle(monoimgbot, cvPoint(monoimgbot->width / 2, monoimgbot->height / 2), 10, - CV_RGB(0,0,255), 10); + cvCircle(monoimgbot, cvPoint(monoimgbot->width / 2, monoimgbot->height + / 2), 10, CV_RGB(0,0,255), 10); - // Draw ellipse. - cvEllipse(monoimgbot, retElipse.center, retElipse.size, -retElipse.angle, 0, 360, CV_RGB(255,0,255), - 1, CV_AA, 0); + // Draw ellipse. + cvEllipse(monoimgbot, retElipse.center, retElipse.size, + -retElipse.angle, 0, 360, CV_RGB(255,0,255), 1, CV_AA, 0); + cvCircle(monoimgbot, retElipse.center, 20, CV_RGB(0,255,0), 3); - cvCircle(monoimgbot, retElipse.center, 20, CV_RGB(0,255,0), 3); + } - - } - cvReleaseMemStorage(&storage); cvReleaseImage(&monoimgbot); @@ -414,7 +431,6 @@ } } - //crosscheck all are either black or white for (i = 0; i < (heighthsv); i++) { for (j = 0; j < (widthhsv); j++) { @@ -424,7 +440,6 @@ } } - // get rid of noise cvErode(monoimgbot, monoimgbot, 0, erodehedge); cvDilate(monoimgbot, monoimgbot, 0, dilatehedge); @@ -437,22 +452,19 @@ contour = cvCreateSeq(CV_SEQ_ELTYPE_POINT, sizeof(CvSeq), sizeof(CvPoint), storage); - cvShowImage("processed", monoimgbot); // Find all contours. - cvFindContours(monoimgbot, storage, &contour, sizeof(CvContour), CV_RETR_LIST, - CV_CHAIN_APPROX_NONE, cvPoint(0, 0)); + cvFindContours(monoimgbot, storage, &contour, sizeof(CvContour), + CV_RETR_LIST, CV_CHAIN_APPROX_NONE, cvPoint(0, 0)); elipse retElipse; - retElipse.total=0; - retElipse.angle=-1; + retElipse.total = 0; + retElipse.angle = -1; // This cycle draw all contours and approximate it by ellipses. - for(;contour;contour = contour->h_next) - { + for (; contour; contour = contour->h_next) { - int count = contour->total; // This is number point in contour CvBox2D box; @@ -474,41 +486,37 @@ // Convert ellipse data from float to integer representation. - if(count>retElipse.total) { + if (count > retElipse.total) { retElipse.total = count; retElipse.angle = box.angle; retElipse.center = cvPointFrom32f(box.center); - retElipse.size.width = cvRound(box.size.width*0.5); - retElipse.size.height = cvRound(box.size.height*0.5); + retElipse.size.width = cvRound(box.size.width * 0.5); + retElipse.size.height = cvRound(box.size.height * 0.5); } cvReleaseMat(&points_f); } + if (retElipse.angle != -1) { + // cvLine(monoimgbot, cvPoint(monoimgbot->width / 2, monoimgbot->height / 2), + // cvPoint((monoimgbot->width / 2) + (100 * (sin((-retElipse.angle) + // * 3.14159265 / 180))), (monoimgbot->height / 2) + (100 + // * (cos(-retElipse.angle * 3.14159265 / 180)))), + // CV_RGB(0,0,255), 5); - if(retElipse.angle!=-1) { -// cvLine(monoimgbot, cvPoint(monoimgbot->width / 2, monoimgbot->height / 2), -// cvPoint((monoimgbot->width / 2) + (100 * (sin((-retElipse.angle) -// * 3.14159265 / 180))), (monoimgbot->height / 2) + (100 -// * (cos(-retElipse.angle * 3.14159265 / 180)))), -// CV_RGB(0,0,255), 5); + // cvCircle(monoimgbot, cvPoint(monoimgbot->width / 2, monoimgbot->height / 2), 10, + // CV_RGB(0,0,255), 10); -// cvCircle(monoimgbot, cvPoint(monoimgbot->width / 2, monoimgbot->height / 2), 10, -// CV_RGB(0,0,255), 10); + // Draw ellipse. + cvEllipse(monoimgbot, retElipse.center, retElipse.size, + -retElipse.angle, 0, 360, CV_RGB(255,0,255), 1, CV_AA, 0); - // Draw ellipse. - cvEllipse(monoimgbot, retElipse.center, retElipse.size, -retElipse.angle, 0, 360, CV_RGB(255,0,255), - 1, CV_AA, 0); + cvCircle(monoimgbot, retElipse.center, 20, CV_RGB(0,255,0), 3); - - cvCircle(monoimgbot, retElipse.center, 20, CV_RGB(0,255,0), 3); - - } - // Show image. HighGUI use. @@ -584,7 +592,6 @@ } } - //crosscheck all are either black or white for (i = 0; i < (heighthsv); i++) { for (j = 0; j < (widthhsv); j++) { @@ -594,7 +601,6 @@ } } - // get rid of noise cvErode(monoimgbot, monoimgbot, 0, erodepipe); cvDilate(monoimgbot, monoimgbot, 0, dilatepipe); @@ -607,22 +613,19 @@ contour = cvCreateSeq(CV_SEQ_ELTYPE_POINT, sizeof(CvSeq), sizeof(CvPoint), storage); - cvShowImage("processed", monoimgbot); // Find all contours. - cvFindContours(monoimgbot, storage, &contour, sizeof(CvContour), CV_RETR_LIST, - CV_CHAIN_APPROX_NONE, cvPoint(0, 0)); + cvFindContours(monoimgbot, storage, &contour, sizeof(CvContour), + CV_RETR_LIST, CV_CHAIN_APPROX_NONE, cvPoint(0, 0)); elipse retElipse; - retElipse.total=0; - retElipse.angle=-1; + retElipse.total = 0; + retElipse.angle = -1; // This cycle draw all contours and approximate it by ellipses. - for(;contour;contour = contour->h_next) - { + for (; contour; contour = contour->h_next) { - int count = contour->total; // This is number point in contour CvBox2D box; @@ -644,41 +647,37 @@ // Convert ellipse data from float to integer representation. - if(count>retElipse.total) { + if (count > retElipse.total) { retElipse.total = count; retElipse.angle = box.angle; retElipse.center = cvPointFrom32f(box.center); - retElipse.size.width = cvRound(box.size.width*0.5); - retElipse.size.height = cvRound(box.size.height*0.5); + retElipse.size.width = cvRound(box.size.width * 0.5); + retElipse.size.height = cvRound(box.size.height * 0.5); } cvReleaseMat(&points_f); } + if (retElipse.angle != -1) { + cvLine(monoimgbot, cvPoint(monoimgbot->width / 2, monoimgbot->height + / 2), cvPoint((monoimgbot->width / 2) + (100 * (sin( + (-retElipse.angle) * 3.14159265 / 180))), (monoimgbot->height + / 2) + (100 * (cos(-retElipse.angle * 3.14159265 / 180)))), + CV_RGB(0,0,255), 5); - if(retElipse.angle!=-1) { - cvLine(monoimgbot, cvPoint(monoimgbot->width / 2, monoimgbot->height / 2), - cvPoint((monoimgbot->width / 2) + (100 * (sin((-retElipse.angle) - * 3.14159265 / 180))), (monoimgbot->height / 2) + (100 - * (cos(-retElipse.angle * 3.14159265 / 180)))), - CV_RGB(0,0,255), 5); + cvCircle(monoimgbot, cvPoint(monoimgbot->width / 2, monoimgbot->height + / 2), 10, CV_RGB(0,0,255), 10); - cvCircle(monoimgbot, cvPoint(monoimgbot->width / 2, monoimgbot->height / 2), 10, - CV_RGB(0,0,255), 10); + // Draw ellipse. + cvEllipse(monoimgbot, retElipse.center, retElipse.size, + -retElipse.angle, 0, 360, CV_RGB(255,0,255), 1, CV_AA, 0); - // Draw ellipse. - cvEllipse(monoimgbot, retElipse.center, retElipse.size, -retElipse.angle, 0, 360, CV_RGB(255,0,255), - 1, CV_AA, 0); + cvCircle(monoimgbot, retElipse.center, 20, CV_RGB(0,255,0), 3); - - cvCircle(monoimgbot, retElipse.center, 20, CV_RGB(0,255,0), 3); - - } - // Show image. HighGUI use. @@ -691,29 +690,27 @@ int slider(char* functionName, char* imageFile) { - if(strcmp(functionName, "findBuoy") == 0) { + if (strcmp(functionName, "findBuoy") == 0) { readFile("config/buoy.txt", 4); - } - else if(strcmp(functionName, "finalFindPipe") == 0) { + } else if (strcmp(functionName, "finalFindPipe") == 0) { readFile("config/pipe.txt", 4); - } - else{ + } else { readFile("config/hedge.txt", 4); } cvNamedWindow("original", CV_WINDOW_AUTOSIZE); - cvNamedWindow("Monochrome Of red Blob", CV_WINDOW_AUTOSIZE); + cvNamedWindow("Processed", CV_WINDOW_AUTOSIZE); - cvCreateTrackbar("sthreshold", "Monochrome Of red Blob", &sthreshold, 255, - 0); - cvCreateTrackbar("hlower", "Monochrome Of red Blob", &hlower, 255, 0); - cvCreateTrackbar("hupper", "Monochrome Of red Blob", &hupper, 255, 0); - cvCreateTrackbar("erode", "Monochrome Of red Blob", &erode, 20, 0); - cvCreateTrackbar("dilate", "Monochrome Of red Blob", &dilate, 20, 0); + cvCreateTrackbar("sthreshold", "Processed", &sthreshold, 255, 0); + cvCreateTrackbar("hlower", "Processed", &hlower, 255, 0); + cvCreateTrackbar("hupper", "Processed", &hupper, 255, 0); + cvCreateTrackbar("erode", "Processed", &erode, 20, 0); + cvCreateTrackbar("dilate", "Processed", &dilate, 20, 0); int i, j, k;//for iterations int temp = 0;//if we use a temporary var + /*here lets look at the word \x93heighthsv\x94 \x85now lets breadk up this word\x85here height means height as a regular IplImage Structure has now the addition \x93hsv\x94 to the word heigh means this @@ -733,11 +730,10 @@ i = j = k = 0;/*initializing the iteraiton variables to be zero*/ - //frame = cvLoadImage("images/3dballs.jpg", 1); //frame=cvLoadImage("images/flipper.png",1); //frame=cvLoadImage("images/test7.png",1); - frame=cvLoadImage(imageFile,1); + frame = cvLoadImage(imageFile, 1); if (frame == NULL) { puts("unable to load the frame"); @@ -807,7 +803,7 @@ cvShowImage("original", frame); //cvSaveImage("red-ballmonochrome.jpg",monoimgbot);/*if you want to save the image*/ - cvShowImage("Monochrome Of red Blob", monoimgbot); + cvShowImage("Processed", monoimgbot); int c = cvWaitKey(0); if ((char) c == 27) break; @@ -816,48 +812,43 @@ check the other posts on this blog*/ } - cvDestroyWindow("Monochrome Of red Blob"); + cvDestroyWindow("Processed"); cvDestroyWindow("original"); - if(strcmp(functionName, "findBuoy") == 0) { + if (strcmp(functionName, "findBuoy") == 0) { saveFile("config/buoy.txt"); - } - else if(strcmp(functionName, "finalFindPipe") == 0) { + } else if (strcmp(functionName, "finalFindPipe") == 0) { saveFile("config/pipe.txt"); - } - else{ + } else { saveFile("config/hedge.txt"); } return 0; } -int showImage(char* functionName, char* img){ +int showImage(char* functionName, char* img) { - cvNamedWindow("original", CV_WINDOW_AUTOSIZE); cvNamedWindow("processed", CV_WINDOW_AUTOSIZE); - IplImage* image = cvLoadImage( img, CV_LOAD_IMAGE_COLOR ); + IplImage* image = cvLoadImage(img, CV_LOAD_IMAGE_COLOR ); if (image == NULL) { puts("unable to load the image"); exit(0); } - //display the original image + //display the original image cvShowImage("original", image); - if(strcmp(functionName, "findBuoy")==0){ + if (strcmp(functionName, "findBuoy") == 0) { findBuoy(image); - } - else if(strcmp(functionName, "finalFindPipe")==0){ + } else if (strcmp(functionName, "finalFindPipe") == 0) { finalFindPipe(image); - } - else if (strcmp(functionName, "findHedge") == 0) { + } else if (strcmp(functionName, "findHedge") == 0) { findHedge(image); } @@ -866,137 +857,125 @@ cvDestroyWindow("processed"); cvDestroyWindow("original"); - - } -int playVideo(char* functionName, char* video){ +int playVideo(char* functionName, char* video) { cvNamedWindow("original", CV_WINDOW_AUTOSIZE); cvNamedWindow("processed", CV_WINDOW_AUTOSIZE); - //CvCapture* capture = cvCreateFileCapture("videos/pipe3.avi"); - //CvCapture* capture = cvCreateFileCapture("videos/ets2007pipe.avi"); - //CvCapture* capture = cvCreateFileCapture("videos/ets2007buoy.avi"); - //CvCapture* capture = cvCreateFileCapture("videos/cuauvFinalForward.avi"); + int delay = 150; - CvCapture* capture = cvCreateFileCapture(video); + cvCreateTrackbar("Delay", "original", &delay, 150, 0); - IplImage *frame; + //CvCapture* capture = cvCreateFileCapture("videos/pipe3.avi"); + //CvCapture* capture = cvCreateFileCapture("videos/ets2007pipe.avi"); + //CvCapture* capture = cvCreateFileCapture("videos/ets2007buoy.avi"); + //CvCapture* capture = cvCreateFileCapture("videos/cuauvFinalForward.avi"); + CvCapture* capture = cvCreateFileCapture(video); + IplImage *frame; - if (!capture) { + if (!capture) { - printf("Cannot open video file!\n"); + printf("Cannot open video file!\n"); - exit(0); + exit(0); - } + } + for (;;) {/*keep looping till we are out of frames...*/ - for (;;) {/*keep looping till we are out of frames...*/ + if (!cvGrabFrame(capture)) { - if (!cvGrabFrame(capture)) { + break; - break; + } - } + frame = cvRetrieveFrame(capture); + if (frame == NULL) { + puts("unable to load the frame"); + exit(0); + } - frame = cvRetrieveFrame(capture); + elipse retElipse; + //elipse retElipse = finalFindPipe(frame); - if (frame == NULL) { - puts("unable to load the frame"); - exit(0); - } + if (strcmp("findBuoy", functionName) == 0) { - elipse retElipse; - //elipse retElipse = finalFindPipe(frame); + retElipse = findBuoy(frame); + } else if (strcmp("finalFindPipe", functionName) == 0) { - if(strcmp("findBuoy",functionName)==0){ + retElipse = finalFindPipe(frame); + } else if (strcmp("findHedge", functionName) == 0) { + retElipse = findHedge(frame); + } - retElipse = findBuoy(frame); - } - else if(strcmp("finalFindPipe",functionName)==0){ + if (retElipse.angle != -1) { + cvLine(frame, cvPoint(frame->width / 2, frame->height / 2), + cvPoint((frame->width / 2) + (100 * (sin((-retElipse.angle) + * 3.14159265 / 180))), (frame->height / 2) + (100 + * (cos(-retElipse.angle * 3.14159265 / 180)))), + CV_RGB(0,0,255), 5); - retElipse = finalFindPipe(frame); - } - else if (strcmp("findHedge", functionName) == 0) { - retElipse = findHedge(frame); - } + cvCircle(frame, cvPoint(frame->width / 2, frame->height / 2), 10, + CV_RGB(0,0,255), 10); - if(retElipse.angle!=-1) { - cvLine(frame, cvPoint(frame->width / 2, frame->height / 2), - cvPoint((frame->width / 2) + (100 * (sin((-retElipse.angle) - * 3.14159265 / 180))), (frame->height / 2) + (100 - * (cos(-retElipse.angle * 3.14159265 / 180)))), - CV_RGB(0,0,255), 5); + // Draw ellipse. + cvEllipse(frame, retElipse.center, retElipse.size, + -retElipse.angle, 0, 360, CV_RGB(255,0,255), 1, CV_AA, 0); - cvCircle(frame, cvPoint(frame->width / 2, frame->height / 2), 10, - CV_RGB(0,0,255), 10); + cvCircle(frame, retElipse.center, 10, CV_RGB(0,255,0), 5); - // Draw ellipse. - cvEllipse(frame, retElipse.center, retElipse.size, -retElipse.angle, 0, 360, CV_RGB(255,0,255), - 1, CV_AA, 0); + } + cvShowImage("original", frame); - cvCircle(frame, retElipse.center, 10, CV_RGB(0,255,0), 5); + int c = cvWaitKey(delay); + if ((char) c == 27) + break; + } - } + /* free memory */ + cvDestroyWindow("processed"); + cvDestroyWindow("original"); - cvShowImage("original", frame); + cvReleaseCapture(&capture); + return 1; - int c = cvWaitKey(150); - if ((char) c == 27) - break; - - } - - /* free memory */ - - - cvDestroyWindow("processed"); - cvDestroyWindow("original"); - - cvReleaseCapture(&capture); - - return 1; - } - - int main(int argc, char** argv) { readFile("config/buoy.txt", 1); readFile("config/pipe.txt", 2); readFile("config/hedge.txt", 3); + if (argc <= 1) { - if(argc<=1){ - char readuser[100]; char functionName[100]; char fileName[100]; int type = 1; - while(true){ + while (true) { - printf("\nMenu\n\n1: Video\n2: Image\n3: Config\n4: List of media\n5: Slider\n6: Exit\n\n"); + printf( + "\nMenu\n\n1: Video\n2: Image\n3: Config\n4: List of media\n5: Slider\n6: Exit\n\n"); printf("%**>"); gets(readuser); - if(strcmp(readuser, "q")==0||strcmp(readuser, "6")==0){ + if (strcmp(readuser, "q") == 0 || strcmp(readuser, "6") == 0) { //we exit the program exit(0); - } - else if(strcmp(readuser, "1")==0){ + } else if (strcmp(readuser, "1") == 0) { printf("Type 1 for findBuoy, 2 for findPipe, 3 for findHedge\n"); printf("%**>"); @@ -1007,17 +986,21 @@ type = atoi(functionName); - switch(type){ + switch (type) { - case(1): playVideo("findBuoy", fileName); break; - case(2): playVideo("finalFindPipe", fileName); break; - case(3): playVideo("findHedge", fileName); break; + case (1): + playVideo("findBuoy", fileName); + break; + case (2): + playVideo("finalFindPipe", fileName); + break; + case (3): + playVideo("findHedge", fileName); + break; } + } else if (strcmp(readuser, "2") == 0) { - } - else if(strcmp(readuser, "2")==0){ - printf("Type 1 for findBuoy, 2 for findPipe, 3 for findHedge\n"); printf("%**>"); gets(functionName); @@ -1027,46 +1010,49 @@ type = atoi(functionName); - switch(type){ + switch (type) { - case(1): showImage("findBuoy", fileName); break; - case(2): showImage("finalFindPipe", fileName); break; - case(3): showImage("findHedge", fileName); break; + case (1): + showImage("findBuoy", fileName); + break; + case (2): + showImage("finalFindPipe", fileName); + break; + case (3): + showImage("findHedge", fileName); + break; } + } else if (strcmp(readuser, "3") == 0) { - } - else if(strcmp(readuser, "3")==0){ - printf("Type 1 for findBuoy, 2 for findPipe, 3 for findHedge\n"); printf("%**>"); gets(functionName); type = atoi(functionName); - if(type==1){ + if (type == 1) { readFile("config/buoy.txt", type); - } - else if(type==2){ + } else if (type == 2) { readFile("config/pipe.txt", type); - } - else{ + } else { readFile("config/hedge.txt", type); } - } - else if(strcmp(readuser, "4")==0){ + } else if (strcmp(readuser, "4") == 0) { - printf("\nVideos\n******\nets2007buoy.avi\nets2007pipe.avi\npipe3.avi\ncuauvFinalForward.avi\nwire2.avi\n"); - printf("\nImages\n******\nbuoy.jpg\npipe.png\ntest2.png\ntest3.png\ntest4.png\ntest5.png\ntest6.png\nwire.png\nwire2.png\nwire3.png\nwire4.png\nwire5.png\n"); - printf("\nConfig Files\n************\npipe.txt\nhedge.txt\nbuoy.txt\n"); - } - else if(strcmp(readuser, "5")==0){ + printf( + "\nVideos\n******\nets2007buoy.avi\nets2007pipe.avi\npipe3.avi\ncuauvFinalForward.avi\nwire2.avi\n"); + printf( + "\nImages\n******\nbuoy.jpg\npipe.png\ntest2.png\ntest3.png\ntest4.png\ntest5.png\ntest6.png\nwire.png\nwire2.png\nwire3.png\nwire4.png\nwire5.png\n"); + printf( + "\nConfig Files\n************\npipe.txt\nhedge.txt\nbuoy.txt\n"); + } else if (strcmp(readuser, "5") == 0) { printf("Image file? Remember: images/...\n"); printf("%**>"); @@ -1078,23 +1064,20 @@ type = atoi(functionName); - if(type==1){ + if (type == 1) { slider("findBuoy", fileName); - } - else if(type==2){ + } else if (type == 2) { slider("finalFindPipe", fileName); - } - else{ + } else { slider("findHedge", fileName); } - } - else{ + } else { printf("\n You must choose an option from the menu\n"); @@ -1102,66 +1085,59 @@ }//end while - } - else{ + } else { readFile("config/buoy.txt", 1); readFile("config/pipe.txt", 2); readFile("config/hedge.txt", 3); - if(strcmp(argv[1], "-v")==0){ + if (strcmp(argv[1], "-v") == 0) { //then the person wants to play a video //make sure that the person puts the name of the method //as well as the name of the video - if(argc<4){ + if (argc < 4) { printf("Insufficient number of arguments.\n"); - } - else{ + } else { playVideo(argv[2], argv[3]); } - } - else if(strcmp(argv[1], "-i")==0){ + } else if (strcmp(argv[1], "-i") == 0) { - //then the person wants to play a video - //make sure that the person puts the name of the method - //as well as the name of the video + //then the person wants to play a video + //make sure that the person puts the name of the method + //as well as the name of the video - if(argc<4){ + if (argc < 4) { - printf("Insufficient number of arguments.\n"); - } - else{ + printf("Insufficient number of arguments.\n"); + } else { - showImage(argv[2], argv[3]); - } + showImage(argv[2], argv[3]); + } - } - else if(strcmp(argv[1], "-s")==0){ + } else if (strcmp(argv[1], "-s") == 0) { //then the person wants to play a video //make sure that the person puts the name of the method //as well as the name of the video - if(argc<4){ + if (argc < 4) { printf("Insufficient number of arguments.\n"); - } - else{ + } else { slider(argv[2], argv[3]); } - } - else{ + } else { printf("To view a video type vision.exe -v functionName video\n " - "To view an image type vision.exe -i functionName image\n" - "To view the slider utility type vision.exe -s functionName image\n"); + "To view an image type vision.exe -i functionName image\n" + "To view the slider utility type vision.exe -s functionName image\n"); } Modified: vision/src/test2.cpp =================================================================== --- vision/src/test2.cpp 2010-06-07 23:12:24 UTC (rev 26) +++ vision/src/test2.cpp 2010-06-08 00:08:21 UTC (rev 27) @@ -9,9 +9,9 @@ #define CONFIG "config/hedge.txt" #define IMAGE "images/wire5.png" -int sthreshold=0, hupper=0, hlower=0, erode=0, dilate=0; +int sthreshold1=0, hupper1=0, hlower1=0, erode1=0, dilate1=0; -void readFile(char* filename){ +void readFile1(char* filename){ FILE* filereader; @@ -33,15 +33,15 @@ sscanf(line, "%s %s", var, value); if(strncmp("sthreshold ", line, 11)==0) - sthreshold=atoi(value); + sthreshold1=atoi(value); else if(strncmp("hupper ", line, 7)==0) - hupper=atoi(value); + hupper1=atoi(value); else if(strncmp("hlower ", line, 7)==0) - hlower=atoi(value); + hlower1=atoi(value); else if(strncmp("erode ", line, 6)==0) - erode=atoi(value); + erode1=atoi(value); else if(strncmp("dilate ", line, 7)==0) - dilate=atoi(value); + dilate1=atoi(value); }//end while @@ -52,34 +52,34 @@ } } -void saveFile(char* filename) { +void saveFile1(char* filename) { FILE* filewriter; filewriter = fopen(filename, "w"); if(filewriter!=NULL){ - fprintf(filewriter, "sthreshold %d\n", sthreshold); - fprintf(filewriter, "hlower %d\n", hlower); - fprintf(filewriter, "hupper %d\n", hupper); - fprintf(filewriter, "erode %d\n", erode); - fprintf(filewriter, "dilate %d\n", dilate); + fprintf(filewriter, "sthreshold %d\n", sthreshold1); + fprintf(filewriter, "hlower %d\n", hlower1); + fprintf(filewriter, "hupper %d\n", hupper1); + fprintf(filewriter, "erode %d\n", erode1); + fprintf(filewriter, "dilate %d\n", dilate1); } } int nmain() { - readFile(CONFIG); + readFile1(CONFIG); cvNamedWindow("original", CV_WINDOW_AUTOSIZE); cvNamedWindow("Monochrome Of red Blob", CV_WINDOW_AUTOSIZE); - cvCreateTrackbar("sthreshold", "Monochrome Of red Blob", &sthreshold, 255, + cvCreateTrackbar("sthreshold", "Monochrome Of red Blob", &sthreshold1, 255, 0); - cvCreateTrackbar("hlower", "Monochrome Of red Blob", &hlower, 255, 0); - cvCreateTrackbar("hupper", "Monochrome Of red Blob", &hupper, 255, 0); - cvCreateTrackbar("erode", "Monochrome Of red Blob", &erode, 20, 0); - cvCreateTrackbar("dilate", "Monochrome Of red Blob", &dilate, 20, 0); + cvCreateTrackbar("hlower", "Monochrome Of red Blob", &hlower1, 255, 0); + cvCreateTrackbar("hupper", "Monochrome Of red Blob", &hupper1, 255, 0); + cvCreateTrackbar("erode", "Monochrome Of red Blob", &erode1, 20, 0); + cvCreateTrackbar("dilate", "Monochrome Of red Blob", &dilate1, 20, 0); int i, j, k;//for iterations int temp = 0;//if we use a temporary var @@ -136,10 +136,10 @@ for (i = 0; i < (heighthsv); i++) { for (j = 0; j < (widthhsv); j++) { - if ((datahsv[(i) * stephsv + j * channelshsv] <= hlower) - && (datahsv[(i) * stephsv + j * channelshsv] >= hupper)) { + if ((datahsv[(i) * stephsv + j * channelshsv] <= hlower1) + && (datahsv[(i) * stephsv + j * channelshsv] >= hupper1)) { if ((datahsv[(i) * stephsv + j * (channelshsv) + 1]) - > sthreshold) { + > sthreshold1) { datamono[i * stepmono + j * channelsmono] = 255; } else /*A very simple concept with the loops here if the hue values are in the aforementioned range and the @@ -165,8 +165,8 @@ or erosion*/ - cvErode(monoimgbot, monoimgbot, 0, erode); - cvDilate(monoimgbot, monoimgbot, 0, dilate); + cvErode(monoimgbot, monoimgbot, 0, erode1); + cvDilate(monoimgbot, monoimgbot, 0, dilate1); /*here i have experimented with the values by changing them\x85and i have found that i come to a good result by applying erosion 6 times and dilation 15 times you can comment/uncomment play with the values and see what is going on @@ -188,7 +188,7 @@ cvDestroyWindow("Monochrome Of red Blob"); cvDestroyWindow("original"); - saveFile(CONFIG); + saveFile1(CONFIG); return 0; } Modified: vision/src/test5.cpp =================================================================== --- vision/src/test5.cpp 2010-06-07 23:12:24 UTC (rev 26) +++ vision/src/test5.cpp 2010-06-08 00:08:21 UTC (rev 27) @@ -164,7 +164,7 @@ //cvReleaseImage( &cpy ); } -int zmain(int argc, char** argv) +int mmain(int argc, char** argv) { int sthreshold = 86, erode = 4, dialate = 8; Modified: vision/testimg.png =================================================================== (Binary files differ) Added: vision/vision.exe =================================================================== (Binary files differ) Property changes on: vision/vision.exe ___________________________________________________________________ Added: svn:mime-type + application/octet-stream This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |