detect() {
			let left = this.leftInit;
			let right = this.rightInit;
			let up = this.upInit;
			let down = this.downInit;
			let sizeExceeded = false;
			let aBlackPointFoundOnBorder = true;
			let atLeastOneBlackPointFoundOnBorder = false;
			let atLeastOneBlackPointFoundOnRight = false;
			let atLeastOneBlackPointFoundOnBottom = false;
			let atLeastOneBlackPointFoundOnLeft = false;
			let atLeastOneBlackPointFoundOnTop = false;
			const width = this.width;
			const height = this.height;
			while (aBlackPointFoundOnBorder) {
				aBlackPointFoundOnBorder = false;
				// .....
				// .   |
				// .....
				let rightBorderNotWhite = true;
				while ((rightBorderNotWhite || !atLeastOneBlackPointFoundOnRight) && right < width) {
					rightBorderNotWhite = this.containsBlackPoint(up, down, right, false);
					if (rightBorderNotWhite) {
						right++;
						aBlackPointFoundOnBorder = true;
						atLeastOneBlackPointFoundOnRight = true;
					}
					else if (!atLeastOneBlackPointFoundOnRight) {
						right++;
					}
				}
				if (right >= width) {
					sizeExceeded = true;
					break;
				}
				// .....
				// .   .
				// .___.
				let bottomBorderNotWhite = true;
				while ((bottomBorderNotWhite || !atLeastOneBlackPointFoundOnBottom) && down < height) {
					bottomBorderNotWhite = this.containsBlackPoint(left, right, down, true);
					if (bottomBorderNotWhite) {
						down++;
						aBlackPointFoundOnBorder = true;
						atLeastOneBlackPointFoundOnBottom = true;
					}
					else if (!atLeastOneBlackPointFoundOnBottom) {
						down++;
					}
				}
				if (down >= height) {
					sizeExceeded = true;
					break;
				}
				// .....
				// |   .
				// .....
				let leftBorderNotWhite = true;
				while ((leftBorderNotWhite || !atLeastOneBlackPointFoundOnLeft) && left >= 0) {
					leftBorderNotWhite = this.containsBlackPoint(up, down, left, false);
					if (leftBorderNotWhite) {
						left--;
						aBlackPointFoundOnBorder = true;
						atLeastOneBlackPointFoundOnLeft = true;
					}
					else if (!atLeastOneBlackPointFoundOnLeft) {
						left--;
					}
				}
				if (left < 0) {
					sizeExceeded = true;
					break;
				}
				// .___.
				// .   .
				// .....
				let topBorderNotWhite = true;
				while ((topBorderNotWhite || !atLeastOneBlackPointFoundOnTop) && up >= 0) {
					topBorderNotWhite = this.containsBlackPoint(left, right, up, true);
					if (topBorderNotWhite) {
						up--;
						aBlackPointFoundOnBorder = true;
						atLeastOneBlackPointFoundOnTop = true;
					}
					else if (!atLeastOneBlackPointFoundOnTop) {
						up--;
					}
				}
				if (up < 0) {
					sizeExceeded = true;
					break;
				}
				if (aBlackPointFoundOnBorder) {
					atLeastOneBlackPointFoundOnBorder = true;
				}
			}
			if (!sizeExceeded && atLeastOneBlackPointFoundOnBorder) {
				const maxSize = right - left;
				let z = null;
				for (let i = 1; z === null && i < maxSize; i++) {
					z = this.getBlackPointOnSegment(left, down - i, left + i, down);
				}
				if (z == null) {
					throw new NotFoundException();
				}
				let t = null;
				// go down right
				for (let i = 1; t === null && i < maxSize; i++) {
					t = this.getBlackPointOnSegment(left, up + i, left + i, up);
				}
				if (t == null) {
					throw new NotFoundException();
				}
				let x = null;
				// go down left
				for (let i = 1; x === null && i < maxSize; i++) {
					x = this.getBlackPointOnSegment(right, up + i, right - i, up);
				}
				if (x == null) {
					throw new NotFoundException();
				}
				let y = null;
				// go up left
				for (let i = 1; y === null && i < maxSize; i++) {
					y = this.getBlackPointOnSegment(right, down - i, right - i, down);
				}
				if (y == null) {
					throw new NotFoundException();
				}
				return this.centerEdges(y, z, x, t);
			}
			else {
				throw new NotFoundException();
			}
		}
<p>
Detects a candidate barcode-like rectangular region within an image. It
starts around the center of the image, increases the size of the candidate
region until it finds a white rectangular region.
</p>

@return {@link ResultPoint}[] describing the corners of the rectangular
        region. The first and last points are opposed on the diagonal, as
        are the second and third. The first point will be the topmost
        point and the last, the bottommost. The second point will be
        leftmost and the third, the rightmost
@throws NotFoundException if no Data Matrix Code can be found