Closed aquatiko closed 5 years ago
https://docs.opencv.org/3.4/d3/dc1/tutorial_basic_linear_transform.html
Reference for changing brightness and contrast using operation
g(x) = a*f(x) + b
where a
controls contrast and b
brightness
Also, I have added a threshold parameter to filter out pixels below it.
@giordano I have added the required changes but I don't quite understand the feature going to showmime.jl
step.
Changes Missing Coverage | Covered Lines | Changed/Added Lines | % | ||
---|---|---|---|---|---|
src/showmime.jl | 3 | 4 | 75.0% | ||
<!-- | Total: | 3 | 4 | 75.0% | --> |
Totals | |
---|---|
Change from base Build 20: | 9.5% |
Covered Lines: | 20 |
Relevant Lines: | 21 |
Merging #7 into master will increase coverage by
0.21%
. The diff coverage is75%
.
@@ Coverage Diff @@
## master #7 +/- ##
==========================================
+ Coverage 97.22% 97.43% +0.21%
==========================================
Files 3 3
Lines 36 39 +3
==========================================
+ Hits 35 38 +3
Misses 1 1
Impacted Files | Coverage Δ | |
---|---|---|
src/AstroImages.jl | 100% <ø> (ø) |
:arrow_up: |
src/showmime.jl | 75% <75%> (+75%) |
:arrow_up: |
Continue to review full report at Codecov.
Legend - Click here to learn more
Δ = absolute <relative> (impact)
,ø = not affected
,? = missing data
Powered by Codecov. Last update ae7af2d...d1edf06. Read the comment docs.
Please, also add a test for this function. A @testset
on its own is fine.
In general, it is very important to test every feature you introduce, or bug you fix.
@giordano the function visualize
just shows the slider interface in IJulia. What should one assert for the tests?
Also, can you give some pointers on steps for showmime.jl
Don't worry about using it in showmime, it's trickier than I expected, I need to think more about it. I'll also the test.
@giordano would this require any more work before getting merged?
would this require any more work before getting merged?
Not from you, thanks!
I'm waiting for an answer to this question: https://discourse.julialang.org/t/base-show-method-for-showing-a-widget-in-jupyter/22099 I initially thought that simply replacing the render
function with the new function in
https://github.com/JuliaAstro/AstroImages.jl/blob/282b59e70ec522061f5bc39710c89f3df6adbe50/src/showmime.jl#L2-L3
would have been sufficient. It turned out that this isn't the case, we probably need to use another MIME, but I don't know which one.
The trick is to use text/html
: https://discourse.julialang.org/t/base-show-method-for-showing-a-widget-in-jupyter/22099/4 Would you like to have the honour to do the change? :slightly_smiling_face:
Yeah sure!! It would help me learn about the Jupyter interface we would be doing later
@giordano Would this require further work before merging?
@giordano I think this needs a CI re-run.
A handy function to visualize your fits images by changing brightness and contrast in your Jupyter notebooks. Currently works for GrayScale images.
[X] Add
brightness_contrast
function[X] Update Docs
[x] Tweak to accept range from user (brightness and contrast)
Results in IJulia: