Change language

PHP Imagick getImageChannelDistortions () function

Syntax:
float Imagick::getImageChannelDistortions (Imagick $reference, int  $metric, int $channel = Imagick::CHANNEL_DEFAULT)
Parameters:This function takes three parameters as above and described below:
  • $reference:Specifies an Imagick image object.
  • $metric:specifies one of metric type constants
    The list of metric constants is shown below:
    • imagick::METRIC_UNDEFINED (0)
    • imagick::METRIC_MEANABSOLUTEERROR (1)
    • imagick::METRIC_MEANSQUAREERROR (2 )
    • imagick::METRIC_PEAKABSOLUTEERROR (3)
    • imagick::METRIC_PEAKSIGNALTONOISERATIO (4)
    • imagick::METRIC_ROOTMEANSQUAREDERROR (5)
    • $channel:specifies a channel constant valid for channel mode. Use the bitwise operator to combine more than ten constants of the same channel type. The default channel constants are Imagick::CHANNEL_DEFAULT.
    Exceptions:This function will throw an ImagickException on error.Return Value :this function returns a double description of the channel distortion.The following programs illustrate the Imagick::getImageChannelDistortions() functionin PHP:Program 1:  
    // Create two new imagick objects $imagick1 = new Imagick ( https: //media.engineerforengineer.org/wp-content/uploads/20190823154611/engineerforengineer24.png ); $imagick2 = new Imagick ( https://media.engineerforengineer.org/ wp-content / uploads / 20190916133223 / diamond.png );  
    // Get distortion with constant METRIC as imagick::METRIC_MEANABSOLUTEERROR $distortion = $imagick1 -> getImageChannelDistortions ( $imagick2 , 1); echo $distortion ; ?>
    Output:
    23925
    Program 2:  
    // Create two new imagick objects $imagick1 = new Imagick ( https://media.engineerforengineer.org/wp-content/uploads/20190823154611/engineerforengineer24.png ); $imagick2 = new Imagick ( https://media.engineerforengineer.org/ wp-content / uploads / 20190823154611 / engineerforengineer24.png );  
    // Get distortion with constant METRIC as imagick::METRIC_MEANABSOLUTEERROR $distortion = $imagick1 -> getImageChannelDistortions ( $imagick2 , 1); echo $distortion ; ?>
    Output:
    0 because both of the images are same.
    Program 3: < ? php  
    // Create two new imagick objects $imagick1 = new Imagick ( https://media.engineerforengineer.org/wp-content/uploads/20190823154611/engineerforengineer24.png ); $imagick2 = new Imagick ( https://media.engineerforengineer.org/ wp-content / uploads / 20190916133633 / gausian.png );  
    // Get distortion with constant METRIC as imagick::METRIC_MEANSQUAREERROR $distortion = $imagick1 -> getImageChannelDistortions ( $imagick2 , 2); echo $distortion ; ?>
    Output:
    0.048318723480804
    Link: https://www .php.net / manual / en / imagick.getimagechanneldistortions.php

Shop

Best laptop for Sims 4

$

Best laptop for Zoom

$499

Best laptop for Minecraft

$590

Best laptop for engineering student

$

Best laptop for development

$

Best laptop for Cricut Maker

$

Best laptop for hacking

$890

Best laptop for Machine Learning

$950

Latest questions

NUMPYNUMPY

psycopg2: insert multiple rows with one query

12 answers

NUMPYNUMPY

How to convert Nonetype to int or string?

12 answers

NUMPYNUMPY

How to specify multiple return types using type-hints

12 answers

NUMPYNUMPY

Javascript Error: IPython is not defined in JupyterLab

12 answers

Wiki

Python OpenCV | cv2.putText () method

numpy.arctan2 () in Python

Python | os.path.realpath () method

Python OpenCV | cv2.circle () method

Python OpenCV cv2.cvtColor () method

Python - Move item to the end of the list

time.perf_counter () function in Python

Check if one list is a subset of another in Python

Python os.path.join () method