Crop background from Image












4












$begingroup$


I try to write a program to crop background from an image.



This is a sample of my training data.
I have images with and without a background. (manually cropped)



The background is always similar (changes of light and so on. Sometimes people on random places.)



The object is always on the same place but not always the same (there are different models).



Can someone give me an advice how I can solve this Problem?
What is the right way to do something like this???



lern data



Image










share|improve this question











$endgroup$








  • 1




    $begingroup$
    What is the size of your dataset?
    $endgroup$
    – Armen Aghajanyan
    Dec 5 '16 at 7:55










  • $begingroup$
    about 2000 images
    $endgroup$
    – Dawid Cz
    Dec 5 '16 at 7:57






  • 1




    $begingroup$
    Usually, people use a background subtraction technique. The most basic technique is to compute the average frame and then compare against each frame. But there are much more sophisticated techniques. Packages like opencv come with lots of background subtraction implementations.
    $endgroup$
    – Ricardo Cruz
    Dec 8 '16 at 22:30










  • $begingroup$
    That´s what I need. Thx I`ll check it.
    $endgroup$
    – Dawid Cz
    Dec 9 '16 at 7:48










  • $begingroup$
    I have found here something like this stackoverflow.com/questions/17884526/…
    $endgroup$
    – Dawid Cz
    Dec 10 '16 at 12:00
















4












$begingroup$


I try to write a program to crop background from an image.



This is a sample of my training data.
I have images with and without a background. (manually cropped)



The background is always similar (changes of light and so on. Sometimes people on random places.)



The object is always on the same place but not always the same (there are different models).



Can someone give me an advice how I can solve this Problem?
What is the right way to do something like this???



lern data



Image










share|improve this question











$endgroup$








  • 1




    $begingroup$
    What is the size of your dataset?
    $endgroup$
    – Armen Aghajanyan
    Dec 5 '16 at 7:55










  • $begingroup$
    about 2000 images
    $endgroup$
    – Dawid Cz
    Dec 5 '16 at 7:57






  • 1




    $begingroup$
    Usually, people use a background subtraction technique. The most basic technique is to compute the average frame and then compare against each frame. But there are much more sophisticated techniques. Packages like opencv come with lots of background subtraction implementations.
    $endgroup$
    – Ricardo Cruz
    Dec 8 '16 at 22:30










  • $begingroup$
    That´s what I need. Thx I`ll check it.
    $endgroup$
    – Dawid Cz
    Dec 9 '16 at 7:48










  • $begingroup$
    I have found here something like this stackoverflow.com/questions/17884526/…
    $endgroup$
    – Dawid Cz
    Dec 10 '16 at 12:00














4












4








4


3



$begingroup$


I try to write a program to crop background from an image.



This is a sample of my training data.
I have images with and without a background. (manually cropped)



The background is always similar (changes of light and so on. Sometimes people on random places.)



The object is always on the same place but not always the same (there are different models).



Can someone give me an advice how I can solve this Problem?
What is the right way to do something like this???



lern data



Image










share|improve this question











$endgroup$




I try to write a program to crop background from an image.



This is a sample of my training data.
I have images with and without a background. (manually cropped)



The background is always similar (changes of light and so on. Sometimes people on random places.)



The object is always on the same place but not always the same (there are different models).



Can someone give me an advice how I can solve this Problem?
What is the right way to do something like this???



lern data



Image







deep-learning image-classification image-recognition






share|improve this question















share|improve this question













share|improve this question




share|improve this question








edited Aug 30 '17 at 23:02









Stephen Rauch

1,52551330




1,52551330










asked Dec 4 '16 at 18:24









Dawid CzDawid Cz

2314




