Skip to content
This repository was archived by the owner on Feb 14, 2023. It is now read-only.
This repository was archived by the owner on Feb 14, 2023. It is now read-only.

Blob detection scaling correction in vignette #166

@fischer-fjd

Description

@fischer-fjd

Hi,

thanks for the great package!

Just a quick note on section 5 in the vignette (“blob detection”) on https://cran.rstudio.com/web/packages/imager/vignettes/gettingstarted.html. I think there is a small error in how the Hessian determinant is scaled:

#Compute determinant at scale "scale".
hessdet <- function(im,scale=1) isoblur(im,scale) %>% imhessian %$% { scale^2*(xx*yy - xy^2) }
#Note the scaling (scale^2) factor in the determinant
plot(hessdet(hub,1),main="Determinant of the Hessian at scale 1")

As far as I understand, the scale factor here is not defined as sigma^2, but as sigma (where sigma is the sd of the Gaussian blur), so the scaling of the hessian determinant should be with sigma^4, and not with sigma^2.

hessdet <- function(im,scale=1) isoblur(im, scale) %>% imhessian %$% { scale^4*(xx*yy - xy^2) }

I tested this out in practice, and only a scale^4 factor yields the expected behavior (e.g. recognizing roughly the same objects under image rescaling).

Best,

Fabian

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