ImagickKernel::addUnityKernel Description &reftitle.description; public voidImagickKernel::addUnityKernel Añade una cantidad dada de Núcleo de Convolución 'Unidad' al núcleo («kernel») preescalado y normalizado dado. En efecto, esto añade dicha cantidad de la imagen original al núcleo de convolución resultante. El efecto resultante es convertir los núcleos definidos a núcleos no nítidos con una suave borrosidad o a núcleos nítidos. &reftitle.parameters; &no.function.parameters; &reftitle.returnvalues; &reftitle.examples; <function>ImagickKernel::addUnityKernel</function> "; foreach ($matrix as $row) { $output .= ""; foreach ($row as $cell) { $output .= ""; if ($cell === false) { $output .= "false"; } else { $output .= round($cell, 3); } $output .= ""; } $output .= ""; } $output .= ""; return $output; } $matrix = [ [-1, 0, -1], [ 0, 4, 0], [-1, 0, -1], ]; $kernel = \ImagickKernel::fromMatrix($matrix); $kernel->scale(1, \Imagick::NORMALIZE_KERNEL_VALUE); $output = "Before adding unity kernel:
"; $output .= renderKernelTable($kernel->getMatrix()); $kernel->addUnityKernel(0.5); $output .= "After adding unity kernel:
"; $output .= renderKernelTable($kernel->getMatrix()); $kernel->scale(1, \Imagick::NORMALIZE_KERNEL_VALUE); $output .= "After renormalizing kernel:
"; $output .= renderKernelTable($kernel->getMatrix()); echo $output; ?> ]]>
<function>ImagickKernel::addUnityKernel</function> scale(4, \Imagick::NORMALIZE_KERNEL_VALUE); $kernel->addUnityKernel(0.5); $imagick = new \Imagick(realpath($imagePath)); $imagick->filter($kernel); header("Content-Type: image/jpg"); echo $imagick->getImageBlob(); } ?> ]]>