Skip to content

Commit

Permalink
[WIP] Worked on the detection module. There might be a problem with t…
Browse files Browse the repository at this point in the history
…he nested classes in vpDetectorDNNOpenCV.h
  • Loading branch information
rlagneau committed May 23, 2024
1 parent 9edcb33 commit 024272d
Show file tree
Hide file tree
Showing 14 changed files with 460 additions and 330 deletions.
17 changes: 14 additions & 3 deletions modules/detection/include/visp3/detection/vpDetectorAprilTag.h
Original file line number Diff line number Diff line change
Expand Up @@ -46,11 +46,22 @@
#include <visp3/core/vpImage.h>
#include <visp3/detection/vpDetectorBase.h>

#if defined(ENABLE_VISP_NAMESPACE)
namespace visp
#ifdef ENABLE_VISP_NAMESPACE
namespace VISP_NAMESPACE_NAME
{
#endif
class vpDetectorAprilTag;
#ifdef ENABLE_VISP_NAMESPACE
}
#endif

// Forward declaration to have the operator in the global namespace
void swap(VISP_NAMESPACE_ADDRESSING vpDetectorAprilTag &o1, VISP_NAMESPACE_ADDRESSING vpDetectorAprilTag &o2);

#if defined(ENABLE_VISP_NAMESPACE)
namespace VISP_NAMESPACE_NAME
{
#endif
/*!
* \class vpDetectorAprilTag
* \ingroup group_detection_tag
Expand Down Expand Up @@ -305,7 +316,7 @@ class VISP_EXPORT vpDetectorAprilTag : public vpDetectorBase
m_displayTagThickness = thickness;
}

friend void swap(vpDetectorAprilTag &o1, vpDetectorAprilTag &o2);
friend void ::swap(vpDetectorAprilTag &o1, vpDetectorAprilTag &o2);

void setZAlignedWithCameraAxis(bool zAlignedWithCameraFrame);

Expand Down
2 changes: 1 addition & 1 deletion modules/detection/include/visp3/detection/vpDetectorBase.h
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@
#include <visp3/core/vpRect.h>

#if defined(ENABLE_VISP_NAMESPACE)
namespace visp
namespace VISP_NAMESPACE_NAME
{
#endif

Expand Down
365 changes: 61 additions & 304 deletions modules/detection/include/visp3/detection/vpDetectorDNNOpenCV.h

Large diffs are not rendered by default.

Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,10 @@
#include <visp3/core/vpImage.h>
#include <visp3/detection/vpDetectorBase.h>

#ifdef ENABLE_VISP_NAMESPACE
namespace VISP_NAMESPACE_NAME
{
#endif
/*!
* \class vpDetectorDataMatrixCode
* \ingroup group_detection_barcode
Expand Down Expand Up @@ -112,6 +116,8 @@ class VISP_EXPORT vpDetectorDataMatrixCode : public vpDetectorBase
vpDetectorDataMatrixCode();
bool detect(const vpImage<unsigned char> &I) vp_override;
};

#ifdef ENABLE_VISP_NAMESPACE
}
#endif
#endif
#endif
8 changes: 7 additions & 1 deletion modules/detection/include/visp3/detection/vpDetectorFace.h
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,10 @@

#include <visp3/detection/vpDetectorBase.h>

#ifdef ENABLE_VISP_NAMESPACE
namespace VISP_NAMESPACE_NAME
{
#endif
/*!
* \class vpDetectorFace
* \ingroup group_detection_face
Expand Down Expand Up @@ -96,6 +100,8 @@ class VISP_EXPORT vpDetectorFace : public vpDetectorBase
bool detect(const cv::Mat &frame_gray);
void setCascadeClassifierFile(const std::string &filename);
};

#ifdef ENABLE_VISP_NAMESPACE
}
#endif
#endif
#endif
8 changes: 7 additions & 1 deletion modules/detection/include/visp3/detection/vpDetectorQRCode.h
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,10 @@
#include <visp3/core/vpImage.h>
#include <visp3/detection/vpDetectorBase.h>

#ifdef ENABLE_VISP_NAMESPACE
namespace VISP_NAMESPACE_NAME
{
#endif
/*!
* \class vpDetectorQRCode
* \ingroup group_detection_barcode
Expand Down Expand Up @@ -115,6 +119,8 @@ class VISP_EXPORT vpDetectorQRCode : public vpDetectorBase
vpDetectorQRCode();
bool detect(const vpImage<unsigned char> &I) vp_override;
};

#ifdef ENABLE_VISP_NAMESPACE
}
#endif
#endif
#endif
16 changes: 12 additions & 4 deletions modules/detection/src/barcode/vpDetectorDataMatrixCode.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,10 @@

#include <visp3/detection/vpDetectorDataMatrixCode.h>

#ifdef ENABLE_VISP_NAMESPACE
namespace VISP_NAMESPACE_NAME
{
#endif
/*!
Default constructor that does nothing except setting detection timeout to 50ms.
This value could be changed using setTimeout().
Expand Down Expand Up @@ -109,11 +113,13 @@ bool vpDetectorDataMatrixCode::detect(const vpImage<unsigned char> &I)
m_message.push_back((const char *)msg->output);

m_nb_objects++;
} else {
}
else {
end = true;
}
dmtxMessageDestroy(&msg);
} else {
}
else {
end = true;
}
dmtxRegionDestroy(&reg);
Expand All @@ -127,9 +133,11 @@ bool vpDetectorDataMatrixCode::detect(const vpImage<unsigned char> &I)
}
return detected;
}

#ifdef ENABLE_VISP_NAMESPACE
}
#endif
#elif !defined(VISP_BUILD_SHARED_LIBS)
// Work around to avoid warning:
// libvisp_core.a(vpDetectorDataMatrixCode.cpp.o) has no symbols
void dummy_vpDetectorDataMatrixCode(){};
void dummy_vpDetectorDataMatrixCode() { };
#endif
9 changes: 8 additions & 1 deletion modules/detection/src/barcode/vpDetectorQRCode.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,10 @@

#include <visp3/detection/vpDetectorQRCode.h>

#ifdef ENABLE_VISP_NAMESPACE
namespace VISP_NAMESPACE_NAME
{
#endif
/*!
Default constructor.
*/
Expand Down Expand Up @@ -88,8 +92,11 @@ bool vpDetectorQRCode::detect(const vpImage<unsigned char> &I)

return detected;
}
#ifdef ENABLE_VISP_NAMESPACE
}
#endif
#elif !defined(VISP_BUILD_SHARED_LIBS)
// Work around to avoid warning: libvisp_core.a(vpDetectorQRCode.cpp.o) has
// no symbols
void dummy_vpDetectorQRCode(){};
void dummy_vpDetectorQRCode() { };
#endif
Loading

0 comments on commit 024272d

Please sign in to comment.