Coder Social home page Coder Social logo

Comments (5)

jolson6 avatar jolson6 commented on August 21, 2024

It looks like the function atan2 returns values expressed in radians which would need to be a double or a float, though we could convert those values to degrees before storing them. I'm leaning towards using option 3 since it saves space using an unsigned char but still allows us to have the degrees stored as meaningful values. The only drawback I can see to this approach is that you are unable to store degrees above 255, but I don't know that a Sobel filter would ever require a direction greater than 180 degrees anyway.

from canny-opencl.

jolson6 avatar jolson6 commented on August 21, 2024

I was trying to add us both as assignees, but it doesn't look lil it will let two people be assigned.

from canny-opencl.

jolson6 avatar jolson6 commented on August 21, 2024

I suppose the other downside of using unsigned char is that we would need to typecast it as an int in order to use it as a number value. I suppose this is a trade off of space versus compute time, though I don't know how much compute effort is required to typecast something.

from canny-opencl.

smskelley avatar smskelley commented on August 21, 2024

Yeah, it appears as though Github only allows one person to be assigned to an issue.

That's a good point about atan2 returning radians, since it would then make no sense to store degrees in a float.

On the note of typecasting, I could be mistaken, but I have always assumed they are a compile time operation, so really no compute is required. Additionally, uchar and int should play nicely together without explicit casting. I guess technically adding a uchar and an int might cause one register to be zeroed before storing the uchar, but that's negligible and up to the compiler.

This discussion has so far sold me on option 3 as being a good choice. I would be interested in seeing what the performance difference between a floating point radian representation and a unsigned char degree representation, whether there is a noticeable difference or not.

I have unassigned myself from this issue. I was planning on doing it, but it doesn't matter with me. If someone else would like to do it, feel free to assign yourself. If not, I'll take care of it when I have a chance.

from canny-opencl.

jolson6 avatar jolson6 commented on August 21, 2024

I've been working on it today and I think I have it almost ready to test.

from canny-opencl.

Related Issues (16)

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.