Coder Social home page Coder Social logo

`Laplacian` is incorrect about imageproc HOT 8 CLOSED

cospectrum avatar cospectrum commented on July 26, 2024
`Laplacian` is incorrect

from imageproc.

Comments (8)

cospectrum avatar cospectrum commented on July 26, 2024 1

Do you think laplacian_filter is correct? It's definitely not. Because I have variance of laplacian and laplacian of gaussian in the production, and current implementation from imageproc master just not gonna work for me, so I will continue to use my own implementation, which does not lose value.

from imageproc.

thecodergus avatar thecodergus commented on July 26, 2024

I read your points, reviewed the literature I consulted a year ago (Digital Image Processing, Global Edition - Rafael C. Gonzalez and Richard E. Woods) and I say that it is correct as it is. The default value of OpenCV is the adjacency transform, if you read my previous constructor, the use of [0, 1, 0, 1, -4, 1, 0, 1, 0] was present as an optional situation (The result is "dirtier"), if OpenCV uses it as default, it was a decision of the developers, in the literature this is a secondary formula. As for what you mentioned about the real Laplacian being able to have negative values, I didn't understand your point very well, in a GrayImage the resulting value will never be greater than 255 or negative.
ovo1_laplace2

from imageproc.

cospectrum avatar cospectrum commented on July 26, 2024

In GrayImage they will not be negative or larger than 255, since in this format the pixels are stored as u8. But it doesn't mean that values are correct.

from imageproc.

cospectrum avatar cospectrum commented on July 26, 2024

If the input values are in [0, 255], then after Laplacian (with [0, 1, 0, 1, -4, 1, 0, 1, 0] kernel) they can be in [-1020, 1020].

from imageproc.

cospectrum avatar cospectrum commented on July 26, 2024

See horizontal_sobel, for example. The input is GrayImage, but the output is Image<Luma<i16>> to make sure we don't lose the value.

from imageproc.

thecodergus avatar thecodergus commented on July 26, 2024

See horizontal_sobel, for example. The input is GrayImage, but the output is Image<Luma<i16>> to make sure we don't lose the value.

I understand your point, but for what the algorithm proposes and does is correct, no information will be lost

from imageproc.

cospectrum avatar cospectrum commented on July 26, 2024

https://docs.opencv.org/4.9.0/d5/db5/tutorial_laplace_operator.html

laplace

from imageproc.

thecodergus avatar thecodergus commented on July 26, 2024

https://docs.opencv.org/4.9.0/d5/db5/tutorial_laplace_operator.html
laplace

I understand, I removed my suggestion about this, the only point that really bothered me was the removal of the function

from imageproc.

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.