JansenFelipe\OMR\Scanners\ImagickScanner::textArea PHP Method

textArea() protected method

Returns image blob in a rectangular area
protected textArea ( Point $a, Point $b ) : string
$a JansenFelipe\OMR\Point
$b JansenFelipe\OMR\Point
return string
    protected function textArea(Point $a, Point $b)
    {
        $width = $b->getX() - $a->getX();
        $height = $b->getY() - $a->getY();
        $region = $this->original->getImageRegion($width, $height, $a->getX(), $a->getY());
        //Add draw debug
        $this->draw->setStrokeOpacity(1);
        $this->draw->setFillOpacity(0);
        $this->draw->setStrokeWidth(2);
        $this->draw->setStrokeColor("#FFFF00");
        $this->draw->rectangle($a->getX(), $a->getY(), $b->getX(), $b->getY());
        return $region->getImageBlob();
    }