Detecting Gaussians in an image












1















I have a greyscale image, represented by a histogram below (x and y axes are pixels, z axis is pixel intensity).
Each cluster of bars represents an object, with the local maxima fairly approximating the centroid of the object. My goal is to find the Full Width Half Max of each object – so I'm roughly approximating each object as a Gaussian distribution.



How can I detect each cluster individually? I understand how to mathematically calculate the FWHM, but I'm not sure how to detect each cluster based on its (roughly) Gaussian features. (e.g., in the example below I would want to detect 6 clusters. One can see a small cluster in the middle but its amplitude is so small that I am okay with missing it).



I appreciate any advice - and efficiency is not a major issue, so I can implement relatively expensive solutions.










share|improve this question





























    1















    I have a greyscale image, represented by a histogram below (x and y axes are pixels, z axis is pixel intensity).
    Each cluster of bars represents an object, with the local maxima fairly approximating the centroid of the object. My goal is to find the Full Width Half Max of each object – so I'm roughly approximating each object as a Gaussian distribution.



    How can I detect each cluster individually? I understand how to mathematically calculate the FWHM, but I'm not sure how to detect each cluster based on its (roughly) Gaussian features. (e.g., in the example below I would want to detect 6 clusters. One can see a small cluster in the middle but its amplitude is so small that I am okay with missing it).



    I appreciate any advice - and efficiency is not a major issue, so I can implement relatively expensive solutions.










    share|improve this question



























      1












      1








      1








      I have a greyscale image, represented by a histogram below (x and y axes are pixels, z axis is pixel intensity).
      Each cluster of bars represents an object, with the local maxima fairly approximating the centroid of the object. My goal is to find the Full Width Half Max of each object – so I'm roughly approximating each object as a Gaussian distribution.



      How can I detect each cluster individually? I understand how to mathematically calculate the FWHM, but I'm not sure how to detect each cluster based on its (roughly) Gaussian features. (e.g., in the example below I would want to detect 6 clusters. One can see a small cluster in the middle but its amplitude is so small that I am okay with missing it).



      I appreciate any advice - and efficiency is not a major issue, so I can implement relatively expensive solutions.










      share|improve this question
















      I have a greyscale image, represented by a histogram below (x and y axes are pixels, z axis is pixel intensity).
      Each cluster of bars represents an object, with the local maxima fairly approximating the centroid of the object. My goal is to find the Full Width Half Max of each object – so I'm roughly approximating each object as a Gaussian distribution.



      How can I detect each cluster individually? I understand how to mathematically calculate the FWHM, but I'm not sure how to detect each cluster based on its (roughly) Gaussian features. (e.g., in the example below I would want to detect 6 clusters. One can see a small cluster in the middle but its amplitude is so small that I am okay with missing it).



      I appreciate any advice - and efficiency is not a major issue, so I can implement relatively expensive solutions.







      matlab image-processing object-detection gaussian






      share|improve this question















      share|improve this question













      share|improve this question




      share|improve this question








      edited Nov 20 '18 at 5:03









      Cris Luengo

      19.4k51947




      19.4k51947










      asked Nov 20 '18 at 3:13









      oofinoofin

      588




      588
























          1 Answer
          1






          active

          oldest

          votes


















          1














          To find the centers of each of these groupings you could use a type of A* search algorithm, or similar linear optimization algorithm.



          It will find its way to the maxima of a grouping. The issue after that is you wont know if you are at a local maxima (which in your scenario is likely). After your current search has bottomed out at the highest point, and you have calculated the FWHM for that area, you could set all the nodes your A* has traversed to 0, (or mark each node as visited so as to not be visited again), and start the A* algorithm again, until all nodes have been seen, and all groupings found.






          share|improve this answer
























          • I like this answer, and if I have time soon I'll try it out. Unfortunately I don't have enough background to implement this strategy quickly enough! Great idea though

            – oofin
            Nov 20 '18 at 3:30











          • A* might be a bit of overkill, something more naive will probably converge fast enough unless your data is very large/complicated. Good luck.

            – DMarczak
            Nov 20 '18 at 3:34











          • If you like this answer you can click the green check mark to choose it as the selected answer.

            – DMarczak
            Nov 20 '18 at 6:00











          Your Answer






          StackExchange.ifUsing("editor", function () {
          StackExchange.using("externalEditor", function () {
          StackExchange.using("snippets", function () {
          StackExchange.snippets.init();
          });
          });
          }, "code-snippets");

          StackExchange.ready(function() {
          var channelOptions = {
          tags: "".split(" "),
          id: "1"
          };
          initTagRenderer("".split(" "), "".split(" "), channelOptions);

          StackExchange.using("externalEditor", function() {
          // Have to fire editor after snippets, if snippets enabled
          if (StackExchange.settings.snippets.snippetsEnabled) {
          StackExchange.using("snippets", function() {
          createEditor();
          });
          }
          else {
          createEditor();
          }
          });

          function createEditor() {
          StackExchange.prepareEditor({
          heartbeatType: 'answer',
          autoActivateHeartbeat: false,
          convertImagesToLinks: true,
          noModals: true,
          showLowRepImageUploadWarning: true,
          reputationToPostImages: 10,
          bindNavPrevention: true,
          postfix: "",
          imageUploader: {
          brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
          contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
          allowUrls: true
          },
          onDemand: true,
          discardSelector: ".discard-answer"
          ,immediatelyShowMarkdownHelp:true
          });


          }
          });














          draft saved

          draft discarded


















          StackExchange.ready(
          function () {
          StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f53385677%2fdetecting-gaussians-in-an-image%23new-answer', 'question_page');
          }
          );

          Post as a guest















          Required, but never shown

























          1 Answer
          1






          active

          oldest

          votes








          1 Answer
          1






          active

          oldest

          votes









          active

          oldest

          votes






          active

          oldest

          votes









          1














          To find the centers of each of these groupings you could use a type of A* search algorithm, or similar linear optimization algorithm.



          It will find its way to the maxima of a grouping. The issue after that is you wont know if you are at a local maxima (which in your scenario is likely). After your current search has bottomed out at the highest point, and you have calculated the FWHM for that area, you could set all the nodes your A* has traversed to 0, (or mark each node as visited so as to not be visited again), and start the A* algorithm again, until all nodes have been seen, and all groupings found.






          share|improve this answer
























          • I like this answer, and if I have time soon I'll try it out. Unfortunately I don't have enough background to implement this strategy quickly enough! Great idea though

            – oofin
            Nov 20 '18 at 3:30











          • A* might be a bit of overkill, something more naive will probably converge fast enough unless your data is very large/complicated. Good luck.

            – DMarczak
            Nov 20 '18 at 3:34











          • If you like this answer you can click the green check mark to choose it as the selected answer.

            – DMarczak
            Nov 20 '18 at 6:00
















          1














          To find the centers of each of these groupings you could use a type of A* search algorithm, or similar linear optimization algorithm.



          It will find its way to the maxima of a grouping. The issue after that is you wont know if you are at a local maxima (which in your scenario is likely). After your current search has bottomed out at the highest point, and you have calculated the FWHM for that area, you could set all the nodes your A* has traversed to 0, (or mark each node as visited so as to not be visited again), and start the A* algorithm again, until all nodes have been seen, and all groupings found.






          share|improve this answer
























          • I like this answer, and if I have time soon I'll try it out. Unfortunately I don't have enough background to implement this strategy quickly enough! Great idea though

            – oofin
            Nov 20 '18 at 3:30











          • A* might be a bit of overkill, something more naive will probably converge fast enough unless your data is very large/complicated. Good luck.

            – DMarczak
            Nov 20 '18 at 3:34











          • If you like this answer you can click the green check mark to choose it as the selected answer.

            – DMarczak
            Nov 20 '18 at 6:00














          1












          1








          1







          To find the centers of each of these groupings you could use a type of A* search algorithm, or similar linear optimization algorithm.



          It will find its way to the maxima of a grouping. The issue after that is you wont know if you are at a local maxima (which in your scenario is likely). After your current search has bottomed out at the highest point, and you have calculated the FWHM for that area, you could set all the nodes your A* has traversed to 0, (or mark each node as visited so as to not be visited again), and start the A* algorithm again, until all nodes have been seen, and all groupings found.






          share|improve this answer













          To find the centers of each of these groupings you could use a type of A* search algorithm, or similar linear optimization algorithm.



          It will find its way to the maxima of a grouping. The issue after that is you wont know if you are at a local maxima (which in your scenario is likely). After your current search has bottomed out at the highest point, and you have calculated the FWHM for that area, you could set all the nodes your A* has traversed to 0, (or mark each node as visited so as to not be visited again), and start the A* algorithm again, until all nodes have been seen, and all groupings found.







          share|improve this answer












          share|improve this answer



          share|improve this answer










          answered Nov 20 '18 at 3:27









          DMarczakDMarczak

          1119




          1119













          • I like this answer, and if I have time soon I'll try it out. Unfortunately I don't have enough background to implement this strategy quickly enough! Great idea though

            – oofin
            Nov 20 '18 at 3:30











          • A* might be a bit of overkill, something more naive will probably converge fast enough unless your data is very large/complicated. Good luck.

            – DMarczak
            Nov 20 '18 at 3:34











          • If you like this answer you can click the green check mark to choose it as the selected answer.

            – DMarczak
            Nov 20 '18 at 6:00



















          • I like this answer, and if I have time soon I'll try it out. Unfortunately I don't have enough background to implement this strategy quickly enough! Great idea though

            – oofin
            Nov 20 '18 at 3:30











          • A* might be a bit of overkill, something more naive will probably converge fast enough unless your data is very large/complicated. Good luck.

            – DMarczak
            Nov 20 '18 at 3:34











          • If you like this answer you can click the green check mark to choose it as the selected answer.

            – DMarczak
            Nov 20 '18 at 6:00

















          I like this answer, and if I have time soon I'll try it out. Unfortunately I don't have enough background to implement this strategy quickly enough! Great idea though

          – oofin
          Nov 20 '18 at 3:30





          I like this answer, and if I have time soon I'll try it out. Unfortunately I don't have enough background to implement this strategy quickly enough! Great idea though

          – oofin
          Nov 20 '18 at 3:30













          A* might be a bit of overkill, something more naive will probably converge fast enough unless your data is very large/complicated. Good luck.

          – DMarczak
          Nov 20 '18 at 3:34





          A* might be a bit of overkill, something more naive will probably converge fast enough unless your data is very large/complicated. Good luck.

          – DMarczak
          Nov 20 '18 at 3:34













          If you like this answer you can click the green check mark to choose it as the selected answer.

          – DMarczak
          Nov 20 '18 at 6:00





          If you like this answer you can click the green check mark to choose it as the selected answer.

          – DMarczak
          Nov 20 '18 at 6:00


















          draft saved

          draft discarded




















































          Thanks for contributing an answer to Stack Overflow!


          • Please be sure to answer the question. Provide details and share your research!

          But avoid



          • Asking for help, clarification, or responding to other answers.

          • Making statements based on opinion; back them up with references or personal experience.


          To learn more, see our tips on writing great answers.




          draft saved


          draft discarded














          StackExchange.ready(
          function () {
          StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f53385677%2fdetecting-gaussians-in-an-image%23new-answer', 'question_page');
          }
          );

          Post as a guest















          Required, but never shown





















































          Required, but never shown














          Required, but never shown












          Required, but never shown







          Required, but never shown

































          Required, but never shown














          Required, but never shown












          Required, but never shown







          Required, but never shown







          Popular posts from this blog

          MongoDB - Not Authorized To Execute Command

          How to fix TextFormField cause rebuild widget in Flutter

          Npm cannot find a required file even through it is in the searched directory