Skip to content
Browse files

Revert new-image changes on the mainline

  • Loading branch information...
1 parent bedc304 commit 964134d301d7d9ff778ab561c6f39d31f668af44 edrosten committed Nov 12, 2010
View
210 .cproject
@@ -1,210 +0,0 @@
-<?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="0.132986640">
- <storageModule buildSystemId="org.eclipse.cdt.managedbuilder.core.configurationDataProvider" id="0.132986640" moduleId="org.eclipse.cdt.core.settings" name="Default">
- <externalSettings/>
- <extensions>
- <extension id="org.eclipse.cdt.core.VCErrorParser" point="org.eclipse.cdt.core.ErrorParser"/>
- <extension id="org.eclipse.cdt.core.GmakeErrorParser" point="org.eclipse.cdt.core.ErrorParser"/>
- <extension id="org.eclipse.cdt.core.CWDLocator" point="org.eclipse.cdt.core.ErrorParser"/>
- <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 buildProperties="" description="" id="0.132986640" name="Default" parent="org.eclipse.cdt.build.core.prefbase.cfg">
- <folderInfo id="0.132986640." name="/" resourcePath="">
- <toolChain id="org.eclipse.cdt.build.core.prefbase.toolchain.961750006" name="No ToolChain" resourceTypeBasedDiscovery="false" superClass="org.eclipse.cdt.build.core.prefbase.toolchain">
- <targetPlatform id="org.eclipse.cdt.build.core.prefbase.toolchain.961750006.787203814" name=""/>
- <builder id="org.eclipse.cdt.build.core.settings.default.builder.586101384" keepEnvironmentInBuildfile="false" managedBuildOn="false" name="Gnu Make Builder" superClass="org.eclipse.cdt.build.core.settings.default.builder"/>
- <tool id="org.eclipse.cdt.build.core.settings.holder.libs.475311302" name="holder for library settings" superClass="org.eclipse.cdt.build.core.settings.holder.libs"/>
- <tool id="org.eclipse.cdt.build.core.settings.holder.1479259644" name="Assembly" superClass="org.eclipse.cdt.build.core.settings.holder">
- <inputType id="org.eclipse.cdt.build.core.settings.holder.inType.1820441539" languageId="org.eclipse.cdt.core.assembly" languageName="Assembly" sourceContentType="org.eclipse.cdt.core.asmSource" superClass="org.eclipse.cdt.build.core.settings.holder.inType"/>
- </tool>
- <tool id="org.eclipse.cdt.build.core.settings.holder.672760169" name="GNU C++" superClass="org.eclipse.cdt.build.core.settings.holder">
- <inputType id="org.eclipse.cdt.build.core.settings.holder.inType.198207907" languageId="org.eclipse.cdt.core.g++" languageName="GNU C++" sourceContentType="org.eclipse.cdt.core.cxxSource,org.eclipse.cdt.core.cxxHeader" superClass="org.eclipse.cdt.build.core.settings.holder.inType"/>
- </tool>
- <tool id="org.eclipse.cdt.build.core.settings.holder.1071490753" name="GNU C" superClass="org.eclipse.cdt.build.core.settings.holder">
- <inputType id="org.eclipse.cdt.build.core.settings.holder.inType.1076580741" languageId="org.eclipse.cdt.core.gcc" languageName="GNU C" sourceContentType="org.eclipse.cdt.core.cSource,org.eclipse.cdt.core.cHeader" superClass="org.eclipse.cdt.build.core.settings.holder.inType"/>
- </tool>
- </toolChain>
- </folderInfo>
- </configuration>
- </storageModule>
- <storageModule moduleId="scannerConfiguration">
- <autodiscovery enabled="true" problemReportingEnabled="true" selectedProfileId=""/>
- <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="-E -P -v -dD" command="" 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 &quot;${plugin_state_location}/${specs_file}&quot;'" 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 &quot;${plugin_state_location}/specs.cpp&quot;'" 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 &quot;${plugin_state_location}/specs.c&quot;'" command="sh" useDefault="true"/>
- <parser enabled="true"/>
- </scannerInfoProvider>
- </profile>
- <scannerConfigBuildInfo instanceId="0.132986640">
- <autodiscovery enabled="true" problemReportingEnabled="true" selectedProfileId=""/>
- <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="-E -P -v -dD" command="" 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 &quot;${plugin_state_location}/${specs_file}&quot;'" 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 &quot;${plugin_state_location}/specs.cpp&quot;'" 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 &quot;${plugin_state_location}/specs.c&quot;'" command="sh" useDefault="true"/>
- <parser enabled="true"/>
- </scannerInfoProvider>
- </profile>
- </scannerConfigBuildInfo>
- </storageModule>
- <storageModule moduleId="org.eclipse.cdt.core.externalSettings"/>
- </cconfiguration>
- </storageModule>
- <storageModule moduleId="cdtBuildSystem" version="4.0.0">
- <project id="libcvd.null.232535217" name="libcvd"/>
- </storageModule>
-</cproject>
View
11 .cvsignore
@@ -1,11 +0,0 @@
-config.dep_progs
-config.dep_testprogs
-config.dep_tmp
-config.have_bits
-config.status
-Makefile
-libcvd_debug.a
-libcvd.a
-.sourcefiles
-.deps
-debug
View
79 .project
@@ -1,79 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<projectDescription>
- <name>libcvd</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.autoBuildTarget</key>
- <value>all</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.cleanBuildTarget</key>
- <value>clean</value>
- </dictionary>
- <dictionary>
- <key>org.eclipse.cdt.make.core.contents</key>
- <value>org.eclipse.cdt.make.core.activeConfigSettings</value>
- </dictionary>
- <dictionary>
- <key>org.eclipse.cdt.make.core.enableAutoBuild</key>
- <value>false</value>
- </dictionary>
- <dictionary>
- <key>org.eclipse.cdt.make.core.enableCleanBuild</key>
- <value>true</value>
- </dictionary>
- <dictionary>
- <key>org.eclipse.cdt.make.core.enableFullBuild</key>
- <value>true</value>
- </dictionary>
- <dictionary>
- <key>org.eclipse.cdt.make.core.fullBuildTarget</key>
- <value>all</value>
- </dictionary>
- <dictionary>
- <key>org.eclipse.cdt.make.core.stopOnError</key>
- <value>true</value>
- </dictionary>
- <dictionary>
- <key>org.eclipse.cdt.make.core.useDefaultBuildCmd</key>
- <value>true</value>
- </dictionary>
- </arguments>
- </buildCommand>
- <buildCommand>
- <name>org.eclipse.cdt.managedbuilder.core.ScannerConfigBuilder</name>
- <triggers>full,incremental,</triggers>
- <arguments>
- </arguments>
- </buildCommand>
- </buildSpec>
- <natures>
- <nature>org.eclipse.cdt.core.cnature</nature>
- <nature>org.eclipse.cdt.core.ccnature</nature>
- <nature>org.eclipse.cdt.managedbuilder.core.managedBuildNature</nature>
- <nature>org.eclipse.cdt.managedbuilder.core.ScannerConfigNature</nature>
- </natures>
-</projectDescription>
View
60 cvd/config.h
@@ -1,60 +0,0 @@
-#ifndef CVD_CONFIG_H
-#define CVD_CONFIG_H
-#define CVD_ARCH_LITTLE_ENDIAN 1
-#ifndef CVD_DISABLE_CPU_i386
- #define CVD_HAVE_CPU_i386 1
-#endif
-#ifndef CVD_DISABLE_GLOB
- #define CVD_HAVE_GLOB 1
-#endif
-#ifndef CVD_DISABLE_INLINE_ASM
- #define CVD_HAVE_INLINE_ASM 1
-#endif
-#ifndef CVD_DISABLE_LAPACK
- #define CVD_HAVE_LAPACK 1
-#endif
-#ifndef CVD_DISABLE_MEMALIGN
- #define CVD_HAVE_MEMALIGN 1
-#endif
-#ifndef CVD_DISABLE_MMX
- #define CVD_HAVE_MMX 1
-#endif
-#ifndef CVD_DISABLE_MMXEXT
- #define CVD_HAVE_MMXEXT 1
-#endif
-#ifndef CVD_DISABLE_PNG
- #define CVD_HAVE_PNG 1
-#endif
-#ifndef CVD_DISABLE_PTHREAD
- #define CVD_HAVE_PTHREAD 1
-#endif
-#ifndef CVD_DISABLE_PTHREAD_YIELD_NP
- #define CVD_HAVE_PTHREAD_YIELD_NP 1
-#endif
-#ifndef CVD_DISABLE_SSE
- #define CVD_HAVE_SSE 1
-#endif
-#ifndef CVD_DISABLE_SSE2
- #define CVD_HAVE_SSE2 1
-#endif
-#ifndef CVD_DISABLE_SSE3
- #define CVD_HAVE_SSE3 1
-#endif
-#ifndef CVD_DISABLE_TOON
- #define CVD_HAVE_TOON 1
-#endif
-#ifndef CVD_DISABLE_TR1_SHARED_PTR
- #define CVD_HAVE_TR1_SHARED_PTR 1
-#endif
-#ifndef CVD_DISABLE_VIDEODISPLAY
- #define CVD_HAVE_VIDEODISPLAY 1
-#endif
-#ifndef CVD_DISABLE_HALFSAMPLE_SSE16
- #define CVD_INTERNAL_HAVE_HALFSAMPLE_SSE16 1
-#endif
-#ifndef CVD_DISABLE_YV402P_MMX
- #define CVD_INTERNAL_HAVE_YV402P_MMX 1
-#endif
-#define CVD_MAJOR_VERSION 0
-#define CVD_MINOR_VERSION 8
-#endif
View
2 cvd/convolution.h
@@ -520,7 +520,7 @@ template <class T> void convolveGaussian(const BasicImage<T>& I, BasicImage<T>&
void compute_van_vliet_b(double sigma, double b[]);
void compute_triggs_M(const double b[], double M[][3]);
-void van_vliet_blur(const double b[], const BasicImage<float> in, BasicImage<float> out);
+void van_vliet_blur(const double b[], const SubImage<float> in, SubImage<float> out);
void convolveGaussian(const BasicImage<float>& I, BasicImage<float>& out, double sigma, double sigmas=3.0);
void convolveGaussian_fir(const BasicImage<float>& I, BasicImage<float>& out, double sigma, double sigmas=3.0);
View
12 cvd/draw.h
@@ -124,7 +124,7 @@ template <class T> struct color<T,3> {
/// @param c color of the line
/// @ingroup gGraphics
template <class T>
-void drawLine(BasicImage<T>& im, double x1, double y1, double x2, double y2, const T& c)
+void drawLine(SubImage<T>& im, double x1, double y1, double x2, double y2, const T& c)
{
double dx = x2-x1;
double dy = y2-y1;
@@ -146,7 +146,7 @@ void drawLine(BasicImage<T>& im, double x1, double y1, double x2, double y2, con
/// @param c color of the line
/// @ingroup gGraphics
template <class T>
-void drawLine(BasicImage<T>& im, const ImageRef& p1, const ImageRef& p2, const T& c)
+void drawLine(SubImage<T>& im, const ImageRef& p1, const ImageRef& p2, const T& c)
{
drawLine(im, double(p1.x), double(p1.y), double(p2.x), double(p2.y), c);
}
@@ -159,7 +159,7 @@ void drawLine(BasicImage<T>& im, const ImageRef& p1, const ImageRef& p2, const T
/// @param c color of the line
/// @ingroup gGraphics
template <class T>
-void drawLine(BasicImage<T>& im, const TooN::Vector<2>& p1, const TooN::Vector<2>& p2, const T& c)
+void drawLine(SubImage<T>& im, const TooN::Vector<2>& p1, const TooN::Vector<2>& p2, const T& c)
{
drawLine(im, p1[0], p1[1], p2[0], p2[1], c);
}
@@ -175,7 +175,7 @@ void drawLine(BasicImage<T>& im, const TooN::Vector<2>& p1, const TooN::Vector<2
/// @param c color of the line
/// @ingroup gGraphics
template <class T>
-void drawShape(BasicImage<T>& im, const ImageRef& offset, const std::vector<ImageRef>& points, const T& c)
+void drawShape(SubImage<T>& im, const ImageRef& offset, const std::vector<ImageRef>& points, const T& c)
{
for (unsigned int i=0; i<points.size()-1; i++)
drawLine(im, points[i]+offset, points[i+1]+offset, c);
@@ -213,7 +213,7 @@ void drawShape(Image<T>& im, const ImageRef& offset,
/// @param c color of the box
/// @ingroup gGraphics
template <class T>
-void drawBox(BasicImage<T> &im, const ImageRef & upperleft, const ImageRef & lowerright, const T& c)
+void drawBox(SubImage<T> &im, const ImageRef & upperleft, const ImageRef & lowerright, const T& c)
{
drawLine(im, upperleft.x, upperleft.y, upperleft.x, lowerright.y, c);
drawLine(im, upperleft.x, upperleft.y, lowerright.x, upperleft.y, c);
@@ -228,7 +228,7 @@ void drawBox(BasicImage<T> &im, const ImageRef & upperleft, const ImageRef & low
/// @param c color of the box
/// @ingroup gGraphics
template <class T>
-void drawCross(BasicImage<T>& im, const ImageRef& p, double len, const T& c)
+void drawCross(SubImage<T>& im, const ImageRef& p, double len, const T& c)
{
drawLine(im, p.x-len, p.y, p.x+len, p.y, c);
drawLine(im, p.x, p.y-len, p.x, p.y+len, c);
View
12 cvd/fast_corner.h
@@ -60,7 +60,7 @@ namespace CVD
/// @param barrier Initial corner detection threshold. Using the same threshold as for corner detection will produce the
/// quickest results, but any lower value (e.g. 0) will produce correct results.
/// @ingroup gVision
- void fast_corner_score_7(const BasicImage<byte>& i, const std::vector<ImageRef>& corners, int b, std::vector<int>& scores);
+ void fast_corner_score_7(const SubImage<byte>& i, const std::vector<ImageRef>& corners, int b, std::vector<int>& scores);
/// Perform tree based 8 point FAST feature detection. This is more like an edge detector.
@@ -80,7 +80,7 @@ namespace CVD
/// @param barrier Initial corner detection threshold. Using the same threshold as for corner detection will produce the
/// quickest results, but any lower value (e.g. 0) will produce correct results.
/// @ingroup gVision
- void fast_corner_score_8(const BasicImage<byte>& i, const std::vector<ImageRef>& corners, int b, std::vector<int>& scores);
+ void fast_corner_score_8(const SubImage<byte>& i, const std::vector<ImageRef>& corners, int b, std::vector<int>& scores);
/** Perform tree based 9 point FAST feature detection as described in:
@@ -113,7 +113,7 @@ namespace CVD
/// @param barrier Initial corner detection threshold. Using the same threshold as for corner detection will produce the
/// quickest results, but any lower value (e.g. 0) will produce correct results.
/// @ingroup gVision
- void fast_corner_score_9(const BasicImage<byte>& i, const std::vector<ImageRef>& corners, int b, std::vector<int>& scores);
+ void fast_corner_score_9(const SubImage<byte>& i, const std::vector<ImageRef>& corners, int b, std::vector<int>& scores);
///Perform FAST-9 corner detection (see @ref fast_corner_detect_9), with nonmaximal
@@ -142,7 +142,7 @@ namespace CVD
/// @param barrier Initial corner detection threshold. Using the same threshold as for corner detection will produce the
/// quickest results, but any lower value (e.g. 0) will produce correct results.
/// @ingroup gVision
- void fast_corner_score_10(const BasicImage<byte>& i, const std::vector<ImageRef>& corners, int b, std::vector<int>& scores);
+ void fast_corner_score_10(const SubImage<byte>& i, const std::vector<ImageRef>& corners, int b, std::vector<int>& scores);
/// Perform tree based 11 point FAST feature detection
/// If you use this, please cite the paper given in @ref fast_corner_detect_9
@@ -161,7 +161,7 @@ namespace CVD
/// @param barrier Initial corner detection threshold. Using the same threshold as for corner detection will produce the
/// quickest results, but any lower value (e.g. 0) will produce correct results.
/// @ingroup gVision
- void fast_corner_score_11(const BasicImage<byte>& i, const std::vector<ImageRef>& corners, int b, std::vector<int>& scores);
+ void fast_corner_score_11(const SubImage<byte>& i, const std::vector<ImageRef>& corners, int b, std::vector<int>& scores);
/// Perform tree based 12 point FAST feature detection
/// If you use this, please cite the paper given in @ref fast_corner_detect_9
@@ -180,7 +180,7 @@ namespace CVD
/// @param barrier Initial corner detection threshold. Using the same threshold as for corner detection will produce the
/// quickest results, but any lower value (e.g. 0) will produce correct results.
/// @ingroup gVision
- void fast_corner_score_12(const BasicImage<byte>& i, const std::vector<ImageRef>& corners, int b, std::vector<int>& scores);
+ void fast_corner_score_12(const SubImage<byte>& i, const std::vector<ImageRef>& corners, int b, std::vector<int>& scores);
View
6 cvd/gl_helpers.h
@@ -527,7 +527,7 @@ namespace CVD
/// Use glRasterPos to set the current raster position
/// @param i The image to draw
///@ingroup gGL
- template<class C> inline void glDrawPixels(const BasicImage<C>& i)
+ template<class C> inline void glDrawPixels(const SubImage<C>& i)
{
::glPixelStorei(GL_UNPACK_ALIGNMENT, 1);
::glPixelStorei(GL_UNPACK_ROW_LENGTH, i.row_stride());
@@ -559,7 +559,7 @@ namespace CVD
/// note the reordering of the various parameters to make better use of default parameters
/// @param i the image to set as texture
/// @ingroup gGL
- template<class C> inline void glTexBasicImage2D( const BasicImage<C> &i, GLint xoffset = 0, GLint yoffset = 0, GLenum target = GL_TEXTURE_2D, GLint level = 0)
+ template<class C> inline void glTexSubImage2D( const SubImage<C> &i, GLint xoffset = 0, GLint yoffset = 0, GLenum target = GL_TEXTURE_2D, GLint level = 0)
{
::glPixelStorei(GL_UNPACK_ALIGNMENT, 1);
::glPixelStorei(GL_UNPACK_ROW_LENGTH, i.row_stride());
@@ -571,7 +571,7 @@ namespace CVD
/// note the reordering of the various parameters to make better use of default parameters
/// @param i the image to set as texture
/// @ingroup gGL
- template<class C> inline void glTexImage2D( const BasicImage<C> &i, GLint border = 0, GLenum target = GL_TEXTURE_2D, GLint level = 0)
+ template<class C> inline void glTexImage2D( const SubImage<C> &i, GLint border = 0, GLenum target = GL_TEXTURE_2D, GLint level = 0)
{
::glPixelStorei(GL_UNPACK_ALIGNMENT, 1);
::glPixelStorei(GL_UNPACK_ROW_LENGTH, i.row_stride());
View
91 cvd/image.h
@@ -125,13 +125,13 @@ namespace ImageUtil
}
}
-template<class T> class BasicImage;
+template<class T> class SubImage;
-template<class T> class ConstBasicImageIterator
+template<class T> class ConstSubImageIterator
{
public:
- const ConstBasicImageIterator& operator++()
+ const ConstSubImageIterator& operator++()
{
ptr++;
if(ptr == row_end)
@@ -149,11 +149,11 @@ template<class T> class ConstBasicImageIterator
{
operator++();
}
-
+
const T* operator->() const { return ptr; }
const T& operator*() const { return *ptr;}
- bool operator<(const ConstBasicImageIterator& s) const
+ bool operator<(const ConstSubImageIterator& s) const
{
//It's illegal to iterate _past_ end(), so < is equivalent to !=
//for end iterators.
@@ -167,12 +167,12 @@ template<class T> class ConstBasicImageIterator
return ptr < s.ptr;
}
- bool operator==(const ConstBasicImageIterator& s) const
+ bool operator==(const ConstSubImageIterator& s) const
{
return !((*this)!=s);
}
- bool operator!=(const ConstBasicImageIterator& s) const
+ bool operator!=(const ConstSubImageIterator& s) const
{
if(is_end && s.is_end)
return 0;
@@ -194,10 +194,10 @@ template<class T> class ConstBasicImageIterator
- ConstBasicImageIterator()
+ ConstSubImageIterator()
{}
- ConstBasicImageIterator(const T* start, int image_width, int row_stride, const T* off_end)
+ ConstSubImageIterator(const T* start, int image_width, int row_stride, const T* off_end)
:ptr(const_cast<T*>(start)),
row_end(start + image_width),
end(off_end),
@@ -207,7 +207,7 @@ template<class T> class ConstBasicImageIterator
{ }
//Prevent automatic conversion from a pointer (ie Image::iterator)
- explicit ConstBasicImageIterator(const T* end)
+ explicit ConstSubImageIterator(const T* end)
:ptr(const_cast<T*>(end)),is_end(1),row_increment(0),total_width(0)
{ }
@@ -218,25 +218,25 @@ template<class T> class ConstBasicImageIterator
int row_increment, total_width;
};
-template<class T> class BasicImageIterator: public ConstBasicImageIterator<T>
+template<class T> class SubImageIterator: public ConstSubImageIterator<T>
{
public:
- BasicImageIterator(T* start, int image_width, int row_stride, const T* off_end)
- :ConstBasicImageIterator<T>(start, image_width, row_stride, off_end)
+ SubImageIterator(T* start, int image_width, int row_stride, const T* off_end)
+ :ConstSubImageIterator<T>(start, image_width, row_stride, off_end)
{}
- explicit BasicImageIterator(T* end)
- :ConstBasicImageIterator<T>(end)
+ explicit SubImageIterator(T* end)
+ :ConstSubImageIterator<T>(end)
{ }
- BasicImageIterator()
+ SubImageIterator()
{}
typedef T* pointer;
typedef T& reference;
- T* operator->() { return ConstBasicImageIterator<T>::ptr; }
- T& operator*() { return *ConstBasicImageIterator<T>::ptr;}
+ T* operator->() { return ConstSubImageIterator<T>::ptr; }
+ T& operator*() { return *ConstSubImageIterator<T>::ptr;}
};
/// A generic image class to manage a block of arbitrarily padded data as an image. Provides
@@ -249,14 +249,14 @@ template<class T> class BasicImageIterator: public ConstBasicImageIterator<T>
/// arbitrary externally-managed block of data as though it were an image. Use
/// the derived Image class if you want an image which also has its own data.
/// @ingroup gImage
-template<class T> class BasicImage
+template<class T> class SubImage
{
public:
/// Construct an image from a block of data.
/// @param data The image data in horizontal scanline order
/// @param size The size of the image
/// @param stride The row stride (or width, including the padding)
- BasicImage(T* data, const ImageRef& size, int stride = size.x)
+ SubImage(T* data, const ImageRef& size, int stride)
:my_data(data),my_size(size),my_stride(stride)
{
}
@@ -278,7 +278,7 @@ template<class T> class BasicImage
}
/// The image data is not destroyed when a BasicImage is destroyed.
- ~BasicImage()
+ ~SubImage()
{}
/// Access a pixel from the image. Bounds checking is only performed if the library is compiled
@@ -338,37 +338,37 @@ template<class T> class BasicImage
return my_data;
}
- typedef BasicImageIterator<T> iterator;
- typedef ConstBasicImageIterator<T> const_iterator;
+ typedef SubImageIterator<T> iterator;
+ typedef ConstSubImageIterator<T> const_iterator;
/// The data type of the pixels in the image.
typedef T value_type;
/// Returns an iterator referencing the first (top-left) pixel in the image
inline iterator begin()
{
- return iterator(data(), size().x, my_stride, end_ptr());
+ return SubImageIterator<T>(data(), size().x, my_stride, end_ptr());
}
/// Returns a const iterator referencing the first (top-left) pixel in the image
inline const_iterator begin() const
{
- return const_iterator(data(), size().x, my_stride, end_ptr());
+ return ConstSubImageIterator<T>(data(), size().x, my_stride, end_ptr());
}
/// Returns an iterator pointing to one past the end of the image
inline iterator end()
{
//Operator [] would always throw here!
- return iterator(end_ptr());
+ return SubImageIterator<T>(end_ptr());
}
/// Returns a const iterator pointing to one past the end of the image
inline const_iterator end() const
{
//Operator [] would always throw here!
- return const_iterator(end_ptr());
+ return ConstSubImageIterator<T>(end_ptr());
}
- inline void copy_from( const BasicImage<T> & other ){
+ inline void copy_from( const SubImage<T> & other ){
CVD_IMAGE_ASSERT(other.size() == this->size(), Exceptions::Image::IncompatibleImageSizes);
std::copy(other.begin(), other.end(), this->begin());
}
@@ -407,7 +407,7 @@ template<class T> class BasicImage
/// Copy constructor
/// @param copyof The image to copy
- BasicImage(const BasicImage& copyof)
+ SubImage(const SubImage& copyof)
{
my_size = copyof.my_size;
my_data = copyof.my_data;
@@ -418,29 +418,27 @@ template<class T> class BasicImage
/// Return a sub image
/// @param start Top left pixel of the sub image
/// @param size width and height of the sub image
- BasicImage sub_image(const ImageRef& start, const ImageRef& size)
+ SubImage sub_image(const ImageRef& start, const ImageRef& size)
{
CVD_IMAGE_ASSERT(in_image(start), ImageError::AccessOutsideImage);
CVD_IMAGE_ASSERT(in_image(start + size - ImageRef(1,1)), ImageError::AccessOutsideImage);
-
- T* ptr = my_data + start.y * my_stride + start.x;
- return BasicImage(ptr, size, my_stride);
+ return SubImage( &operator[](start), size, my_stride);
}
/// Return const a sub image
/// @param start Top left pixel of the sub image
/// @param size width and height of the sub image
- const BasicImage sub_image(const ImageRef& start, const ImageRef& size) const
+ const SubImage sub_image(const ImageRef& start, const ImageRef& size) const
{
CVD_IMAGE_ASSERT(in_image(start), ImageError::AccessOutsideImage);
CVD_IMAGE_ASSERT(in_image(start + size - ImageRef(1,1)), ImageError::AccessOutsideImage);
- T* ptr = my_data + start.y * my_stride + start.x;
- return BasicImage(ptr, size, my_stride);
+ T*ptr = my_data + start.y * my_stride + start.x;
+ return SubImage(ptr, size, my_stride);
}
/// Return a reference to a SubImage. Useful for passing anonymous SubImages to functions.
- BasicImage& ref()
+ SubImage& ref()
{
return *this;
}
@@ -456,14 +454,12 @@ template<class T> class BasicImage
///Return an off-the-end pointer without ever throwing AccessOutsideImage
const T* end_ptr() const { return my_data+my_size.y*my_stride; }
- BasicImage()
+ SubImage()
{}
};
-#if 0
-
/// A generic image class to manage a block of data as an image. Provides
/// basic image access such as accessing a particular pixel co-ordinate.
/// @param T The pixel type for this image. Typically either
@@ -535,14 +531,14 @@ template<class T> class BasicImage: public SubImage<T>
iterator end() { return SubImage<T>::my_data+SubImage<T>::totalsize(); }
+
protected:
/// The default constructor does nothing
BasicImage()
{}
private:
};
-#endif
/** An input iterator which just returns N copies of the same
value over and over again. This can be used for construction
@@ -679,6 +675,19 @@ class Image: public BasicImage<T>
std::copy(copy.begin(), copy.end(), this->begin());
}
+
+
+
+ ///Make a (new) copy of the image, also making a copy of the data
+ ///@param copy The image to copy
+ void copy_from(const SubImage<T>& copy)
+ {
+ Image<T> tmp(copy.size());
+ *this = tmp;
+
+ std::copy(copy.begin(), copy.end(), this->begin());
+ }
+
///Make this image independent of any copies (i.e. force a copy of the image data).
void make_unique()
{
View
35 cvd/image_convert.h
@@ -32,37 +32,44 @@ namespace CVD
// The most general case: one row at a time
template <class From, class To, class Conv=typename Pixel::DefaultConversion<From,To>::type, int both_pod=Internal::is_POD<From>::is_pod && Internal::is_POD<To>::is_pod> struct ConvertImage {
- static void convert(const BasicImage<From>& from, BasicImage<To>& to) {
+ static void convert(const SubImage<From>& from, SubImage<To>& to) {
for (int r=0; r<from.size().y; r++)
Pixel::ConvertPixels<From,To,Conv>::convert(from[r], to[r], from.size().x);
};
};
// The blat case: memcpy all data at once
template <class T> struct ConvertImage<T,T,Pixel::GenericConversion<T,T>,1> {
- static void convert(const BasicImage<T>& from, BasicImage<T>& to) {
+ static void convert(const SubImage<T>& from, SubImage<T>& to) {
memcpy(to.data(), from.data(), from.totalsize() * sizeof(T));
};
};
template <> struct ConvertImage<Rgb<byte>, byte, Pixel::CIE<Rgb<byte>, byte>, 1> {
- static void convert(const BasicImage<Rgb<byte> >& from, BasicImage<byte>& to);
+ static void convert(const SubImage<Rgb<byte> >& from, SubImage<byte>& to);
};
- template<class Conv, class C, class D> void convert_image(const BasicImage<C>& from, BasicImage<D>& to)
+ template<class Conv, class C, class D> void convert_image(const SubImage<C>& from, SubImage<D>& to)
{
if (from.size() != to.size())
throw Exceptions::Image::IncompatibleImageSizes(__FUNCTION__);
ConvertImage<C,D,Conv>::convert(from, to);
}
- template<template <class From, class To> class Conv, class C, class D> void convert_image(const BasicImage<C>& from, BasicImage<D>& to)
+ template<template <class From, class To> class Conv, class C, class D> void convert_image(const SubImage<C>& from, SubImage<D>& to)
{
if (from.size() != to.size())
throw Exceptions::Image::IncompatibleImageSizes(__FUNCTION__);
ConvertImage<C,D,Conv<C,D> >::convert(from, to);
}
+ template<class C, class D> void convert_image(const SubImage<C>& from, SubImage<D>& to)
+ {
+ if (from.size() != to.size())
+ throw Exceptions::Image::IncompatibleImageSizes(__FUNCTION__);
+ ConvertImage<C,D>::convert(from, to);
+ }
+
template<class C, class D> void convert_image(const BasicImage<C>& from, BasicImage<D>& to)
{
if (from.size() != to.size())
@@ -76,14 +83,14 @@ namespace CVD
/// @param Conv The conversion to use
/// @param from The image to convert from
/// @ingroup gImageIO
- template<class D, class Conv, class C> Image<D> convert_image(const BasicImage<C>& from)
+ template<class D, class Conv, class C> Image<D> convert_image(const SubImage<C>& from)
{
Image<D> to(from.size());
convert_image<Conv>(from, to);
return to;
}
- template<class D, template <class From, class To> class Conv, class C> Image<D> convert_image(const BasicImage<C>& from)
+ template<class D, template <class From, class To> class Conv, class C> Image<D> convert_image(const SubImage<C>& from)
{
Image<D> to(from.size());
convert_image<Conv>(from, to);
@@ -95,13 +102,25 @@ namespace CVD
/// @param C The source image pixel type
/// @param from The image to convert from
/// @ingroup gImageIO
- template<class D, class C> Image<D> convert_image(const BasicImage<C>& from)
+ template<class D, class C> Image<D> convert_image(const SubImage<C>& from)
{
Image<D> to(from.size());
convert_image(from, to);
return to;
}
+ /// Convert an image from one type to another using the default.
+ /// @param D The destination image pixel type
+ /// @param C The source image pixel type
+ /// @param from The image to convert from
+ /// @ingroup gImageIO
+ template<class D, class C> Image<D> convert_image(const BasicImage<C>& from)
+ {
+ Image<D> to(from.size());
+ convert_image(from, to);
+ return to;
+ }
+
// Function name changed from 'convert_image' to prevent compile-time
// error arising from the clash with a function of same name declared above.
View
8 cvd/integral_image.h
@@ -37,7 +37,7 @@ namespace CVD
/// @param out The source image.
/// @ingroup gVision
- template<class S, class D> void integral_image(const BasicImage<S>& in, BasicImage<D>& out)
+ template<class S, class D> void integral_image(const SubImage<S>& in, SubImage<D>& out)
{
if( in.size() != out.size())
throw Exceptions::Vision::IncompatibleImageSizes("integral_image");
@@ -71,11 +71,11 @@ namespace CVD
template<class C> struct ImagePromise<IntegralImage<C> >
{
- ImagePromise(const BasicImage<C>& im)
+ ImagePromise(const SubImage<C>& im)
:i(im)
{}
- const BasicImage<C>& i;
+ const SubImage<C>& i;
template<class D> void execute(Image<D>& j)
{
j.resize(i.size());
@@ -84,7 +84,7 @@ namespace CVD
};
};
- template<class C> Internal::ImagePromise<Internal::IntegralImage<C> > integral_image(const BasicImage<C>& c)
+ template<class C> Internal::ImagePromise<Internal::IntegralImage<C> > integral_image(const SubImage<C>& c)
{
return Internal::ImagePromise<Internal::IntegralImage<C> >(c);
}
View
10 cvd/internal/load_and_save.h
@@ -182,7 +182,7 @@ namespace CVD {
// is performed.
template<class PixelType, class DiskPixelType, class ImageLoader> struct read_and_maybe_process
{
- static void exec(BasicImage<PixelType>& im, ImageLoader& r)
+ static void exec(SubImage<PixelType>& im, ImageLoader& r)
{
Image<DiskPixelType> rowbuf(ImageRef(r.size().x, 1));
@@ -196,7 +196,7 @@ namespace CVD {
template<class PixelType, class ImageLoader> struct read_and_maybe_process<PixelType, PixelType, ImageLoader>
{
- static void exec(BasicImage<PixelType>& im, ImageLoader& r)
+ static void exec(SubImage<PixelType>& im, ImageLoader& r)
{
for(int row = 0; row < r.size().y; row++)
r.get_raw_pixel_line(im[row]);
@@ -301,7 +301,7 @@ namespace CVD {
//
template<class Pixel, class ImageWriter, class OutgoingPixel> struct maybe_process_and_write
{
- static void write(std::ostream& os, const BasicImage<Pixel>& im, const std::map<std::string, Parameter<> >& p)
+ static void write(std::ostream& os, const SubImage<Pixel>& im, const std::map<std::string, Parameter<> >& p)
{
ImageWriter w(os, im.size(), CVD::PNM::type_name<OutgoingPixel>::name(), p);
Image<OutgoingPixel> row(ImageRef(im.size().x, 1));
@@ -316,15 +316,15 @@ namespace CVD {
template<class Pixel, class ImageWriter> struct maybe_process_and_write<Pixel, ImageWriter, Pixel>
{
- static void write(std::ostream& os, const BasicImage<Pixel>& im, const std::map<std::string, Parameter<> >& p)
+ static void write(std::ostream& os, const SubImage<Pixel>& im, const std::map<std::string, Parameter<> >& p)
{
ImageWriter w(os, im.size(), CVD::PNM::type_name<Pixel>::name(), p);
for(int r=0; r < im.size().y; r++)
w.write_raw_pixel_line(im[r]);
}
};
- template<class Pixel, class Writer> void writeImage(const BasicImage<Pixel>& im, std::ostream& o, const std::map<std::string, Parameter<> >& p)
+ template<class Pixel, class Writer> void writeImage(const SubImage<Pixel>& im, std::ostream& o, const std::map<std::string, Parameter<> >& p)
{
maybe_process_and_write<Pixel, Writer, typename Writer::template Outgoing<Pixel>::type>::write(o, im, p);
}
View
20 cvd/morphology.h
@@ -17,7 +17,7 @@ namespace CVD
using namespace std;
//Compute pointer offsets for a bunch of ImageRef offsets.
- template<class T> vector<ptrdiff_t> offsets(const vector<ImageRef>& v, const BasicImage<T>& s)
+ template<class T> vector<ptrdiff_t> offsets(const vector<ImageRef>& v, const SubImage<T>& s)
{
vector<ptrdiff_t> off;
@@ -79,7 +79,7 @@ namespace CVD
/// @param out The destination image.
/// @ingroup gVision
template<class Accumulator, class T>
- void morphology(const BasicImage<T>& in, const std::vector<ImageRef>& selem, const Accumulator& a_, BasicImage<T>& out)
+ void morphology(const SubImage<T>& in, const std::vector<ImageRef>& selem, const Accumulator& a_, SubImage<T>& out)
{
using Internal::MorphologyHelpers::offsets;
using Internal::MorphologyHelpers::row_split;
@@ -277,11 +277,11 @@ namespace CVD
template<class C, class D> struct ImagePromise<PerformMorphology<C, D> >
{
- ImagePromise(const BasicImage<C>& im, const D& acc, const std::vector<ImageRef>& s_)
+ ImagePromise(const SubImage<C>& im, const D& acc, const std::vector<ImageRef>& s_)
:i(im),a(acc),s(s_)
{}
- const BasicImage<C>& i;
+ const SubImage<C>& i;
const D& a;
const std::vector<ImageRef>& s;
@@ -293,7 +293,7 @@ namespace CVD
};
};
- template<class C, class D> Internal::ImagePromise<Internal::PerformMorphology<C, D> > morphology(const BasicImage<C>& c, const std::vector<ImageRef>& selem, const D& a)
+ template<class C, class D> Internal::ImagePromise<Internal::PerformMorphology<C, D> > morphology(const SubImage<C>& c, const std::vector<ImageRef>& selem, const D& a)
{
return Internal::ImagePromise<Internal::PerformMorphology<C, D> >(c, a, selem);
}
@@ -306,7 +306,7 @@ namespace CVD
/// @param a_ The morphological operation to perform. See Morphology
/// @param out The destination image.
/// @ingroup gVision
- Image<T> morphology(const BasicImage<T>& in, const std::vector<ImageRef>& selem, const Accumulator& a_);
+ Image<T> morphology(const SubImage<T>& in, const std::vector<ImageRef>& selem, const Accumulator& a_);
#endif
@@ -592,7 +592,7 @@ namespace CVD
return v[2];
}
- template<class T> T median4(const BasicImage<T>& im, int r, int c)
+ template<class T> T median4(const SubImage<T>& im, int r, int c)
{
return median4(im[r][c], im[r][c+1], im[r+1][c], im[r+1][c+1]);
}
@@ -604,18 +604,18 @@ namespace CVD
return v[3];
}
- template<class T> T median6_row(const BasicImage<T>& im, int r, int c)
+ template<class T> T median6_row(const SubImage<T>& im, int r, int c)
{
return median6(im[r][c], im[r][c+1], im[r][c+2], im[r+1][c], im[r+1][c+1], im[r+1][c+2]);
}
- template<class T> T median6_col(const BasicImage<T>& im, int r, int c)
+ template<class T> T median6_col(const SubImage<T>& im, int r, int c)
{
return median6(im[r][c], im[r][c+1], im[r+1][c], im[r+1][c+1], im[r+2][c], im[r+2][c+1]);
}
};
- void morphology(const BasicImage<byte>& in, const std::vector<ImageRef>& selem, const Morphology::Median<byte>& m, BasicImage<byte>& out)
+ void morphology(const SubImage<byte>& in, const std::vector<ImageRef>& selem, const Morphology::Median<byte>& m, SubImage<byte>& out)
{
//If we happen to be given a 3x3 square, then perform
//median filtering using the hand coded functions.
View
4 cvd/tensor_voting.h
@@ -77,7 +77,7 @@ namespace CVD
@param num_divs The voting kernels are quantized by angle in to this many dicisions in the half-circle.
@ingroup gVision
**/
- template<class C> Image<TooN::Matrix<2> > dense_tensor_vote_gradients(const BasicImage<C>& image, double sigma, double ratio, double cutoff=0.001, unsigned int num_divs = 4096)
+ template<class C> Image<TooN::Matrix<2> > dense_tensor_vote_gradients(const SubImage<C>& image, double sigma, double ratio, double cutoff=0.001, unsigned int num_divs = 4096)
{
using TooN::Matrix;
using std::pair;
@@ -168,7 +168,7 @@ namespace CVD
#ifdef CVD_EXPERIMENTAL
- template<class C> Image<TooN::Matrix<2> > dense_tensor_vote_gradients_fast(const BasicImage<C>& image, double sigma, double ratio, double cutoff=0.001, int num_divs = 4096)
+ template<class C> Image<TooN::Matrix<2> > dense_tensor_vote_gradients_fast(const SubImage<C>& image, double sigma, double ratio, double cutoff=0.001, int num_divs = 4096)
{
using TooN::Matrix;
using std::pair;
View
2 cvd/utility.h
@@ -102,7 +102,7 @@ in the output image
/// @param pix Fill value
/// @param w border width
/// @ingroup gUtility
- template<class T> void fillBorders(BasicImage<T>& im, const T pix, int w=1)
+ template<class T> void fillBorders(SubImage<T>& im, const T pix, int w=1)
{
//Fill the top and bottom
for(int n=0; n < w; n++)
View
2 cvd/videoframe.h
@@ -59,7 +59,7 @@ class VideoFrame : public BasicImage<T>
/// @param data The image data for this frame
/// @param size The size of this video frame
VideoFrame(double t, T* data, const ImageRef& size, VideoFrameFlags::FieldType f=VideoFrameFlags::Unknown)
- :BasicImage<T>(data, size, size.x), my_field(f),my_timestamp(t)
+ :BasicImage<T>(data, size),my_field(f),my_timestamp(t)
{
}
View
31 cvd/vision.h
@@ -44,7 +44,7 @@ namespace CVD{
@throw IncompatibleImageSizes if out does not have the correct dimensions.
@ingroup gVision
*/
-template<class C> void twoThirdsSample(const BasicImage<C>& in, BasicImage<C>& out)
+template<class C> void twoThirdsSample(const SubImage<C>& in, SubImage<C>& out)
{
typedef typename Pixel::traits<C>::wider_type sum_type;
if( (in.size()/3*2) != out.size())
@@ -73,27 +73,27 @@ template<class C> void twoThirdsSample(const BasicImage<C>& in, BasicImage<C>& o
/**
@overload
*/
-void twoThirdsSample(const BasicImage<byte>& in, BasicImage<byte>& out);
+void twoThirdsSample(const SubImage<byte>& in, SubImage<byte>& out);
#ifndef DOXYGEN_IGNORE_INTERNAL
namespace Internal
{
template<class C> class twoThirdsSampler{};
template<class C> struct ImagePromise<twoThirdsSampler<C> >
{
- ImagePromise(const BasicImage<C>& im)
+ ImagePromise(const SubImage<C>& im)
:i(im)
{}
- const BasicImage<C>& i;
+ const SubImage<C>& i;
template<class D> void execute(Image<D>& j)
{
j.resize(i.size()/3*2);
twoThirdsSample(i, j);
}
};
};
- template<class C> Internal::ImagePromise<Internal::twoThirdsSampler<C> > twoThirdsSample(const BasicImage<C>& c)
+ template<class C> Internal::ImagePromise<Internal::twoThirdsSampler<C> > twoThirdsSample(const SubImage<C>& c)
{
return Internal::ImagePromise<Internal::twoThirdsSampler<C> >(c);
}
@@ -105,7 +105,7 @@ void twoThirdsSample(const BasicImage<byte>& in, BasicImage<byte>& out);
/// @param from The image to convert from
/// @return The converted image
/// @ingroup gVision
- template<class C> Image<C> twoThirdsSample(const BasicImage<C>& from);
+ template<class C> Image<C> twoThirdsSample(const SubImage<C>& from);
#endif
@@ -238,20 +238,6 @@ template <class S, class T> struct Gradient<S,T,1,2> {
typedef typename Pixel::traits<SComp>::wider_type diff_type;
static void gradient(const BasicImage<S>& I, BasicImage<T>& grad) {
int w = I.size().x;
- int h = I.size().y;
- int s = I.row_stride();
- for(int y=1; y<h-1; y++) {
- const S* sptr = I.data()+y*I.row_stride();
- T* tptr = grad.data()+y*grad.row_stride();
- for(int x=1; x<w-1; x++) {
- Pixel::Component<T>::get(*tptr, 0) = Pixel::scalar_convert<TComp,SComp,diff_type>(diff_type(*(sptr+1)) - *(sptr-1));
- Pixel::Component<T>::get(*tptr, 1) = Pixel::scalar_convert<TComp,SComp,diff_type>(diff_type(*(sptr+s)) - *(sptr-s));
- sptr++;
- tptr++;
- }
- }
-
-#if 0
typename BasicImage<S>::const_iterator s = I.begin() + w + 1;
typename BasicImage<S>::const_iterator end = I.end() - w - 1;
typename BasicImage<T>::iterator t = grad.begin() + w + 1;
@@ -261,7 +247,6 @@ template <class S, class T> struct Gradient<S,T,1,2> {
s++;
t++;
}
-#endif
zeroBorders(grad);
}
};
@@ -514,7 +499,7 @@ namespace median {
}
}
- template <class T> void median_filter_3x3(const BasicImage<T>& I, BasicImage<T> out)
+ template <class T> void median_filter_3x3(const SubImage<T>& I, SubImage<T> out)
{
assert(out.size() == I.size());
const int s = I.row_stride();
@@ -523,7 +508,7 @@ namespace median {
median::median_filter_3x3(I[i]+1, s, n, out[i]+1);
}
-void median_filter_3x3(const BasicImage<byte>& I, BasicImage<byte> out);
+void median_filter_3x3(const SubImage<byte>& I, SubImage<byte> out);
//template<class T>
View
2 cvd_src/SSE2/two_thirds_sample.cc
@@ -289,7 +289,7 @@ namespace CVD{
}
- void twoThirdsSample(const BasicImage<byte>& in, BasicImage<byte>& out)
+ void twoThirdsSample(const SubImage<byte>& in, SubImage<byte>& out)
{
if( (in.size()/3*2) != out.size())
throw Exceptions::Vision::IncompatibleImageSizes(__FUNCTION__);
View
2 cvd_src/convolution.cc
@@ -212,7 +212,7 @@ template <class T> inline T clamp01(T x) { return x < 0 ? 0 : (x > 1 ? 1 : x); }
// See "Recursive Gaussian Derivative Filters", by van Vliet, Young and Verbeck, 1998
// and "Boundary Conditions for Young - van Vliet Recursive Filtering", by Triggs and Sdika, 2005
// Can result in values just outside of the input range
-void van_vliet_blur(const double b[], const CVD::BasicImage<float> in, CVD::BasicImage<float> out)
+void van_vliet_blur(const double b[], const CVD::SubImage<float> in, CVD::SubImage<float> out)
{
assert(in.size() == out.size());
const int w = in.size().x;
View
2 cvd_src/fast/fast_10_detect.cxx
@@ -7,7 +7,7 @@
using namespace std;
namespace CVD
{
-void fast_corner_detect_plain_10(const BasicImage<byte>& i, vector<ImageRef>& corners, int b)
+void fast_corner_detect_plain_10(const SubImage<byte>& i, vector<ImageRef>& corners, int b)
{
int y, cb, c_b;
const byte *line_max, *line_min;
View
2 cvd_src/fast/fast_10_score.cxx
@@ -3150,7 +3150,7 @@ inline int fast_corner_score_10(const byte* cache_0, const int offset[], int b)
return b-1;
}
-void fast_corner_score_10(const BasicImage<byte>& i, const vector<ImageRef>& corners, int b, vector<int>& scores)
+void fast_corner_score_10(const SubImage<byte>& i, const vector<ImageRef>& corners, int b, vector<int>& scores)
{
scores.resize(corners.size());
int pixel[16] = {
View
2 cvd_src/fast/fast_11_detect.cxx
@@ -7,7 +7,7 @@
using namespace std;
namespace CVD
{
-void fast_corner_detect_plain_11(const BasicImage<byte>& i, vector<ImageRef>& corners, int b)
+void fast_corner_detect_plain_11(const SubImage<byte>& i, vector<ImageRef>& corners, int b)
{
int y, cb, c_b;
const byte *line_max, *line_min;
View
2 cvd_src/fast/fast_11_score.cxx
@@ -2573,7 +2573,7 @@ inline int fast_corner_score_11(const byte* cache_0, const int offset[], int b)
return b-1;
}
-void fast_corner_score_11(const BasicImage<byte>& i, const vector<ImageRef>& corners, int b, vector<int>& scores)
+void fast_corner_score_11(const SubImage<byte>& i, const vector<ImageRef>& corners, int b, vector<int>& scores)
{
scores.resize(corners.size());
int pixel[16] = {
View
2 cvd_src/fast/fast_12_detect.cxx
@@ -7,7 +7,7 @@
using namespace std;
namespace CVD
{
-void fast_corner_detect_plain_12(const BasicImage<byte>& i, vector<ImageRef>& corners, int b)
+void fast_corner_detect_plain_12(const SubImage<byte>& i, vector<ImageRef>& corners, int b)
{
int y, cb, c_b;
const byte *line_max, *line_min;
View
2 cvd_src/fast/fast_12_score.cxx
@@ -2245,7 +2245,7 @@ inline int fast_corner_score_12(const byte* cache_0, const int offset[], int b)
return b-1;
}
-void fast_corner_score_12(const BasicImage<byte>& i, const vector<ImageRef>& corners, int b, vector<int>& scores)
+void fast_corner_score_12(const SubImage<byte>& i, const vector<ImageRef>& corners, int b, vector<int>& scores)
{
scores.resize(corners.size());
int pixel[16] = {
View
2 cvd_src/fast/fast_7_detect.cxx
@@ -7,7 +7,7 @@
using namespace std;
namespace CVD
{
-void fast_corner_detect_plain_7(const BasicImage<byte>& i, vector<ImageRef>& corners, int b)
+void fast_corner_detect_plain_7(const SubImage<byte>& i, vector<ImageRef>& corners, int b)
{
int y, cb, c_b;
const byte *line_max, *line_min;
View
2 cvd_src/fast/fast_7_score.cxx
@@ -16037,7 +16037,7 @@ inline int fast_corner_score_7(const byte* cache_0, const int offset[], int b)
return b-1;
}
-void fast_corner_score_7(const BasicImage<byte>& i, const vector<ImageRef>& corners, int b, vector<int>& scores)
+void fast_corner_score_7(const SubImage<byte>& i, const vector<ImageRef>& corners, int b, vector<int>& scores)
{
scores.resize(corners.size());
int pixel[16] = {
View
2 cvd_src/fast/fast_8_detect.cxx
@@ -7,7 +7,7 @@
using namespace std;
namespace CVD
{
-void fast_corner_detect_plain_8(const BasicImage<byte>& i, vector<ImageRef>& corners, int b)
+void fast_corner_detect_plain_8(const SubImage<byte>& i, vector<ImageRef>& corners, int b)
{
int y, cb, c_b;
const byte *line_max, *line_min;
View
2 cvd_src/fast/fast_8_score.cxx
@@ -8415,7 +8415,7 @@ inline int fast_corner_score_8(const byte* cache_0, const int offset[], int b)
return b-1;
}
-void fast_corner_score_8(const BasicImage<byte>& i, const vector<ImageRef>& corners, int b, vector<int>& scores)
+void fast_corner_score_8(const SubImage<byte>& i, const vector<ImageRef>& corners, int b, vector<int>& scores)
{
scores.resize(corners.size());
int pixel[16] = {
View
2 cvd_src/fast/fast_9_detect.cxx
@@ -7,7 +7,7 @@
using namespace std;
namespace CVD
{
-void fast_corner_detect_plain_9(const BasicImage<byte>& i, vector<ImageRef>& corners, int b)
+void fast_corner_detect_plain_9(const SubImage<byte>& i, vector<ImageRef>& corners, int b)
{
int y, cb, c_b;
const byte *line_max, *line_min;
View
2 cvd_src/fast/fast_9_score.cxx
@@ -4652,7 +4652,7 @@ inline int fast_corner_score_9(const byte* cache_0, const int offset[], int b)
return b-1;
}
-void fast_corner_score_9(const BasicImage<byte>& i, const vector<ImageRef>& corners, int b, vector<int>& scores)
+void fast_corner_score_9(const SubImage<byte>& i, const vector<ImageRef>& corners, int b, vector<int>& scores)
{
scores.resize(corners.size());
int pixel[16] = {
View
12 cvd_src/fast/prototypes.h
@@ -3,11 +3,11 @@
namespace CVD
{
using namespace std;
- void fast_corner_detect_plain_7(const BasicImage<byte>& i, std::vector<ImageRef>& corners, int b);
- void fast_corner_detect_plain_8(const BasicImage<byte>& i, std::vector<ImageRef>& corners, int b);
- void fast_corner_detect_plain_9(const BasicImage<byte>& i, std::vector<ImageRef>& corners, int b);
- void fast_corner_detect_plain_10(const BasicImage<byte>& i, std::vector<ImageRef>& corners, int b);
- void fast_corner_detect_plain_11(const BasicImage<byte>& i, std::vector<ImageRef>& corners, int b);
- void fast_corner_detect_plain_12(const BasicImage<byte>& i, std::vector<ImageRef>& corners, int b);
+ void fast_corner_detect_plain_7(const SubImage<byte>& i, std::vector<ImageRef>& corners, int b);
+ void fast_corner_detect_plain_8(const SubImage<byte>& i, std::vector<ImageRef>& corners, int b);
+ void fast_corner_detect_plain_9(const SubImage<byte>& i, std::vector<ImageRef>& corners, int b);
+ void fast_corner_detect_plain_10(const SubImage<byte>& i, std::vector<ImageRef>& corners, int b);
+ void fast_corner_detect_plain_11(const SubImage<byte>& i, std::vector<ImageRef>& corners, int b);
+ void fast_corner_detect_plain_12(const SubImage<byte>& i, std::vector<ImageRef>& corners, int b);
}
View
2 cvd_src/i686/convert_rgb_to_y.cc
@@ -11,7 +11,7 @@ namespace CVD
}
}
- void ConvertImage<Rgb<byte>, byte, Pixel::CIE<Rgb<byte>, byte>, 1>::convert(const BasicImage<Rgb<byte> >& from, BasicImage<byte>& to)
+ void ConvertImage<Rgb<byte>, byte, Pixel::CIE<Rgb<byte>, byte>, 1>::convert(const SubImage<Rgb<byte> >& from, SubImage<byte>& to)
{
const Rgb<byte>* rgb = from.data();
byte* gray = to.data();
View
2 cvd_src/i686/convolve_gaussian.cc
@@ -247,7 +247,7 @@ inline void forward_to_backward(const __m128 M[], const __m128 i_plus, const __m
// See "Recursive Gaussian Derivative Filters", by van Vliet, Young and Verbeck, 1998
// and "Boundary Conditions for Young - van Vliet Recursive Filtering", by Triggs and Sdika, 2005
// This can produce output with values slightly outside the input range.
-void van_vliet_blur_simd(const double b[], const BasicImage<float> in, BasicImage<float> out)
+void van_vliet_blur_simd(const double b[], const SubImage<float> in, SubImage<float> out)
{
assert(in.size() == out.size());
const int w = in.size().x;
View
2 cvd_src/i686/median_3x3.cc
@@ -63,7 +63,7 @@ namespace CVD {
}
- void median_filter_3x3(const BasicImage<byte>& I, BasicImage<byte> out)
+ void median_filter_3x3(const SubImage<byte>& I, SubImage<byte> out)
{
assert(out.size() == I.size());
const int s = I.row_stride();
View
2 cvd_src/noarch/convert_rgb_to_y.cc
@@ -3,7 +3,7 @@
#include <cvd/utility.h>
namespace CVD {
- void ConvertImage<Rgb<byte>, byte, Pixel::CIE<Rgb<byte>, byte>, 1>::convert(const BasicImage<Rgb<byte> >& from, BasicImage<byte>& to)
+ void ConvertImage<Rgb<byte>, byte, Pixel::CIE<Rgb<byte>, byte>, 1>::convert(const SubImage<Rgb<byte> >& from, SubImage<byte>& to)
{
const Rgb<byte>* rgb = from.data();
byte* gray = to.data(), *gend = to.data() + to.totalsize();
View
2 cvd_src/noarch/median_3x3.cc
@@ -1,7 +1,7 @@
#include "cvd/vision.h"
namespace CVD{
- void median_filter_3x3(const BasicImage<byte>& I, BasicImage<byte> out)
+ void median_filter_3x3(const SubImage<byte>& I, SubImage<byte> out)
{
median_filter_3x3<byte>(I, out);
}
View
2 cvd_src/noarch/two_thirds_sample.cc
@@ -1,6 +1,6 @@
#include "cvd/vision.h"
namespace CVD{
- void twoThirdsSample(const BasicImage<byte>& in, BasicImage<byte>& out)
+ void twoThirdsSample(const SubImage<byte>& in, SubImage<byte>& out)
{
twoThirdsSample<byte>(in, out);
}
View
11 progs/.cvsignore
@@ -1,11 +0,0 @@
-calibrate
-cvd_display_image
-img_play
-img_play_bw
-img_play_deinterlace
-se3_exp
-se3_inv
-se3_ln
-se3_post_mul
-se3_pre_mul
-video_play_source
View
6 test/bayer_test.cxx
@@ -12,13 +12,13 @@ using namespace std;
using namespace CVD;
template <typename T>
-Image<T> create_bayer( const ImageRef & size, const BasicImage<byte> & pattern ){
+Image<T> create_bayer( const ImageRef & size, const SubImage<byte> & pattern ){
assert(pattern.size() == ImageRef(2,2));
Image<T> result(size);
for( int y = 0; y < size.y; y += 2 ){
for(int x = 0; x < size.x; x +=2 ){
- BasicImage<T> sub = result.sub_image(ImageRef(x,y), ImageRef(2,2));
- reinterpret_cast<BasicImage<byte> &>(sub).copy_from(pattern);
+ SubImage<T> sub = result.sub_image(ImageRef(x,y), ImageRef(2,2));
+ reinterpret_cast<SubImage<byte> &>(sub).copy_from(pattern);
}
}
return result;
View
12 test/fast_test.cxx
@@ -11,9 +11,9 @@
using namespace std;
namespace CVD
{
- void fast_corner_detect_plain_9(const BasicImage<byte>& i, vector<ImageRef>& corners, int b);
- void fast_corner_detect_plain_10(const BasicImage<byte>& i, vector<ImageRef>& corners, int b);
- void fast_corner_detect_plain_12(const BasicImage<byte>& i, vector<ImageRef>& corners, int b);
+ void fast_corner_detect_plain_9(const SubImage<byte>& i, vector<ImageRef>& corners, int b);
+ void fast_corner_detect_plain_10(const SubImage<byte>& i, vector<ImageRef>& corners, int b);
+ void fast_corner_detect_plain_12(const SubImage<byte>& i, vector<ImageRef>& corners, int b);
}
using namespace CVD;
@@ -29,7 +29,7 @@ inline bool negative(int val, int centre, int barrier)
}
template<int num_for_corner, class Test>
-inline int is_corner(const BasicImage<byte>& im, const ImageRef off, int barrier, const Test& test)
+inline int is_corner(const SubImage<byte>& im, const ImageRef off, int barrier, const Test& test)
{
int num_consecutive=0;
int first_cons=0;
@@ -57,7 +57,7 @@ inline int is_corner(const BasicImage<byte>& im, const ImageRef off, int barrier
return first_cons+num_consecutive >=num_for_corner;
}
-template<int Num> void segment_test(const BasicImage<byte>& im, vector<ImageRef>& v, int threshold)
+template<int Num> void segment_test(const SubImage<byte>& im, vector<ImageRef>& v, int threshold)
{
for(int y=3; y < im.size().y-3; y++)
for(int x=3; x < im.size().x-3; x++)
@@ -151,7 +151,7 @@ template<class A, class B, class C> void test_images(const Image<byte>& im, A fu
ImageRef size = im.size() - i * one;
Image<byte> part(size);
- BasicImage<byte> s = im.sub_image(zero, size);
+ SubImage<byte> s = im.sub_image(zero, size);
copy(s.begin(), s.end(),part.begin());
test(part, funcf, funcp, funcs, threshold);

0 comments on commit 964134d

Please sign in to comment.
Something went wrong with that request. Please try again.