Skip to content
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

Gaussian Noise Implementation #29

Open
wants to merge 30 commits into
base: master
Choose a base branch
from

Conversation

khilanravani
Copy link

An implementation of adding Gaussian noise to images. A few changes yet to be made before producing sample outputs.

khilanravani and others added 30 commits May 28, 2018 15:49
We first extract some information from the image - width, height etc., convert
to luma and compute gradients. Then, for each pixel (x,y), we compute rho = xcos(theta) + ysin(theta).
After a few more transformations and finding the bins with highest values, we generate the
resulting image.
Preliminary Hough transform implementation
It is used to improve contrast in images and works by performing
enhancement on small 'contextual' regions or neighborhood of each
pixel in the given image.
Fix the horizontal kernel of Sobel filter.
* Mean filter version 1
@lehins
Copy link
Owner

lehins commented Aug 19, 2018

If you look at documentation of makeImageR closely you'll notice that it talks about dimensions m rows and n columns. There are place where use terms width and height, and x and y, but you use them in incorrectly. When we talk about rows we talk about height, not width, eg. when you call I.index image (x, y), you get element at x-th row (vertically, i.e. y axis) and y-th column (horizontally i.e. x-axis). This is a common mistake, since in image processing literature and software it rows and columns nomenclature is used, since that's what it usually is in matrices. For that reason I recommend to avoid using terms width and height completely, and using i and j for indexing, this prevents that common mistake from happening. Please try to go through your PRs and make the corrections. I'll try to point out in the code itself wherever I'll find.

gaussianNoise image mean sigma g = accBin
where
widthMax, heightMax :: Int
widthMax = ((rows image) - 1)
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

width /= rows, as in the comment.

where
widthMax, heightMax :: Int
widthMax = ((rows image) - 1)
heightMax = ((cols image) - 1)
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

height /= cols, as in the comment

@lehins
Copy link
Owner

lehins commented Aug 19, 2018

Also, please try to make sure that the code at least compiles before submitting a PR. Just run stack test.

@khilanravani
Copy link
Author

@lehins Sorry sir but actually, I had a query in a part or two and hence left a couple things deliberately. I had a doubt whether this was the correct way. Secondly, I was not sure what list/array to use for the purpose. As in lines 87-90, I'm unsure how to convert and use the generated values from normals' .

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants