1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 332 333 334 335 336 337 338 339 340 341 342 343 344 345 346 347 348 349 350 351 352 353 354 355 356 357 358 359 360 361 362 363 364 365 366 367 368 369
|
Description: patch for new opencv 4.2, inspired by src:nomacs
Author: Gianfranco Costamagna <locutusofborg@debian.org>
Last-Update: 2020-02-11
Index: eviacam-2.1.4/creavision/crvnormroi.cpp
===================================================================
--- eviacam-2.1.4.orig/creavision/crvnormroi.cpp
+++ eviacam-2.1.4/creavision/crvnormroi.cpp
@@ -187,7 +187,7 @@
{
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;
@@ -335,7 +335,7 @@
//
// Working with generic integer coordinates
//
-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);
@@ -344,7 +344,7 @@
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);
@@ -356,7 +356,7 @@
}
//inline
-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;
@@ -366,7 +366,7 @@
}
//inline
-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;
@@ -376,7 +376,7 @@
}
//inline
-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;
@@ -386,7 +386,7 @@
}
//inline
-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;
@@ -395,7 +395,7 @@
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;
@@ -405,7 +405,7 @@
}
//inline
-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;
@@ -415,7 +415,7 @@
}
//inline
-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();
@@ -427,12 +427,12 @@
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);
}
-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);
Index: eviacam-2.1.4/creavision/crvnormroi.h
===================================================================
--- eviacam-2.1.4.orig/creavision/crvnormroi.h
+++ eviacam-2.1.4/creavision/crvnormroi.h
@@ -43,15 +43,15 @@
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);
- void SetCenterInteger (const CvSize& size, const int x, const int y);
- void GetCenterInteger (const CvSize& size, int& x, int& y);
- void SetSizeInteger (const CvSize& size, const int width, const int height);
- void GetBoxInteger (const CvSize& size, int& x, int& y, int& width, int& height);
- void GetBoxInteger (const CvSize& size, CvRect& box);
- void GetP1P2Integer (const CvSize& size, CvPoint& p1, CvPoint& p2);
+ void SetP1ResizeInteger (const cv::Size& size, const int x, const int y);
+ void SetP1MoveInteger (const cv::Size& size, const int x, const int y);
+ void SetP2ResizeInteger (const cv::Size& size, const int x, const int y);
+ void SetCenterInteger (const cv::Size& size, const int x, const int y);
+ void GetCenterInteger (const cv::Size& size, int& x, int& y);
+ void SetSizeInteger (const cv::Size& size, const int width, const int height);
+ void GetBoxInteger (const cv::Size& size, int& x, int& y, int& width, int& height);
+ 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; }
@@ -83,8 +83,8 @@
virtual void Destroy();
// 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;
Index: eviacam-2.1.4/src/visionpipeline.cpp
===================================================================
--- eviacam-2.1.4.orig/src/visionpipeline.cpp
+++ eviacam-2.1.4/src/visionpipeline.cpp
@@ -223,7 +223,7 @@
void CVisionPipeline::NewTracker(CIplImage &image, float &xVel, float &yVel)
{
- CvPoint2D32f trackAreaLocation;
+ cv::Point2d trackAreaLocation;
CvSize2D32f trackAreaSize;
bool updateFeatures = false;
Index: eviacam-2.1.4/src/visionpipeline.h
===================================================================
--- eviacam-2.1.4.orig/src/visionpipeline.h
+++ eviacam-2.1.4/src/visionpipeline.h
@@ -93,7 +93,7 @@
wxCondition m_condition;
// Face location detection
- CvRect m_faceLocation;
+ cv::Rect m_faceLocation;
int m_faceLocationStatus; // 0 -> not available, 1 -> available
enum { NUM_CORNERS = 20 };
Index: eviacam-2.1.4/wxcamwindow/visiblenormroi.cpp
===================================================================
--- eviacam-2.1.4.orig/wxcamwindow/visiblenormroi.cpp
+++ eviacam-2.1.4/wxcamwindow/visiblenormroi.cpp
@@ -237,7 +237,7 @@
//
// Interaction code
//
-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 (
@@ -254,7 +254,7 @@
}
// Cursor motion, no click
-int CVisibleNormROI::OnMouseMovedNoClick (const CvSize& winSize, const CvPoint& cursor)
+int CVisibleNormROI::OnMouseMovedNoClick (const cv::Size& winSize, const cv::Point& cursor)
{
Lock ();
@@ -265,7 +265,7 @@
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;
@@ -283,7 +283,7 @@
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;
@@ -332,7 +332,7 @@
}
// Cursor motion, left button down
-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 ();
@@ -343,7 +343,7 @@
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;
@@ -358,7 +358,7 @@
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;
@@ -403,14 +403,14 @@
}
// Painting
-void CVisibleNormROI::OnPaint (const CvSize& winSize, CIplImage *pImg)
+void CVisibleNormROI::OnPaint (const cv::Size& winSize, CIplImage *pImg)
{
Lock ();
OnPaintRec (winSize, pImg);
Unlock();
}
-void CVisibleNormROI::OnPaintRec (const CvSize& winSize, CIplImage *pImg)
+void CVisibleNormROI::OnPaintRec (const cv::Size& winSize, CIplImage *pImg)
{
TNormROIListIterator i;
@@ -423,7 +423,7 @@
OnPaint0 (winSize, pImg);
}
-void CVisibleNormROI::OnPaint0 (const CvSize& winSize, CIplImage *pImg)
+void CVisibleNormROI::OnPaint0 (const cv::Size& winSize, CIplImage *pImg)
{
int thickness;
@@ -432,7 +432,7 @@
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;
@@ -441,14 +441,14 @@
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;
- 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);
@@ -456,7 +456,7 @@
{
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 );
}
}
Index: eviacam-2.1.4/wxcamwindow/visiblenormroi.h
===================================================================
--- eviacam-2.1.4.orig/wxcamwindow/visiblenormroi.h
+++ eviacam-2.1.4/wxcamwindow/visiblenormroi.h
@@ -67,24 +67,24 @@
OVER_ORIENTER, OVER_UL_CORNER, OVER_BR_CORNER };
// 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);
+ int OnMouseMovedNoClick (const cv::Size& winSize, const cv::Point& cursor);
+ 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);
private:
- void GetDirectionSegment (const CvSize& winSize, CvPoint& p1, CvPoint& p2);
+ void GetDirectionSegment (const cv::Size& winSize, CvPoint& p1, CvPoint& p2);
- int OnMouseMovedNoClickRec (const CvSize& winSize, const CvPoint& cursor);
- int OnMouseMovedNoClick0 (const CvSize& winSize, const CvPoint& cursor);
+ int OnMouseMovedNoClickRec (const cv::Size& winSize, const cv::Point& cursor);
+ int OnMouseMovedNoClick0 (const cv::Size& winSize, const cv::Point& cursor);
- bool OnMouseMovedClickRec (const CvSize& winSize, const CvPoint& cursor, const CvPoint& prevCursor);
- 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();
Index: eviacam-2.1.4/wxcamwindow/wxnormroi.cpp
===================================================================
--- eviacam-2.1.4.orig/wxcamwindow/wxnormroi.cpp
+++ eviacam-2.1.4/wxcamwindow/wxnormroi.cpp
@@ -40,7 +40,7 @@
bool CWXNormROI::OnEvtMotion ( wxMouseEvent& event, wxPoint prevCursor )
{
- CvSize winSize;
+ cv::Size winSize;
bool processed;
m_pWindow->GetClientSize (&winSize.width, &winSize.height);
@@ -97,7 +97,7 @@
void CWXNormROI::OnPaint (CIplImage *pImg)
{
- CvSize winSize;
+ cv::Size winSize;
m_pWindow->GetClientSize(&winSize.width, &winSize.height);
m_pVisibleNormROI->OnPaint (winSize, pImg);
}
|