-
Notifications
You must be signed in to change notification settings - Fork 210
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Math Module #108
Comments
@jywarren Is this a bit too much for an FTO? I have tried to document it well though. |
Can I give this a shot? |
Well, I guess it's not too much? :-)
Please give it a go and we'll do our best to help you out!
…On Sep 3, 2017 6:29 PM, "Debesh Adhikari" ***@***.***> wrote:
Can I give this a shot?
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
<#108 (comment)>,
or mute the thread
<https://github.com/notifications/unsubscribe-auth/AABfJ3vbA8iwlQRY7Fpki5sTxxzd0MvYks5seyhagaJpZM4PLJ3V>
.
|
Sure, thanks ! I will post my questions here if I am stuck. |
I have a question. The module takes arithmetic expressions as inputs and evaluates the expressions. Can I just use eval function for this or are there any other suggested libraries for this purpose? |
Directly Using eval for this isn't very safe, and I don't think an
additional library is required for this.
What you could do is parse the input and evaluate the result yourself,
instead of directly using eval.
…On Tue, Sep 5, 2017, 02:15 Debesh Adhikari ***@***.***> wrote:
I have a question. The module takes arithmetic expressions as inputs and
evaluates the expressions. Can I just use eval function for this or are
there any other suggested libraries for this purpose?
—
You are receiving this because you authored the thread.
Reply to this email directly, view it on GitHub
<#108 (comment)>,
or mute the thread
<https://github.com/notifications/unsubscribe-auth/AT0xnERURJr-VNak_kvxkIus4VvucVl1ks5sfGGEgaJpZM4PLJ3V>
.
|
Can there be any mathematical operators in the equations or are the operators limited? And about nested parenthesis? So I need to write a complete mathematical expression parser here? |
i want to try too. |
@debeshadhikari Very complex math isn't required, Basic operations like + , - , * , / would do, including variables R, G, B as shown in the issue description @shyamjesal Sure, why not! You can also have a look at other first-timer-only labelled issues (I don't think there are any more open issues; Will add more!) |
@debeshadhikari @ccpandhare -- i think eval may be the easier route here and since it's just in the sandboxed client-side, there shouldn't be a problem. If people want to specify a math parser other than |
As a follow-up issue, we might ask people to look through the npmjs.org listings for a math parser though! |
How do I handle if the user enters some wrong-syntax expressions? The expression will be evaluated as we are using eval and an error will be thrown stopping the script, should I put try/catch blocks around? Are there any other easier ways to handle this situation?? Also, what should be the default value if no input is provided? I was thinking of keeping the initial RGB values or should I make it 0? |
Yes, the default should be the initial R, G, B values.
Yes, a try catch statement should do the trick!
…On Wed, Sep 6, 2017, 07:39 Debesh Adhikari ***@***.***> wrote:
How do I handle if the user enters some wrong-syntax expressions? The
expression will be evaluated as we are using eval and an error will be
thrown stopping the script, should I put try/catch blocks around?
Are there any other easier ways to handle this situation??
Also, what should be the default value if no input is provided? I was
thinking of keeping the initial RGB values or should I make it 0?
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
<#108 (comment)>,
or mute the thread
<https://github.com/notifications/unsubscribe-auth/AT0xnACpcgrxCA-7LMhGmk6yDLUhXuavks5sff7IgaJpZM4PLJ3V>
.
|
Excited to see this happening. Thanks and tell us if you get stuck! |
Also, see a similar implementation you can try out at https://infragram.org/sandbox |
Hi, @debeshadhikari - how are things going? any way we can help, or any code you could share in a pull request? Thanks!! 🎈 |
Hi, I am extremely sorry for the very late response. I have been really busy and been travelling around for work. I have completed the task, and will send a pull request as soon as I settle back, which is in a couple of days. Again, I am really sorry for the delay. |
No problem, glad to hear it's solved, and safe travels! |
Thanks Debesh!
Safe travels!
…On Mon, Sep 25, 2017, 22:08 Jeffrey Warren ***@***.***> wrote:
No problem, glad to hear it's solved, and safe travels!
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
<#108 (comment)>,
or mute the thread
<https://github.com/notifications/unsubscribe-auth/AT0xnMgADeHJIQCVvqMcreCSiV6BJ3Ckks5sl9cMgaJpZM4PLJ3V>
.
|
Hi, @debeshadhikari - hope your travels are going well. If you have a moment to open a PR that'd be great, and we'd be happy to help you debug or refine if any of that is needed. Thanks! We can even help rebase if that helps too. |
Hi, this is a first-timers-only issue. This means this has been worked to make it more legible to folks who either haven't contributed to our codebase before, or even folks who haven't contributed to open source before.
If you have contributed before, consider leaving this one for someone new, and looking through our general help wanted issues. Thanks!
The Feature
Add a new Image Sequencer Module which accepts a Math expression
This module will iterate over the pixels and for each pixel, manipulate it based on a given Math equation. For example
This is inspired from Infragram.org. Have a look at a similar functionality in action on Infragram here.
Towards the solution
Have a look at how to contribute Modules on ./CONTRIBUTING.md
You can also have a look at existing modules here : ./src/modules.
There already are modules which do pixel-by-pixel manipulation. For example: Invert, NdviRed, GreenChannel.
The code for any pixel-by-pixel manipulating module should be almost the same. Each of these have a
changePixel
method. For example, in the Invert Module :An Invert module is supposed to invert the R,G,B values of a given image pixel-by-pixel (i.e. r -> 255-r, and so on). The above changePixel does the same.
A (function) called pixelManipulation is made for facilitating the easy making of pixel-by-pixel manipulation modules. All the above examples use this.
The pixelManipulation function accepts an image, a changePixel function, an output function, image format, etc.
The above modules are sufficient to demonstrate its usage.
The Solution
$ grunt build
$ npm test
Steps to Fix
work-needed
if you haven't completed the work on the issue)The text was updated successfully, but these errors were encountered: