ACloudViewer  3.9.4
A Modern Library for 3D Data Processing
ecvInnerRect2DFinder.h
Go to the documentation of this file.
1 // ----------------------------------------------------------------------------
2 // - CloudViewer: www.cloudViewer.org -
3 // ----------------------------------------------------------------------------
4 // Copyright (c) 2018-2024 www.cloudViewer.org
5 // SPDX-License-Identifier: MIT
6 // ----------------------------------------------------------------------------
7 
8 #pragma once
9 
10 // CV_DB_LIB
11 #include <ecvBox.h>
12 #include <ecvGenericPointCloud.h>
13 
16 public:
19 
21  ccBox* process(ccGenericPointCloud* cloud, unsigned char zDim = 2);
22 
23 protected:
25  bool init(ccGenericPointCloud* cloud, unsigned char zDim);
26 
28  struct Rect {
29  Rect() : x0(0), y0(0), x1(0), y1(0) {}
30  Rect(double _x0, double _y0, double _x1, double _y1)
31  : x0(_x0), y0(_y0), x1(_x1), y1(_y1) {}
32 
33  double x0, y0, x1, y1;
34 
35  inline double width() const { return x1 - x0; }
36  inline double height() const { return y1 - y0; }
37  inline double area() const { return width() * height(); }
38  };
39 
41  void findBiggestRect(const Rect& rect, unsigned startIndex);
42 
45 
49  double m_maxArea;
50 
53 
55  unsigned char m_X;
57  unsigned char m_Y;
58 };
Box (primitive)
Definition: ecvBox.h:16
A 3D cloud interface with associated features (color, normals, octree, etc.)
Finds a the biggets enclosed rectangle in a point cloud (2D)
Rect m_boundingRect
Global rectangle.
unsigned char m_X
X dimension.
ccInnerRect2DFinder()
Default constructor.
double m_maxArea
Inner rectangle max area.
ccGenericPointCloud * m_cloud
Associated cloud.
Rect m_maxRect
Inner rectangle.
bool init(ccGenericPointCloud *cloud, unsigned char zDim)
Initializes internal structures.
ccBox * process(ccGenericPointCloud *cloud, unsigned char zDim=2)
Finds the biggest enclosed rectangle.
void findBiggestRect(const Rect &rect, unsigned startIndex)
Internal processs.
unsigned char m_Y
Y dimension.
Rect(double _x0, double _y0, double _x1, double _y1)
Definition: lsd.c:1170