Spot the Differences with Python and OpenCV

Поделиться
HTML-код
  • Опубликовано: 14 окт 2024
  • #Python #Opencv #Contours
    Spot the differences between two images using Python and OpenCV.
    Music: www.bensound.com
    Photos by Pexels (www.pexels.com/ ):
    1. Travel Photography (www.pexels.com...)
    2. Fede Roveda (www.pexels.com...)
    3. Florencia Potter (www.pexels.com...)

Комментарии • 32

  • @farialmahbub5922
    @farialmahbub5922 Год назад +1

    Great video! Very helpful, thanks so much!

  • @joakimegelinesse8548
    @joakimegelinesse8548 5 месяцев назад

    Hello!
    Great video!
    I have a project where i need to detect if some object are missing from a product we make before we assemble the unit.
    Is it possible to have a master image (how the product look with all parts assembled) and then a camera filming every product at the end of the production line to make sure all parts are assempled and then give live feedback if there is any parts missing?😊

    • @kostast
      @kostast  5 месяцев назад

      Hello,
      I think for your project you may need to change the code so tha it can accept video feed instead of simple image. Also you may need to make an image capture inside the video feed for each product always with same dimensions.

    • @kostast
      @kostast  5 месяцев назад

      This may need a lot of changes on the code and a fixed camera position with keyboard capture handling

  • @hiennguyenvan-z6r
    @hiennguyenvan-z6r Месяц назад

    Very nice, I followed the error message like this:if cv2.contowrArea(contours) >10:
    ------
    AttributeError: module 'cv2' has no attribute 'contowrArea'

    • @kostast
      @kostast  Месяц назад

      @@hiennguyenvan-z6r Hello, based on the error you have misspelled the cv2.contourArea. You have contowr instead of contour.

    • @hiennguyenvan-z6r
      @hiennguyenvan-z6r Месяц назад +1

      ok,thank you​@@kostast

  • @zihaozhang1312
    @zihaozhang1312 Год назад +1

    really nice turorial, Thank you

  • @abirganguly2626
    @abirganguly2626 7 месяцев назад +1

    Sir you are a genius. However, this code is old. Does not work now

    • @kostast
      @kostast  7 месяцев назад

      Thank you !

  • @GSK-Tech
    @GSK-Tech Год назад

    nice Video, one more thing : if i want to read if there's any text inside Red Boxes then how i can read it in Loop ?

    • @kostast
      @kostast  Год назад

      Hello, you are reffering to Text Detection. I haven't work with this very much. You will probably need to use both OpenCV and OCR (Optical Character Recognition). I make a note to look at it in the near future and maybe make a video about it.

  • @siddharthrana512
    @siddharthrana512 Год назад

    how to do this on a handing food items on hook in grocery shops

  • @kevinchen960
    @kevinchen960 Год назад

    sorry to bother you. Why my picture window appear in the whole gray and keep runing. It can't show up correctly.

    • @kostast
      @kostast  Год назад +1

      Hello kevin chen,
      Use gray image only to find the diff and then use diff to find threshold on so on. Also use the correct image when displaying the result. Please provide more info if necessary.

  • @andrison8432
    @andrison8432 2 года назад

    nice tutorial sir, any idea how to compare if our second object has slight rotation/movement

    • @kostast
      @kostast  Год назад

      Hello, I am going to check it out and return with a possible solution.

  • @prismtextile
    @prismtextile Год назад

    Can i do same thing with c#. can you help me out for the same

    • @kostast
      @kostast  Год назад

      Sorry but I am not familiar with C#. I believe that you can find online similar code steps or you could compare Python and C# corresponding commands.

    • @prismtextile
      @prismtextile Год назад

      @@kostast thank you so much

  • @scidem7724
    @scidem7724 2 года назад

    How can we do with different picture sizes?

    • @kostast
      @kostast  2 года назад +1

      Hello S Cidem,
      In this code the second image is duplicate of the first one (same dimensions) with some extra differences. If you try to resize the second image (even if it's duplicate) to different shape values (width, height) with some image editor the result will be the same because we are resizing both initial and duplicate images.
      If we skip the resizing part we will get an error : "Sizes of input arguments do not match".

  • @sudhanshuranjan-6062
    @sudhanshuranjan-6062 Год назад

    can you plzz provide link of code

    • @kostast
      @kostast  Год назад

      Hello, the full code is inside the video showing step by step exactly what is doing each line of code. If you follow the steps and write a similar Python script you will understand the logic and have a fully functional code.

  • @RaghadMohamed-i4n
    @RaghadMohamed-i4n 11 месяцев назад

    hello
    what IDE is this

    • @kostast
      @kostast  11 месяцев назад

      Hello, it's IDLE (docs.python.org/3.10/library/idle.html)

  • @navaneethakrishnan4967
    @navaneethakrishnan4967 2 года назад

    How to handle image with different resolutions

    • @kostast
      @kostast  2 года назад +1

      Hello Navaneetha Krishnan ,
      Image resolution is about the detail on an image (pixel count). Usually DPI or PPI (pixel per inch) is used as measuring unit for image resolution. The bigger the ppi of an image the better it's quality.
      In this video we are having two images of same dimensions 600x360 (in order to compare them). Taking the first image as default and create a copy of it with some editing in order to have differences. So after the copy the ppi will be the same (72 ppi in this example).
      You can try to compare two images of different resolution and you'll see that their level of similarity is really low.

    • @kostast
      @kostast  2 года назад +1

      Check also that you may have to use structural_similarity from skimage.metrics instead of compare_ssim depending on scikit-image version.

  • @merwinmaddy6909
    @merwinmaddy6909 5 месяцев назад

    Source code ?

    • @kostast
      @kostast  5 месяцев назад

      Hello, the fully functional code is presented through the steps mentioned in the video.