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

Opencv.js via npm for blob-detection #1185

Merged
merged 1 commit into from Aug 2, 2019

Conversation

aashna27
Copy link

@aashna27 aashna27 commented Jul 26, 2019

Fixes #172

This pr is a continuation pr of #1120, please refer there for all the major discussions on how the work evolved and the other module related information.

This pr adds opencv.js to Image sequencer via NPM and currently uses it for a new blob detection module. Opencv.js addition would enable the use of power image processing within IS. The npm adds opencv.js version 3.3

  • tests pass -- look for a green checkbox ✔️ a few minutes after opening your PR -- or run tests locally with npm test
  • code is in uniquely-named feature branch and has no merge conflicts
  • PR is descriptively titled
  • ask @publiclab/is-reviewers for help, in a comment below

@codecov
Copy link

codecov bot commented Jul 26, 2019

Codecov Report

Merging #1185 into main will decrease coverage by 0.13%.
The diff coverage is 33.33%.

Impacted file tree graph

@@            Coverage Diff             @@
##             main    #1185      +/-   ##
==========================================
- Coverage   55.45%   55.31%   -0.14%     
==========================================
  Files         114      116       +2     
  Lines        2366     2381      +15     
  Branches      364      364              
==========================================
+ Hits         1312     1317       +5     
- Misses       1054     1064      +10
Impacted Files Coverage Δ
src/Modules.js 100% <ø> (ø) ⬆️
src/modules/BlobAnalysis/index.js 100% <100%> (ø)
src/modules/BlobAnalysis/Module.js 28.57% <28.57%> (ø)

@jywarren
Copy link
Member

jywarren commented Jul 26, 2019 via email

@aashna27
Copy link
Author

aashna27 commented Jul 26, 2019

Yes i have checked and the blob analysis folder is simply copied, so all the work including documentation does exist here.

@jywarren
Copy link
Member

jywarren commented Jul 26, 2019 via email

@aashna27
Copy link
Author

aashna27 commented Aug 1, 2019

Thanks to @harshkhandeparkar I have setup the gh-pages and you can see the blob-analysis working there
https://aashna27.github.io/image-sequencer/examples/
Note: use google chrome

@jywarren
Copy link
Member

jywarren commented Aug 2, 2019

I'm seeing some assorted bugs, that may or may not be related to your code:

  • moving the Contrast slider doesn't enable the "Apply" button, so I can't modify that
  • the slider for Brightness only showed up the second time I loaded the page; when I initially added it it was just a text input
  • the Contrast pane did not show a "spinning" image while recalculating (after I dropped in a new image to the sequencer); it just showed the previous image until complete, then everything returned to normal (it showed the new image after completion)

Finally, I put this image in, and added more brightness and contrast (final sequence https://aashna27.github.io/image-sequencer/examples/#steps=brightness{},brightness{},contrast{contrast:20},blob-analysis{} due to issues with the brightness module)

Starting image:

image

Got this out:

image

So, i think it works! If you can try to confirm if these bugs are independent (like, do they happen in the main branch) then we can just merge this and open a new issue with these (if you wouldn't mind opening that too, that'd be helpful!)

Thanks, @aashna27 for getting this set up. This is looking great.

@jywarren
Copy link
Member

jywarren commented Aug 2, 2019

And, in follow-up, are there ways to adjust the blob detection sensitivity? Is it based on color, size, are there other parameters we could add? This would also be a really great follow-up issue.

🎉 Very exciting!

@aashna27
Copy link
Author

aashna27 commented Aug 2, 2019

I'm seeing some assorted bugs, that may or may not be related to your code:

* [ ]  moving the Contrast slider doesn't enable the "Apply" button, so I can't modify that

* [ ]  the slider for Brightness only showed up the second time I loaded the page; when I initially added it it was just a text input

* [ ]  the Contrast pane did not show a "spinning" image while recalculating (after I dropped in a new image to the sequencer); it just showed the previous image until complete, then everything returned to normal (it showed the new image after completion)

Finally, I put this image in, and added more brightness and contrast (final sequence https://aashna27.github.io/image-sequencer/examples/#steps=brightness{},brightness{},contrast{contrast:20},blob-analysis{} due to issues with the brightness module)

Starting image:

image

Got this out:

image

So, i think it works! If you can try to confirm if these bugs are independent (like, do they happen in the main branch) then we can just merge this and open a new issue with these (if you wouldn't mind opening that too, that'd be helpful!)

Thanks, @aashna27 for getting this set up. This is looking great.

Sorry but I could not reproduce those bugs, and I just added the blob analysis so they are not related to the pr.
ezgif com-video-to-gif

@aashna27
Copy link
Author

aashna27 commented Aug 2, 2019

And, in follow-up, are there ways to adjust the blob detection sensitivity? Is it based on color, size, are there other parameters we could add? This would also be a really great follow-up issue.

tada Very exciting!

Yeah it can be done in the way that right now it is doing everything itself but we can take inputs from the user for the different functions that are being used but we can let them provide inputs for all the functions as it would only need to confusion so the task would be to figure out what functions to ask arguements for.

@jywarren jywarren merged commit 68d5db7 into publiclab:main Aug 2, 2019
@jywarren
Copy link
Member

jywarren commented Aug 2, 2019

Awesome. This is great! Can you please open the follow-up PRs for the unrelated bugs and the parameters discussion? @MargaretAN9 may have input on what parameters to expose for tuning the blob detection!

@harshkhandeparkar
Copy link
Member

harshkhandeparkar commented Aug 2, 2019 via email

@aashna27
Copy link
Author

aashna27 commented Aug 2, 2019

Awesome. This is great! Can you please open the follow-up PRs for the unrelated bugs and the parameters discussion? @MargaretAN9 may have input on what parameters to expose for tuning the blob detection!

Yeah i ll see wasn't able to reproduce this problem.

@jywarren
Copy link
Member

jywarren commented Aug 2, 2019 via email

@jywarren
Copy link
Member

jywarren commented Aug 3, 2019

@harshkhandeparkar maybe that's a question for @aashna27 ?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
No open projects
v3.6.0
  
Done
Development

Successfully merging this pull request may close these issues.

blob/region detection and extraction for particle analysis
3 participants