2314








  • 1




    $begingroup$
    What is the size of your dataset?
    $endgroup$
    – Armen Aghajanyan
    Dec 5 '16 at 7:55










  • $begingroup$
    about 2000 images
    $endgroup$
    – Dawid Cz
    Dec 5 '16 at 7:57






  • 1




    $begingroup$
    Usually, people use a background subtraction technique. The most basic technique is to compute the average frame and then compare against each frame. But there are much more sophisticated techniques. Packages like opencv come with lots of background subtraction implementations.
    $endgroup$
    – Ricardo Cruz
    Dec 8 '16 at 22:30










  • $begingroup$
    That´s what I need. Thx I`ll check it.
    $endgroup$
    – Dawid Cz
    Dec 9 '16 at 7:48










  • $begingroup$
    I have found here something like this stackoverflow.com/questions/17884526/…
    $endgroup$
    – Dawid Cz
    Dec 10 '16 at 12:00














  • 1




    $begingroup$
    What is the size of your dataset?
    $endgroup$
    – Armen Aghajanyan
    Dec 5 '16 at 7:55










  • $begingroup$
    about 2000 images
    $endgroup$
    – Dawid Cz
    Dec 5 '16 at 7:57






  • 1




    $begingroup$
    Usually, people use a background subtraction technique. The most basic technique is to compute the average frame and then compare against each frame. But there are much more sophisticated techniques. Packages like opencv come with lots of background subtraction implementations.
    $endgroup$
    – Ricardo Cruz
    Dec 8 '16 at 22:30










  • $begingroup$
    That´s what I need. Thx I`ll check it.
    $endgroup$
    – Dawid Cz
    Dec 9 '16 at 7:48










  • $begingroup$
    I have found here something like this stackoverflow.com/questions/17884526/…
    $endgroup$
    – Dawid Cz
    Dec 10 '16 at 12:00








1




1




$begingroup$
What is the size of your dataset?
$endgroup$
– Armen Aghajanyan
Dec 5 '16 at 7:55




$begingroup$
What is the size of your dataset?
$endgroup$
– Armen Aghajanyan
Dec 5 '16 at 7:55












$begingroup$
about 2000 images
$endgroup$
– Dawid Cz
Dec 5 '16 at 7:57




$begingroup$
about 2000 images
$endgroup$
– Dawid Cz
Dec 5 '16 at 7:57




1




1




$begingroup$
Usually, people use a background subtraction technique. The most basic technique is to compute the average frame and then compare against each frame. But there are much more sophisticated techniques. Packages like opencv come with lots of background subtraction implementations.
$endgroup$
– Ricardo Cruz
Dec 8 '16 at 22:30




$begingroup$
Usually, people use a background subtraction technique. The most basic technique is to compute the average frame and then compare against each frame. But there are much more sophisticated techniques. Packages like opencv come with lots of background subtraction implementations.
$endgroup$
– Ricardo Cruz
Dec 8 '16 at 22:30












$begingroup$
That´s what I need. Thx I`ll check it.
$endgroup$
– Dawid Cz
Dec 9 '16 at 7:48




$begingroup$
That´s what I need. Thx I`ll check it.
$endgroup$
– Dawid Cz
Dec 9 '16 at 7:48












$begingroup$
I have found here something like this stackoverflow.com/questions/17884526/…
$endgroup$
– Dawid Cz
Dec 10 '16 at 12:00




$begingroup$
I have found here something like this stackoverflow.com/questions/17884526/…
$endgroup$
– Dawid Cz
Dec 10 '16 at 12:00










3 Answers
3






active

oldest

votes


















1












$begingroup$

This is indeed a simple problem if tried to be tackled using semantic segmentation. Semantic segmentation itself is a computer vision problem that could be understood as an extension of object detection and could be understood as follows:



detection and segmentation



Using semantic segmentation done using a network called as UNET, the model could be trained for the required image and then it can be extended to find the boundary of the required object and finally extract it. UNET architecture could be understood using the following diagram:



UNET



UNET's are generally used to create mask that could be XOR with the actual image and the background of the image could be subtracted easily.



Completely explaining image segmentation using UNET or any other technique falls beyond the limit of the answer and thus a better explanation could be found in this article



If you want the practical implementation/codes of the same, they could be found here on kaggle kernels of the following contests:




  1. TGS Salt Identification Challenge

  2. Carvana Image Masking Challenge






share|improve this answer









$endgroup$





















    2












    $begingroup$

    The task you are trying to perform is called semantic segmentation (or pixel-wise segmentation). There exists extensive literature on the subject and numerous tutorials/online resources to get you started, such as this one



    Fully convolutional networks (FCN) popularized the core components of state-of-the-art semantic segmentation techniques. They have since evolved into numerous superior, yet related, networks, many of which are covered in the link above.



    Although the linked website is quite comprehensive, it does not mention mask rcnn, which has performed very well and at relatively fast speeds (~5 fps). It is definitely worth exploring!






    share|improve this answer









    $endgroup$





















      0












      $begingroup$

      You can use fully convolutional neural nets for image segmentation. Check out the kernels in the kaggle competition: Carvana Image Masking Challenge
      .



      Also check out Fully Convolutional Neural Network






      share|improve this answer











      $endgroup$














        Your Answer





        StackExchange.ifUsing("editor", function () {
        return StackExchange.using("mathjaxEditing", function () {
        StackExchange.MarkdownEditor.creationCallbacks.add(function (editor, postfix) {
        StackExchange.mathjaxEditing.prepareWmdForMathJax(editor, postfix, [["$", "$"], ["\\(","\\)"]]);
        });
        });
        }, "mathjax-editing");

        StackExchange.ready(function() {
        var channelOptions = {
        tags: "".split(" "),
        id: "557"
        };
        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: false,
        noModals: true,
        showLowRepImageUploadWarning: true,
        reputationToPostImages: null,
        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%2fdatascience.stackexchange.com%2fquestions%2f15509%2fcrop-background-from-image%23new-answer', 'question_page');
        }
        );

        Post as a guest















        Required, but never shown

























        3 Answers
        3






        active

        oldest

        votes








        3 Answers
        3






        active

        oldest

        votes









        active

        oldest

        votes






        active

        oldest

        votes









        1












        $begingroup$

        This is indeed a simple problem if tried to be tackled using semantic segmentation. Semantic segmentation itself is a computer vision problem that could be understood as an extension of object detection and could be understood as follows:



        detection and segmentation



        Using semantic segmentation done using a network called as UNET, the model could be trained for the required image and then it can be extended to find the boundary of the required object and finally extract it. UNET architecture could be understood using the following diagram:



        UNET



        UNET's are generally used to create mask that could be XOR with the actual image and the background of the image could be subtracted easily.



        Completely explaining image segmentation using UNET or any other technique falls beyond the limit of the answer and thus a better explanation could be found in this article



        If you want the practical implementation/codes of the same, they could be found here on kaggle kernels of the following contests:




        1. TGS Salt Identification Challenge

        2. Carvana Image Masking Challenge






        share|improve this answer









        $endgroup$


















          1












          $begingroup$

          This is indeed a simple problem if tried to be tackled using semantic segmentation. Semantic segmentation itself is a computer vision problem that could be understood as an extension of object detection and could be understood as follows:



          detection and segmentation



          Using semantic segmentation done using a network called as UNET, the model could be trained for the required image and then it can be extended to find the boundary of the required object and finally extract it. UNET architecture could be understood using the following diagram:



          UNET



          UNET's are generally used to create mask that could be XOR with the actual image and the background of the image could be subtracted easily.



          Completely explaining image segmentation using UNET or any other technique falls beyond the limit of the answer and thus a better explanation could be found in this article



          If you want the practical implementation/codes of the same, they could be found here on kaggle kernels of the following contests:




          1. TGS Salt Identification Challenge

          2. Carvana Image Masking Challenge






          share|improve this answer









          $endgroup$
















            1












            1








            1





            $begingroup$

            This is indeed a simple problem if tried to be tackled using semantic segmentation. Semantic segmentation itself is a computer vision problem that could be understood as an extension of object detection and could be understood as follows:



            detection and segmentation



            Using semantic segmentation done using a network called as UNET, the model could be trained for the required image and then it can be extended to find the boundary of the required object and finally extract it. UNET architecture could be understood using the following diagram:



            UNET



            UNET's are generally used to create mask that could be XOR with the actual image and the background of the image could be subtracted easily.



            Completely explaining image segmentation using UNET or any other technique falls beyond the limit of the answer and thus a better explanation could be found in this article



            If you want the practical implementation/codes of the same, they could be found here on kaggle kernels of the following contests:




            1. TGS Salt Identification Challenge

            2. Carvana Image Masking Challenge






            share|improve this answer









            $endgroup$



            This is indeed a simple problem if tried to be tackled using semantic segmentation. Semantic segmentation itself is a computer vision problem that could be understood as an extension of object detection and could be understood as follows:



            detection and segmentation



            Using semantic segmentation done using a network called as UNET, the model could be trained for the required image and then it can be extended to find the boundary of the required object and finally extract it. UNET architecture could be understood using the following diagram:



            UNET



            UNET's are generally used to create mask that could be XOR with the actual image and the background of the image could be subtracted easily.



            Completely explaining image segmentation using UNET or any other technique falls beyond the limit of the answer and thus a better explanation could be found in this article



            If you want the practical implementation/codes of the same, they could be found here on kaggle kernels of the following contests:




            1. TGS Salt Identification Challenge

            2. Carvana Image Masking Challenge







            share|improve this answer












            share|improve this answer



            share|improve this answer










            answered 7 hours ago









            thanatozthanatoz

            569319




            569319























                2












                $begingroup$

                The task you are trying to perform is called semantic segmentation (or pixel-wise segmentation). There exists extensive literature on the subject and numerous tutorials/online resources to get you started, such as this one



                Fully convolutional networks (FCN) popularized the core components of state-of-the-art semantic segmentation techniques. They have since evolved into numerous superior, yet related, networks, many of which are covered in the link above.



                Although the linked website is quite comprehensive, it does not mention mask rcnn, which has performed very well and at relatively fast speeds (~5 fps). It is definitely worth exploring!






                share|improve this answer









                $endgroup$


















                  2












                  $begingroup$

                  The task you are trying to perform is called semantic segmentation (or pixel-wise segmentation). There exists extensive literature on the subject and numerous tutorials/online resources to get you started, such as this one



                  Fully convolutional networks (FCN) popularized the core components of state-of-the-art semantic segmentation techniques. They have since evolved into numerous superior, yet related, networks, many of which are covered in the link above.



                  Although the linked website is quite comprehensive, it does not mention mask rcnn, which has performed very well and at relatively fast speeds (~5 fps). It is definitely worth exploring!






                  share|improve this answer









                  $endgroup$
















                    2












                    2








                    2





                    $begingroup$

                    The task you are trying to perform is called semantic segmentation (or pixel-wise segmentation). There exists extensive literature on the subject and numerous tutorials/online resources to get you started, such as this one



                    Fully convolutional networks (FCN) popularized the core components of state-of-the-art semantic segmentation techniques. They have since evolved into numerous superior, yet related, networks, many of which are covered in the link above.



                    Although the linked website is quite comprehensive, it does not mention mask rcnn, which has performed very well and at relatively fast speeds (~5 fps). It is definitely worth exploring!






                    share|improve this answer









                    $endgroup$



                    The task you are trying to perform is called semantic segmentation (or pixel-wise segmentation). There exists extensive literature on the subject and numerous tutorials/online resources to get you started, such as this one



                    Fully convolutional networks (FCN) popularized the core components of state-of-the-art semantic segmentation techniques. They have since evolved into numerous superior, yet related, networks, many of which are covered in the link above.



                    Although the linked website is quite comprehensive, it does not mention mask rcnn, which has performed very well and at relatively fast speeds (~5 fps). It is definitely worth exploring!







                    share|improve this answer












                    share|improve this answer



                    share|improve this answer










                    answered Apr 20 '18 at 4:24









                    Benji AlbertBenji Albert

                    836314




                    836314























                        0












                        $begingroup$

                        You can use fully convolutional neural nets for image segmentation. Check out the kernels in the kaggle competition: Carvana Image Masking Challenge
                        .



                        Also check out Fully Convolutional Neural Network






                        share|improve this answer











                        $endgroup$


















                          0












                          $begingroup$

                          You can use fully convolutional neural nets for image segmentation. Check out the kernels in the kaggle competition: Carvana Image Masking Challenge
                          .



                          Also check out Fully Convolutional Neural Network






                          share|improve this answer











                          $endgroup$
















                            0












                            0








                            0





                            $begingroup$

                            You can use fully convolutional neural nets for image segmentation. Check out the kernels in the kaggle competition: Carvana Image Masking Challenge
                            .



                            Also check out Fully Convolutional Neural Network






                            share|improve this answer











                            $endgroup$



                            You can use fully convolutional neural nets for image segmentation. Check out the kernels in the kaggle competition: Carvana Image Masking Challenge
                            .



                            Also check out Fully Convolutional Neural Network







                            share|improve this answer














                            share|improve this answer



                            share|improve this answer








                            edited Dec 29 '17 at 2:54









                            Stephen Rauch

                            1,52551330




                            1,52551330










                            answered Aug 30 '17 at 22:08









                            Rahul ChandnaniRahul Chandnani

                            1




                            1






























                                draft saved

                                draft discarded




















































                                Thanks for contributing an answer to Data Science Stack Exchange!


                                • 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.


                                Use MathJax to format equations. MathJax reference.


                                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%2fdatascience.stackexchange.com%2fquestions%2f15509%2fcrop-background-from-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

                                Callistus I

                                Tabula Rosettana

                                How to label and detect the document text images