Skip to main content
. 2021 Jul 17;7(7):119. doi: 10.3390/jimaging7070119
Algorithm 1 Pseudo-code for the proposed method
Input: image I of shape Nx×Ny with C color channels.
Parameters: W=256 macroblock side, S=0.5 stride, num_scales = 3 number of scales.
  • 1:

    Mx=Nx/(W×S)1.         ▹ horizontal number of macroblocks

  • 2:

    My=Ny/(W×S)1.            ▹ vertical number of macroblocks

  • 3:

    macroblocks_listlistofallW×WmacroblockswithSstride.

  • 4:

    for each scale s do

  • 5:

        for each channel c do

  • 6:

            Iscgetimageinscalesandchannelc.

  • 7:

            fIscnoisecurveestimationforIscusing [29] as described in Appendix A.

  • 8:

            Hczeros(Mx×My).

  • 9:

            for each macroblock in macroblocks_list do

  • 10:

               Mscgetmacroblockinscalesandchannelc.

  • 11:

               fMscnoisecurveestimationforMscusing [29] as described in Appendix A.

  • 12:

               Hc[Msc]percentageofbinsoffMscbelowfIsc.

  • 13:

            end for

  • 14:

        end for

  • 15:

        HsgeometricmeanoftheheatmapsHc.

  • 16:

    end for

  • 17:

    HauxsumandnormalizationofheatmapsHs.

  • 18:

    HcomputeforeachpixeltheaverageofHauxforeachmacroblockcontainingit.

  • 19:

    returnH.