Esempio n. 1
0
/**
 * gets the size of a bounding box  of a quad
 */
vector getSize(quadri q) {
  vector siz,
      minXY = getMinXY(q),
      maxXY = getMaxXY(q);

  siz.x = maxXY.x-minXY.x;
  siz.y = maxXY.y-minXY.y;
  siz.z = 0.0;

  return siz;
}
Esempio n. 2
0
/**
 * gets the midpoint of a bounding box  of a quad
 */
vector getMidPoint(quadri q) {
  vector mid,
      minXY = getMinXY(q),
      maxXY = getMaxXY(q);

  mid.x = 0.5*(minXY.x+maxXY.x);
  mid.y = 0.5*(minXY.y+maxXY.y);
  mid.z = 0.0;

  return mid;
}
Esempio n. 3
0
void dcTileView::attachDown(Mat img){

	Mat aimg	= adjustSize(toBGR(img));

	int max = getMaxXY().y;

	imgs.push_back(aimg);
	Rect r(0, max, aimg.cols, aimg.rows ) ;

	rects.push_back(r);

}
Esempio n. 4
0
void dcTileView::show(string wname){

	Point p = getMaxXY();

	Mat img(p.y, p.x, CV_8UC3);

	for(int i=0;i<rects.size();i++){
		Rect r = rects[i];
		imgs[i].copyTo( img(r) );
	}

	imshow(wname, img);
}
Esempio n. 5
0
Mat dcTile::mat(){
	Point p = getMaxXY();

	if(p.x == 0 || p.y == 0) return Mat(100,100, CV_8UC3);

	Mat img(p.y, p.x, CV_8UC3);

	for(int i=0;i<rects.size();i++){
		Rect r = rects[i];
		imgs[i].copyTo( img(r) );
	}

	return img;
}
Esempio n. 6
0
void dcTile::tile(short opt, Mat img){

	Mat aimg	= adjustSize(toBGR(img));
	Point mx = getMaxXY();

	imgs.push_back(aimg);
	Rect  r;

	switch(opt) {
	case TILE_V:
		r =  Rect(0, mx.y, aimg.cols, aimg.rows );
		break;

	case TILE_H:
		r =  Rect(mx.x, 0, aimg.cols, aimg.rows );
	}

	rects.push_back(r);
}