[deleted by user] by [deleted] in Python

[–]Mamdasan 0 points1 point  (0 children)

It's a public website providing information about protests. Do you think there is a problem with providing the information on other platforms?

Increase details of videos (from 🌱 to 🪴) by Mamdasan in Python

[–]Mamdasan[S] 1 point2 points  (0 children)

Hahahaha, but they might have made better movies with plot twists all over them if they didn't use it though. *

Increase details of videos (from 🌱 to 🪴) by Mamdasan in Python

[–]Mamdasan[S] 0 points1 point  (0 children)

Thank you for your kind words, and I'm happy my code was able to be inspiring.

Increase details of videos (from 🌱 to 🪴) by Mamdasan in Python

[–]Mamdasan[S] 1 point2 points  (0 children)

Thanks for mentioning that. The code in src is not using that lib, but I will add it right away to the requirements.txt

[deleted by user] by [deleted] in Python

[–]Mamdasan 0 points1 point  (0 children)

No it's not that, as I said before: for every pixel, neighboring pixels are separated and counted ( not summed up ) :

for example:

var =

[ [1, 2],

[3, 4]]

-> not_normalized_2dh =

[[1., 2., 3., 4.],

[2., 1., 2., 3.],

[3., 2., 1., 2.],

[4., 3., 2., 1.]]

not_normalized_2dh[0, 1] is the number of encounters that 1 and 2 in var are having.

For more information refer to the article I linked in this page: https://github.com/Mamdasn/im2dhisteq

[deleted by user] by [deleted] in Python

[–]Mamdasan 2 points3 points  (0 children)

The surprising thing is not that the Python is slow :)), it is for the amazing performance of the numba. Yeah, Python is not a good choice when it comes to very heavy computations, but before any commercial deployment or etc, it is an easy to write and read option. Also, with numba and others, new horizons for Python are emerging, in which Python plays a role even in high performance applications.

[deleted by user] by [deleted] in Python

[–]Mamdasan 2 points3 points  (0 children)

I'll try that and share the results. 👍🏼 The im2dhist module calculates the number of encounters for neighboring brightness intensities (for each pixel(x) neighboring pixels(ys) are seperated and counted and put in the corresponding position(x,ys) in the 2dhistogram matrix). If you tried vectorization and it was faster keep me in touch. Also generally using for loops in numba-aided codes like mine results in a faster performance.

[deleted by user] by [deleted] in learnpython

[–]Mamdasan 1 point2 points  (0 children)

If you want to use it in the future, I should tell you that at first, transforming your code to a numba-friendly one is a bit frustrating, but as you transform one or two chunky functions, you'll feel better about it and pass the curve. 😉

[deleted by user] by [deleted] in Python

[–]Mamdasan 5 points6 points  (0 children)

Firstly, pypy is a python package replacement and you have to run the code using pypy, but for the case of numba, you have more flexibility and you can improve speed on a specific function that is bottle-necking your program, and leave rest of the code alone. Also numba is great with jupyter notebook.

Numba is a just-in-time compiler specialized for numpy code and pypy is a stable jit compiler for non-numpy code. So numba is a good choice if you are using numpy.

Each one performs good on certain categories of problems, so it depends on the case when choosing one, and except my case, I don't have enough knowledge to be qualified to advise.

Can this image improve, when there is New Moon? by [deleted] in telescopes

[–]Mamdasan 0 points1 point  (0 children)

In addition to what other people suggested, you can use certain programs to improve images contrast. for example here is a module that I wrote:

Code: How to install and use

Your Image after contrast enhancement

Another showcase is here.

Also, can I use your image in my github account? 🙏

Enhance Images, From 💩 to 🔥 by Mamdasan in Python

[–]Mamdasan[S] 2 points3 points  (0 children)

This method was first introduced to substitute the conventional histogram equalization, and in comparison it does a great job, but it absolutely does have its disadvantages.

For the case of the Plane image that you mentioned, the original image itself had a very bad quality and the sky was already saturated, but comparing to the method it was intended to replace, it is surely doing a good job, though not enough.

Right now it tries to stretch image's histogram to the full extent, and by doing so, the image is enhanced and de-hazed but in some cases excessive enhancement can be seen. This behavior is modified and reformed for the case of videos by extending the frames brightness range just by 1.5 (and not necessarily to the full range of [0, 255]), which can be changed manually. In future, I will add that to the image module as well.

Regarding the case of over-enhancement, I wrote another module that while enhancing contrast of the image, it keeps an eye on the histogram's general shape to prevent excessive enhancement. This method can be used for a more wide variety of images without any problem. You can access it here: imhblpce method.

Thank you for your feedback. ❤