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

Update brightness tutorial #1482

Merged

Conversation

s-trinh
Copy link
Contributor

@s-trinh s-trinh commented Oct 13, 2024

Update brightness tutorial:

  • use vpDisplayFactory and scale the image by 2 for small display resolution
  • display both color and gray results
  • cycle across the different automatic gamma method to display the results

@s-trinh s-trinh force-pushed the update_tuto_brightness_cycle_gamma_methods branch from f0d72fb to 3a553d8 Compare October 13, 2024 10:41
Copy link

codecov bot commented Oct 13, 2024

Codecov Report

Attention: Patch coverage is 0% with 1 line in your changes missing coverage. Please review.

Project coverage is 53.90%. Comparing base (520efed) to head (db58506).
Report is 23 commits behind head on master.

Files with missing lines Patch % Lines
modules/imgproc/src/vpImgproc.cpp 0.00% 1 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##           master    #1482      +/-   ##
==========================================
+ Coverage   53.88%   53.90%   +0.02%     
==========================================
  Files         442      442              
  Lines       53778    53791      +13     
==========================================
+ Hits        28978    28996      +18     
+ Misses      24800    24795       -5     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

  - display and save both color and gray results
  - cycle across the different automatic gamma method
@s-trinh s-trinh force-pushed the update_tuto_brightness_cycle_gamma_methods branch 3 times, most recently from 7789949 to 8c01918 Compare October 18, 2024 20:47
@s-trinh s-trinh force-pushed the update_tuto_brightness_cycle_gamma_methods branch from 8c01918 to 0533dbf Compare October 18, 2024 21:35
@s-trinh
Copy link
Contributor Author

s-trinh commented Oct 18, 2024

Not a tutorial code but I have added tutorial-compare-auto-gamma.cpp sample code that can be used to easily compare the results between the different auto Gamma methods.

Can be used with one image:

  • ./tutorial-compare-auto-gamma --input Sample_low_brightness.png

or with a sequence of images:

  • ./tutorial-compare-auto-gamma --input visp-images/mbt/cube/image%04d.png --output Results/cube

I don't know if the inverse Gamma is needed here:

float inverse_gamma = 1.f / gamma_computed;

Without

log_gamma_computed=0.254357

Sample_low_brightness_without

log_gamma_computed=2.69225

image0197_without

log_gamma_computed=1.24885

1024px-Manarola_NW_Cinque_Terre_Sep23_A7C_07233

01

02

03

04

05

06

With

Sample_low_brightness_with

image0197_with

1024px-Manarola_NW_Cinque_Terre_Sep23_A7C_07233

01

02

03

04

05

06

s-trinh and others added 3 commits October 27, 2024 22:37
…tected on Apple M1 Pro, while there is no segfault on CI! There was an out of range memory access to computation_times vector.

% ./tutorial-compare-auto-gamma --input Sample_low_brightness.png --output Results/cube
Input: Sample_low_brightness.png
Process on half image resolution? 0
Gaussian kernel size: 3
Gaussian standard deviation: 1
Aperture size: 3
Canny filtering type: 0
RGB colorspace? 0
Output result folder: Results/cube
Computation time (gamma_log): 2.30396 ms
Computation time (gamma_nonlinear): 1.27197 ms
Computation time (gamma_cdf): 2.1228 ms
Computation time (gamma_classification): 2.62817 ms
Computation time (gamma_spatial_variant): 19.5791 ms
Write result to: Results/cube/Sample_low_brightness.jpeg

Stats:
Nb images: 1
gamma_log: mean=2.1228 ms ; median=2.1228 ms
gamma_nonlinear: mean=2.62817 ms ; median=2.62817 ms
gamma_cdf: mean=19.5791 ms ; median=19.5791 ms
libc++abi: terminating due to uncaught exception of type vpException: Empty vector !
@fspindle fspindle merged commit e7b2a9f into lagadic:master Nov 5, 2024
76 of 78 checks passed
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.

2 participants