ImageMagick Imagick::adaptiveThresholdImage

(PECL imagick 2, PECL imagick 3)

Imagick::adaptiveThresholdImage — 강도 범위에 따라 각 픽셀에 대한 임계값을 선택합니다.


설명

public Imagick::adaptiveThresholdImage(int $width, int $height, int $offset): bool

로컬 이웃의 강도 값 범위를 기반으로 각 픽셀에 대한 개별 임계값을 선택합니다. 이를 통해 전역 강도 히스토그램에 고유한 피크가 포함되지 않은 이미지의 임계값을 지정할 수 있습니다.


매개변수

width
Width of the local neighborhood.
height
Height of the local neighborhood.
offset
평균 오프셋

반환 값

성공하면 true를 반환합니다.


Examples

예제 #1 Imagick::adaptiveThresholdImage()

                  
<?php
function adaptiveThresholdImage($imagePath, $width, $height, $adaptiveOffset) {
    $imagick = new \Imagick(realpath($imagePath));
    $adaptiveOffsetQuantum = intval($adaptiveOffset * \Imagick::getQuantum());
    $imagick->adaptiveThresholdImage($width, $height, $adaptiveOffsetQuantum);
    header("Content-Type: image/jpg");
    echo $imagick->getImageBlob();
}

?>