diff options
-rw-r--r-- | .SRCINFO | 8 | ||||
-rw-r--r-- | 0001-Patch-for-new-opencv-4.2.patch | 174 | ||||
-rw-r--r-- | PKGBUILD | 24 |
3 files changed, 106 insertions, 100 deletions
@@ -1,8 +1,8 @@ pkgbase = eviacam - pkgdesc = Enable Viacam (eViacam) is a mouse replacement software that moves the pointer as you move your head + pkgdesc = A mouse replacement software that moves the pointer as you move your head pkgver = 2.1.4 - pkgrel = 5 - url = https://eviacam.crea-si.com/ + pkgrel = 6 + url = https://eviacam.crea-si.com arch = x86_64 license = GPL3 depends = opencv @@ -10,7 +10,9 @@ pkgbase = eviacam depends = wxgtk3 provides = eviacam source = eviacam-2.1.4.tar.gz::https://github.com/cmauri/eviacam/archive/v2.1.4.tar.gz + source = 0001-Patch-for-new-opencv-4.2.patch sha256sums = 0ed868e6f3f32fa48002ebc7cfbd58e1a0035ff954bb09adc4bc27cd3928cceb + sha256sums = SKIP pkgname = eviacam diff --git a/0001-Patch-for-new-opencv-4.2.patch b/0001-Patch-for-new-opencv-4.2.patch index 8b98cb48d029..41d682b3ad1d 100644 --- a/0001-Patch-for-new-opencv-4.2.patch +++ b/0001-Patch-for-new-opencv-4.2.patch @@ -19,13 +19,13 @@ index 4ae0052..2137141 100755 +++ b/creavision/crvnormroi.cpp @@ -187,7 +187,7 @@ void CNormROI::SetP1Resize (const float x, const float y) { - float min_p1x, min_p1y, max_p1x, max_p1y; + float min_p1x, min_p1y, max_p1x, max_p1y; - CvPoint2D32f p2_lim; + cv::Point2d p2_lim; - p2_lim.x= m_x + m_width; - p2_lim.y= m_y + m_height; + p2_lim.x= m_x + m_width; + p2_lim.y= m_y + m_height; @@ -335,7 +335,7 @@ void CNormROI::GetSize (float& width, float& height) // // Working with generic integer coordinates @@ -33,17 +33,17 @@ index 4ae0052..2137141 100755 -inline void CNormROI::Integer2Normalized (const CvSize& size, const int ix, const int iy, float &nx, float &ny) +inline void CNormROI::Integer2Normalized (const cv::Size& size, const int ix, const int iy, float &nx, float &ny) { - assert (size.width> 0); - assert (size.height> 0); + assert (size.width> 0); + assert (size.height> 0); @@ -344,7 +344,7 @@ inline void CNormROI::Integer2Normalized (const CvSize& size, const int ix, cons - ny= (float) iy / (float) size.height; + ny= (float) iy / (float) size.height; } -inline void CNormROI::Normalized2Integer (const CvSize& size, const float nx, const float ny, int &ix, int &iy) +inline void CNormROI::Normalized2Integer (const cv::Size& size, const float nx, const float ny, int &ix, int &iy) { - assert (size.width> 0); - assert (size.height> 0); + assert (size.width> 0); + assert (size.height> 0); @@ -356,7 +356,7 @@ inline void CNormROI::Normalized2Integer (const CvSize& size, const float nx, co } @@ -51,7 +51,7 @@ index 4ae0052..2137141 100755 -void CNormROI::SetP1ResizeInteger (const CvSize& size, const int x, const int y) +void CNormROI::SetP1ResizeInteger (const cv::Size& size, const int x, const int y) { - float new_x, new_y; + float new_x, new_y; @@ -366,7 +366,7 @@ void CNormROI::SetP1ResizeInteger (const CvSize& size, const int x, const int y) } @@ -60,7 +60,7 @@ index 4ae0052..2137141 100755 -void CNormROI::SetP1MoveInteger (const CvSize& size, const int x, const int y) +void CNormROI::SetP1MoveInteger (const cv::Size& size, const int x, const int y) { - float new_x, new_y; + float new_x, new_y; @@ -376,7 +376,7 @@ void CNormROI::SetP1MoveInteger (const CvSize& size, const int x, const int y) } @@ -69,7 +69,7 @@ index 4ae0052..2137141 100755 -void CNormROI::SetP2ResizeInteger (const CvSize& size, const int x, const int y) +void CNormROI::SetP2ResizeInteger (const cv::Size& size, const int x, const int y) { - float new_x, new_y; + float new_x, new_y; @@ -386,7 +386,7 @@ void CNormROI::SetP2ResizeInteger (const CvSize& size, const int x, const int y) } @@ -78,16 +78,16 @@ index 4ae0052..2137141 100755 -void CNormROI::SetCenterInteger (const CvSize& size, const int x, const int y) +void CNormROI::SetCenterInteger (const cv::Size& size, const int x, const int y) { - float new_x, new_y; + float new_x, new_y; @@ -395,7 +395,7 @@ void CNormROI::SetCenterInteger (const CvSize& size, const int x, const int y) - SetCenter (new_x, new_y); + SetCenter (new_x, new_y); } -void CNormROI::GetCenterInteger (const CvSize& size, int& x, int& y) +void CNormROI::GetCenterInteger (const cv::Size& size, int& x, int& y) { - float fx, fy; + float fx, fy; @@ -405,7 +405,7 @@ void CNormROI::GetCenterInteger (const CvSize& size, int& x, int& y) } @@ -96,7 +96,7 @@ index 4ae0052..2137141 100755 -void CNormROI::SetSizeInteger (const CvSize& size, const int width, const int height) +void CNormROI::SetSizeInteger (const cv::Size& size, const int width, const int height) { - float new_width, new_height; + float new_width, new_height; @@ -415,7 +415,7 @@ void CNormROI::SetSizeInteger (const CvSize& size, const int width, const int he } @@ -105,31 +105,31 @@ index 4ae0052..2137141 100755 -void CNormROI::GetBoxInteger (const CvSize& size, int& x, int& y, int& width, int& height) +void CNormROI::GetBoxInteger (const cv::Size& size, int& x, int& y, int& width, int& height) { - // DEBUG, - CheckInvariant(); + // DEBUG, + CheckInvariant(); @@ -427,12 +427,12 @@ void CNormROI::GetBoxInteger (const CvSize& size, int& x, int& y, int& width, in - assert (y + height<= size.height); + assert (y + height<= size.height); } -void CNormROI::GetBoxInteger (const CvSize& size, CvRect& box) +void CNormROI::GetBoxInteger (const cv::Size& size, CvRect& box) { - GetBoxInteger (size, box.x, box.y, box.width, box.height); + GetBoxInteger (size, box.x, box.y, box.width, box.height); } -void CNormROI::GetP1P2Integer (const CvSize& size, CvPoint& p1, CvPoint& p2) +void CNormROI::GetP1P2Integer (const cv::Size& size, CvPoint& p1, CvPoint& p2) { - Normalized2Integer (size, m_x, m_y, p1.x, p1.y); - Normalized2Integer (size, m_x + m_width, m_y + m_height, p2.x, p2.y); + Normalized2Integer (size, m_x, m_y, p1.x, p1.y); + Normalized2Integer (size, m_x + m_width, m_y + m_height, p2.x, p2.y); diff --git a/creavision/crvnormroi.h b/creavision/crvnormroi.h index fed4779..7474c7b 100755 --- a/creavision/crvnormroi.h +++ b/creavision/crvnormroi.h @@ -43,15 +43,15 @@ public: - void GetSize (float& width, float& height); - - // Get/Set position using relative arbitrary integer coordinates + void GetSize (float& width, float& height); + + // Get/Set position using relative arbitrary integer coordinates - void SetP1ResizeInteger (const CvSize& size, const int x, const int y); - void SetP1MoveInteger (const CvSize& size, const int x, const int y); - void SetP2ResizeInteger (const CvSize& size, const int x, const int y); @@ -149,19 +149,19 @@ index fed4779..7474c7b 100755 + void GetBoxInteger (const cv::Size& size, CvRect& box); + void GetP1P2Integer (const cv::Size& size, CvPoint& p1, CvPoint& p2); - float GetRotation () { return m_rotation; } - void SetRotation (float value) { m_rotation= value; } + float GetRotation () { return m_rotation; } + void SetRotation (float value) { m_rotation= value; } @@ -83,8 +83,8 @@ protected: - virtual void Destroy(); + virtual void Destroy(); - // Coordinate conversion + // Coordinate conversion - void Integer2Normalized (const CvSize& size, const int ix, const int iy, float &nx, float &ny); - void Normalized2Integer (const CvSize& size, const float nx, const float ny, int &ix, int &iy); + void Integer2Normalized (const cv::Size& size, const int ix, const int iy, float &nx, float &ny); + void Normalized2Integer (const cv::Size& size, const float nx, const float ny, int &ix, int &iy); - // ROI hierarchy - typedef std::list<CNormROI *> TNormROIList; + // ROI hierarchy + typedef std::list<CNormROI *> TNormROIList; diff --git a/src/visionpipeline.cpp b/src/visionpipeline.cpp index 488f2b2..f711d59 100755 --- a/src/visionpipeline.cpp @@ -172,22 +172,22 @@ index 488f2b2..f711d59 100755 { - CvPoint2D32f trackAreaLocation; + cv::Point2d trackAreaLocation; - CvSize2D32f trackAreaSize; - bool updateFeatures = false; + CvSize2D32f trackAreaSize; + bool updateFeatures = false; diff --git a/src/visionpipeline.h b/src/visionpipeline.h index 02dcd8e..fbd3c7c 100755 --- a/src/visionpipeline.h +++ b/src/visionpipeline.h @@ -93,7 +93,7 @@ private: - wxCondition m_condition; + wxCondition m_condition; - // Face location detection + // Face location detection - CvRect m_faceLocation; + cv::Rect m_faceLocation; - int m_faceLocationStatus; // 0 -> not available, 1 -> available + int m_faceLocationStatus; // 0 -> not available, 1 -> available - enum { NUM_CORNERS = 20 }; + enum { NUM_CORNERS = 20 }; diff --git a/wxcamwindow/visiblenormroi.cpp b/wxcamwindow/visiblenormroi.cpp index da3e440..5c9bc64 100755 --- a/wxcamwindow/visiblenormroi.cpp @@ -199,8 +199,8 @@ index da3e440..5c9bc64 100755 -void CVisibleNormROI::GetDirectionSegment (const CvSize& winSize, CvPoint& p1, CvPoint& p2) +void CVisibleNormROI::GetDirectionSegment (const cv::Size& winSize, CvPoint& p1, CvPoint& p2) { - GetP1P2Integer (winSize, p1, p2); - float line_lenght= sqrtf ( + GetP1P2Integer (winSize, p1, p2); + float line_lenght= sqrtf ( @@ -254,7 +254,7 @@ void CVisibleNormROI::GetDirectionSegment (const CvSize& winSize, CvPoint& p1, C } @@ -208,26 +208,26 @@ index da3e440..5c9bc64 100755 -int CVisibleNormROI::OnMouseMovedNoClick (const CvSize& winSize, const CvPoint& cursor) +int CVisibleNormROI::OnMouseMovedNoClick (const cv::Size& winSize, const cv::Point& cursor) { - Lock (); + Lock (); @@ -265,7 +265,7 @@ int CVisibleNormROI::OnMouseMovedNoClick (const CvSize& winSize, const CvPoint& - return retval; + return retval; } -int CVisibleNormROI::OnMouseMovedNoClickRec (const CvSize& winSize, const CvPoint& cursor) +int CVisibleNormROI::OnMouseMovedNoClickRec (const cv::Size& winSize, const cv::Point& cursor) { - int retval; - TNormROIListIterator i; + int retval; + TNormROIListIterator i; @@ -283,7 +283,7 @@ int CVisibleNormROI::OnMouseMovedNoClickRec (const CvSize& winSize, const CvPoin - return OVER_NONE; + return OVER_NONE; } -int CVisibleNormROI::OnMouseMovedNoClick0 (const CvSize& winSize, const CvPoint& cursor) +int CVisibleNormROI::OnMouseMovedNoClick0 (const cv::Size& winSize, const cv::Point& cursor) { - CvPoint p1, p2, or_p1, or_p2; - + CvPoint p1, p2, or_p1, or_p2; + @@ -332,7 +332,7 @@ int CVisibleNormROI::OnMouseMovedNoClick0 (const CvSize& winSize, const CvPoint& } @@ -235,26 +235,26 @@ index da3e440..5c9bc64 100755 -bool CVisibleNormROI::OnMouseMovedClick (const CvSize& winSize, const CvPoint& cursor, const CvPoint& prevCursor) +bool CVisibleNormROI::OnMouseMovedClick (const cv::Size& winSize, const cv::Point& cursor, const cv::Point& prevCursor) { - Lock (); + Lock (); @@ -343,7 +343,7 @@ bool CVisibleNormROI::OnMouseMovedClick (const CvSize& winSize, const CvPoint& c - return retval; + return retval; } -bool CVisibleNormROI::OnMouseMovedClickRec (const CvSize& winSize, const CvPoint& cursor, const CvPoint& prevCursor) +bool CVisibleNormROI::OnMouseMovedClickRec (const cv::Size& winSize, const cv::Point& cursor, const cv::Point& prevCursor) { - TNormROIListIterator i; + TNormROIListIterator i; @@ -358,7 +358,7 @@ bool CVisibleNormROI::OnMouseMovedClickRec (const CvSize& winSize, const CvPoint - return false; + return false; } -bool CVisibleNormROI::OnMouseMovedClick0 (const CvSize& winSize, const CvPoint& cursor, const CvPoint& prevCursor) +bool CVisibleNormROI::OnMouseMovedClick0 (const cv::Size& winSize, const cv::Point& cursor, const cv::Point& prevCursor) { - CvPoint p1, p2, or_p1, or_p2; - + CvPoint p1, p2, or_p1, or_p2; + @@ -403,14 +403,14 @@ bool CVisibleNormROI::OnMouseMovedClick0 (const CvSize& winSize, const CvPoint& } @@ -262,69 +262,69 @@ index da3e440..5c9bc64 100755 -void CVisibleNormROI::OnPaint (const CvSize& winSize, CIplImage *pImg) +void CVisibleNormROI::OnPaint (const cv::Size& winSize, CIplImage *pImg) { - Lock (); - OnPaintRec (winSize, pImg); - Unlock(); + Lock (); + OnPaintRec (winSize, pImg); + Unlock(); } -void CVisibleNormROI::OnPaintRec (const CvSize& winSize, CIplImage *pImg) +void CVisibleNormROI::OnPaintRec (const cv::Size& winSize, CIplImage *pImg) { - TNormROIListIterator i; + TNormROIListIterator i; @@ -423,7 +423,7 @@ void CVisibleNormROI::OnPaintRec (const CvSize& winSize, CIplImage *pImg) - OnPaint0 (winSize, pImg); + OnPaint0 (winSize, pImg); } -void CVisibleNormROI::OnPaint0 (const CvSize& winSize, CIplImage *pImg) +void CVisibleNormROI::OnPaint0 (const cv::Size& winSize, CIplImage *pImg) { - int thickness; - + int thickness; + @@ -432,7 +432,7 @@ void CVisibleNormROI::OnPaint0 (const CvSize& winSize, CIplImage *pImg) - if (m_cursorOver>= OVER_LEFT_LINE && m_cursorOver<= OVER_BR_CORNER) thickness= 3; - else thickness= 1; + if (m_cursorOver>= OVER_LEFT_LINE && m_cursorOver<= OVER_BR_CORNER) thickness= 3; + else thickness= 1; - cvRectangle (pImg->ptr(), p1, p2, CV_RGB( 255-m_degradation, 255-m_degradation, m_degradation ), thickness, 4); + cvRectangle (pImg->ptr(), p1, p2, cvScalar(m_degradation, 255-m_degradation, 255-m_degradation, 0), thickness, 4); - // Affordances - CvPoint pa, pb; + // Affordances + CvPoint pa, pb; @@ -441,14 +441,14 @@ void CVisibleNormROI::OnPaint0 (const CvSize& winSize, CIplImage *pImg) - pb.x= p1.x + thickness; - pb.y= p1.y + thickness; + pb.x= p1.x + thickness; + pb.y= p1.y + thickness; - cvRectangle (pImg->ptr(), pa, pb, CV_RGB( 255-m_degradation, 255-m_degradation, m_degradation ), CV_FILLED ); + cvRectangle (pImg->ptr(), pa, pb, cvScalar(m_degradation, 255-m_degradation, 255-m_degradation, 0), CV_FILLED ); - pa.x= p2.x - thickness; - pa.y= p2.y - thickness; - pb.x= p2.x + thickness; - pb.y= p2.y + thickness; + pa.x= p2.x - thickness; + pa.y= p2.y - thickness; + pb.x= p2.x + thickness; + pb.y= p2.y + thickness; - cvRectangle (pImg->ptr(), pa, pb, CV_RGB( 255-m_degradation, 255-m_degradation, m_degradation ), CV_FILLED ); + cvRectangle (pImg->ptr(), pa, pb, cvScalar(m_degradation, 255-m_degradation, 255-m_degradation, 0), CV_FILLED ); - GetDirectionSegment (winSize, p1, p2); - + GetDirectionSegment (winSize, p1, p2); + @@ -456,7 +456,7 @@ void CVisibleNormROI::OnPaint0 (const CvSize& winSize, CIplImage *pImg) - { - if (m_cursorOver== OVER_ORIENTER) thickness= 3; - else thickness= 1; + { + if (m_cursorOver== OVER_ORIENTER) thickness= 3; + else thickness= 1; - cvLine (pImg->ptr(), p1, p2, CV_RGB( 255,255,0 ), thickness, CV_AA ); - cvCircle(pImg->ptr(), p2, SELECTION_TOLERANCE, CV_RGB( 255,255,0 ), thickness, CV_AA ); + cvLine (pImg->ptr(), p1, p2, cvScalar(0, 255, 255, 0), thickness, CV_AA ); + cvCircle(pImg->ptr(), p2, SELECTION_TOLERANCE, cvScalar(0, 255, 255, 0), thickness, CV_AA ); - } + } } diff --git a/wxcamwindow/visiblenormroi.h b/wxcamwindow/visiblenormroi.h index 38e6a33..cc239b2 100755 --- a/wxcamwindow/visiblenormroi.h +++ b/wxcamwindow/visiblenormroi.h @@ -67,24 +67,24 @@ public: - OVER_ORIENTER, OVER_UL_CORNER, OVER_BR_CORNER }; + OVER_ORIENTER, OVER_UL_CORNER, OVER_BR_CORNER }; - // Returns where is the cursor over + // Returns where is the cursor over - int OnMouseMovedNoClick (const CvSize& winSize, const CvPoint& cursor); - bool OnMouseMovedClick (const CvSize& winSize, const CvPoint& cursor, const CvPoint& prevCursor); - void OnPaint (const CvSize& winSize, CIplImage *pImg); @@ -332,9 +332,9 @@ index 38e6a33..cc239b2 100755 + bool OnMouseMovedClick (const cv::Size& winSize, const cv::Point& cursor, const cv::Point& prevCursor); + void OnPaint (const cv::Size& winSize, CIplImage *pImg); - bool RegisterChildROI (CVisibleNormROI* pNormROI); - bool UnregisterChildROI (CVisibleNormROI* pNormROI); - + bool RegisterChildROI (CVisibleNormROI* pNormROI); + bool UnregisterChildROI (CVisibleNormROI* pNormROI); + private: - void GetDirectionSegment (const CvSize& winSize, CvPoint& p1, CvPoint& p2); + void GetDirectionSegment (const cv::Size& winSize, CvPoint& p1, CvPoint& p2); @@ -348,14 +348,14 @@ index 38e6a33..cc239b2 100755 - bool OnMouseMovedClick0 (const CvSize& winSize, const CvPoint& cursor, const CvPoint& prevCursor); + bool OnMouseMovedClickRec (const cv::Size& winSize, const cv::Point& cursor, const cv::Point& prevCursor); + bool OnMouseMovedClick0 (const cv::Size& winSize, const cv::Point& cursor, const cv::Point& prevCursor); - + - void OnPaintRec (const CvSize& winSize, CIplImage *pImg); - void OnPaint0 (const CvSize& winSize, CIplImage *pImg); + void OnPaintRec (const cv::Size& winSize, CIplImage *pImg); + void OnPaint0 (const cv::Size& winSize, CIplImage *pImg); - - void Lock(); - void Unlock(); + + void Lock(); + void Unlock(); diff --git a/wxcamwindow/wxnormroi.cpp b/wxcamwindow/wxnormroi.cpp index f79a1e4..6eda8fd 100755 --- a/wxcamwindow/wxnormroi.cpp @@ -366,17 +366,17 @@ index f79a1e4..6eda8fd 100755 { - CvSize winSize; + cv::Size winSize; - bool processed; + bool processed; - m_pWindow->GetClientSize (&winSize.width, &winSize.height); + m_pWindow->GetClientSize (&winSize.width, &winSize.height); @@ -97,7 +97,7 @@ bool CWXNormROI::OnEvtLeftDClick ( wxMouseEvent& WXUNUSED(event) ) void CWXNormROI::OnPaint (CIplImage *pImg) { - CvSize winSize; + cv::Size winSize; - m_pWindow->GetClientSize(&winSize.width, &winSize.height); - m_pVisibleNormROI->OnPaint (winSize, pImg); + m_pWindow->GetClientSize(&winSize.width, &winSize.height); + m_pVisibleNormROI->OnPaint (winSize, pImg); } -- 2.17.1 @@ -3,32 +3,36 @@ pkgname=eviacam pkgver=2.1.4 -pkgrel=5 -pkgdesc='Enable Viacam (eViacam) is a mouse replacement software that moves the pointer as you move your head' +pkgrel=6 +pkgdesc='A mouse replacement software that moves the pointer as you move your head' arch=('x86_64') -url='https://eviacam.crea-si.com/' +url='https://eviacam.crea-si.com' license=('GPL3') -depends=('opencv' 'wxgtk' 'wxgtk3') +depends=('opencv' + 'wxgtk' + 'wxgtk3') provides=('eviacam') -source=("${pkgname}-${pkgver}.tar.gz::https://github.com/cmauri/eviacam/archive/v${pkgver}.tar.gz") -sha256sums=('0ed868e6f3f32fa48002ebc7cfbd58e1a0035ff954bb09adc4bc27cd3928cceb') +source=("${pkgname}-${pkgver}.tar.gz::https://github.com/cmauri/eviacam/archive/v${pkgver}.tar.gz" + '0001-Patch-for-new-opencv-4.2.patch') +sha256sums=('0ed868e6f3f32fa48002ebc7cfbd58e1a0035ff954bb09adc4bc27cd3928cceb' + 'SKIP') prepare() { - cd "${srcdir}/${pkgname}-${pkgver}" - patch --forward --strip=1 --input="../../0001-Patch-for-new-opencv-4.2.patch" + cd "${pkgname}-${pkgver}" + patch --forward --strip=1 --input=../0001-Patch-for-new-opencv-4.2.patch # Dirty fix: 'cvCreateCameraCapture doesn't support legacy API anymore' issue sed -i '252s@1@0@' "${srcdir}/${pkgname}-${pkgver}"/src/viacamcontroller.cpp } build() { - cd "${srcdir}/${pkgname}-${pkgver}" + cd "${pkgname}-${pkgver}" ./autogen.sh ./configure --prefix=/usr --with-wx-config=/usr/bin/wx-config-gtk3 make } package() { - cd "${srcdir}/${pkgname}-${pkgver}" + cd "${pkgname}-${pkgver}" make DESTDIR="${pkgdir}" install } # vim: ts=2 sw=2 et:
\ No newline at end of file |