Skip to content

Wrong phash value for 195x64 images #34

@ursfassler

Description

@ursfassler

The phash is all 0 when the image is more than 194 pixels wide and has a height of 64 pixels or less, e.g. a resolution of 195x64 pixels.

Steps to reproduce:

  • Create a image with a resolution of 195x64 pixels
  • Run TestRadish with this image
  • The phash is all 0's

Problem:

  • in ph_radon_projections, projs.nb_pix_perline at index 134 is not changed, i.e. this value is 0
  • in ph_feature_vector, there is a division with the 0 value from projs.nb_pix_perline[134] (nb_pixels):
    feat_v[k] = (line_sum_sqd / nb_pixels) -
                (line_sum * line_sum) / (nb_pixels * nb_pixels);

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions