Code Monkey home page Code Monkey logo

Comments (7)

tonysyu avatar tonysyu commented on May 23, 2024

The sobel and prewitt stencils look at the 1st and 2nd nearest neighbors. So a "bad" pixel would affect the gradient results of those neighbors. It may not be the best solution, but it seems these filters extend the mask to cover up this spreading.

That said, all the masking calculations can be moved into the if-block so that they don't affect the non-masked case. I'll take a crack at this and add some tests to actually check the masking behavior described above.

from scikit-image.

ahojnnes avatar ahojnnes commented on May 23, 2024

I would personally remove this functionality completely as it is a bit too magic and its behaviour is not described in the doc string.

from scikit-image.

thouis avatar thouis commented on May 23, 2024

The point of mask erosion is for when measuring edges/textures in a labeled
image, where one wants to ignore any values that aren't within the
foreground region. That's its original intent from the CellProfiler source.

I would fix the docstring, rather than remove the functionality.

from scikit-image.

ahojnnes avatar ahojnnes commented on May 23, 2024

I do not mean to remove the mask parameter, but the binary_erosion part. I find this quite confusing.

from scikit-image.

thouis avatar thouis commented on May 23, 2024

I think the erosion is probably necessary for some applications,
particularly if foreground and background intensities are widely separated.
Otherwise, foreground-background edges are likely to contaminate edge-based
texture calculations.

from scikit-image.

ahojnnes avatar ahojnnes commented on May 23, 2024

Yes, that makes sense. But we should definitely mention this in the doc string.

from scikit-image.

tonysyu avatar tonysyu commented on May 23, 2024

Docstring, tests, and refactor for these edge filters in PR #298.

from scikit-image.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.