OpenCV Python Tutorial For Beginners 22 - Image Blending using Pyramids in OpenCV

Поділитися
Вставка
  • Опубліковано 20 січ 2025

КОМЕНТАРІ • 67

  • @CoolDude911
    @CoolDude911 5 років тому +7

    I could not find the images you were using or the previous video you were talking about. I ended up blending the annoying orange and the Andy apple together and now I will have nightmares for a week. Well done.

    • @kumarabhishek5652
      @kumarabhishek5652 4 роки тому

      @@M1122-s3g what does this error mean?
      laplacian = cv2.subtract(gp_apple[i-1], gaussian_expanded)
      error: OpenCV(4.2.0) C:\projects\opencv-python\opencv\modules\core\src\arithm.cpp:669: error: (-209:Sizes of input arguments do not match) The operation is neither 'array op array' (where arrays have the same size and the same number of channels), nor 'array op scalar', nor 'scalar op array' in function 'cv::arithm_op'

    • @shashankkesharwani9827
      @shashankkesharwani9827 4 роки тому

      @@kumarabhishek5652 same error, did you found out the solution for it?

    • @tejasvigupta07
      @tejasvigupta07 4 роки тому

      @@kumarabhishek5652 me too same error

    • @lomgames7686
      @lomgames7686 4 роки тому

      @@kumarabhishek5652 look at this
      stackoverflow.com/questions/32970397/opencv-errorsizes-of-input-arguments-do-not-match
      This help me in previous video

    • @abdultaufiq2237
      @abdultaufiq2237 4 роки тому

      @@kumarabhishek5652 resize the both image into same np. of rows and columns. i.e no. of rows and columns for both the images should be same eg ( 512, 512, 3 ) for both the images

  • @liammy5899
    @liammy5899 2 роки тому +2

    Correct me if I'm wrong but I believe there are 7 elements in the gp_apple list:
    [apple_copy (index 0), pyrdownimg1(index 1), pyrdownimg2(index 2), pyrdownimg3(index 3), pyrdownimg4 (index 4), pyrdownimg5 (index 5), pyrdownimg6 (index 6)]
    So when creating the laplacian pyramids, why do you start from the 6th image (index 5) of the gaussian pyramid when there is another smaller pyrDown image at index 6? I'm just trying to understand the point of creating this last image if it is not used? Was this done on purpose for some reason or is it just a mistake?

  • @shawnarmstrong3339
    @shawnarmstrong3339 3 роки тому +1

    It's good to know that taking Calculus 3 and Differential Equations had something to do with programming.

  • @MarcosGarcia-mc8oj
    @MarcosGarcia-mc8oj Рік тому

    worked great, thank you!

  • @hieupham-ff6kw
    @hieupham-ff6kw 5 років тому +3

    You should add the Notice when our image has odd shape.(like 255x255). Caused in this case, you can not create laplacian pyramid due to diffrent shapes of 2 images.

  • @namdang540
    @namdang540 4 роки тому

    Great concepts. Thank you!

  • @PardeepSingh-wn2vy
    @PardeepSingh-wn2vy 5 років тому

    You're the best.

  • @kartiksolanki9390
    @kartiksolanki9390 Рік тому +1

    how to download used imaegs in this video?

  • @leef918
    @leef918 4 роки тому

    nice ,simplest tutorial.

  • @umutcoskun4247
    @umutcoskun4247 5 років тому +1

    Very nice, but I feel like you could just do smoothing filter on the middle between those two halves.

  • @kartikeysingh5781
    @kartikeysingh5781 Рік тому

    thank you, it was useful

  • @M1122-s3g
    @M1122-s3g 4 роки тому +1

    @ProgrammingKnowledge
    Excuse me , sir , where can i find the image you used in the video?

  • @womenfitness_helper
    @womenfitness_helper 2 роки тому

    Sir can we blend an image with a vdo of same size

  • @abdielribeiro2955
    @abdielribeiro2955 4 роки тому +2

    solution to the problem: "error: OpenCV(4.2.0) C:\projects\opencv-python\opencv\modules\core\src\arithm.cpp:669: error: (-209:Sizes of input arguments do not match) The operation is neither 'array op array' (where arrays have the same size and the same number of channels), nor 'array op scalar', nor 'scalar op array' in function 'cv::arithm_op'"
    use some online tool to resize the image (iloveimg.com) and place both images in 512 x 512 resolution, it worked for me.

  • @rajandas7676
    @rajandas7676 4 роки тому

    Traceback (most recent call last):
    File "c:/Users/Rajan Das/Desktop/Goutam Das/Programs/Python/opencv/LR.py", line 10, in
    img1_img2=np.hstack(img1[:, :128], img2[:, 128:])
    File "", line 4, in hstack
    TypeError: _vhstack_dispatcher() takes 1 positional argument but 2 were given
    This error is shown for my program. What have to do to solve this error?

    • @flo7968
      @flo7968 3 роки тому

      I'm late but I'll answer anyway. The two arrays passed to np.hstack have to be in a Tuple. So instead of img1[:, :128], img2[:, 128:] it has to be (img1[:, :128], img2[:, 128:])

  • @mdmynuddin1888
    @mdmynuddin1888 2 роки тому

    How can i get the images

  • @razi_official
    @razi_official 4 роки тому

    Hello Sir!
    I amgetting error in this code:
    ">> cols, rows, ch = apple_lap.shape
    AttributeError: 'list' object has no attribute 'shape'
    ".
    can you help me to remove this error?
    i would be very thankful of you.

  • @anjaliverma3518
    @anjaliverma3518 4 роки тому

    Sir what if the size of image is not same i mean suppose if size of one image is 693,693 and other is 2136,2136

    • @abdultaufiq2237
      @abdultaufiq2237 4 роки тому

      you will not be able to stack the images

    • @ankitchaubey1293
      @ankitchaubey1293 3 роки тому

      Scale the image by a factor which is common for both

  • @lutfianovitasari5001
    @lutfianovitasari5001 4 роки тому

    Why I've got error in the
    laplacian = cv2.subtract(gp_apple[i-1], gaussian_expanded)
    Somebody please help

    • @derkertherblack6177
      @derkertherblack6177 4 роки тому

      It is probably because of the size of the image you use, I had the same problem and I changed the image to a 512x512 image

  • @shrutishrestha8296
    @shrutishrestha8296 4 роки тому

    what is the use of that "n" variable?

    • @abdultaufiq2237
      @abdultaufiq2237 4 роки тому

      he don't know , because entire code and entire sentence which he spoke is copied from opencv documentation. To be honest he also don't know what the code is saying

  • @shashanksharmadon4295
    @shashanksharmadon4295 5 років тому

    thanks bro.....

  • @manilambardar3163
    @manilambardar3163 4 роки тому

    Bro u did not mentioned about even rows correction after pyrDown

  • @shahrahul1148
    @shahrahul1148 5 років тому

    You did blending but in only one way. what if I want to use a mask for a different type of blending

  • @karishmatyagi3585
    @karishmatyagi3585 4 роки тому

    Error while reconstructing the image. Error in pyrUp function.
    Can some one help me out with this.

    • @amazingroovy7292
      @amazingroovy7292 4 роки тому

      Try to copy and paste a code piece here. This way probably somebody would be able to help you...

    • @MakarKondratev-q9g
      @MakarKondratev-q9g 4 роки тому

      As it was said earlier by hieu pham, if you pyrUp an image which was of odd shape earlier, you loose some pixels and operation ends with error.
      For example if you have a (3, 3) image and scale it down, it'll be (1, 1), but if you'll scale it up again it will be of shape (2, 2).

    • @jayshimpi1278
      @jayshimpi1278 3 роки тому

      try these,
      gaussian_extended = cv2.pyrUp(gp[i],dstsize = (gp[i - 1].shape[1], gp[i - 1].shape[0])),
      I guess the issue is in mismatch size of images, I hope this solves out the error

  • @mohdyusuftutorial2452
    @mohdyusuftutorial2452 4 роки тому

    i am getting error in the last for loop second line

  • @daniyaniazics
    @daniyaniazics 4 роки тому +3

    Didn't understand anything 😭 someone please recommend me a good thoery based opencv course

    • @mrshevshevchenko3917
      @mrshevshevchenko3917 4 роки тому

      Google it. It should help.

    • @ezzghalibtomizi6837
      @ezzghalibtomizi6837 4 роки тому

      I wrote the same code but it didn't work, when I copied his code and pasted it work :)

    • @razi_official
      @razi_official 4 роки тому +1

      @@ezzghalibtomizi6837 same issue i have. i was getting error when i wrote code by myself. this error resolved when i copy this code... :P dont know why? :)

    • @nandalal133
      @nandalal133 4 роки тому

      It was easy
      If you followed tutorials from tutorial 1
      and you need to have basic knowledge on numpy and matplotlib library.
      : )

    • @ezzghalibtomizi6837
      @ezzghalibtomizi6837 4 роки тому

      @@razi_official Magic 😂

  • @nyasingajeff1789
    @nyasingajeff1789 4 роки тому

    cv2.error: OpenCV(4.3.0) C:\projects\opencv-python\opencv\modules\core\src\arithm.cpp:669: error: (-209:Sizes of input arguments do not match) The operation is neither 'array op array' (where arrays have the same size and the same number of channels), nor 'array op scalar', nor 'scalar op array' in function 'cv::arithm_op' -- WTF is this error

    • @abdielribeiro2955
      @abdielribeiro2955 4 роки тому

      use some online tool to resize the image (iloveimg.com) and place both images in 512 x 512 resolution, it worked for me

    • @ElcachorroYT
      @ElcachorroYT 4 роки тому

      @@abdielribeiro2955 can u share ur code?

  • @kevinpeter770
    @kevinpeter770 5 років тому

    how can i execute this code in linux

    • @theneongamer4957
      @theneongamer4957 5 років тому

      Download PyCharm. Download OpenCV. Import openCV by typing import cv2. Finally just type the code

    • @sisplani
      @sisplani 4 роки тому

      the steps are in the begining of the tutorials

  • @PeterH1900
    @PeterH1900 5 років тому

    Hi,
    There is also an cv2.Laplacian function.
    Could you have used this too?

    • @abdultaufiq2237
      @abdultaufiq2237 4 роки тому

      that one is to finding the edges in an image

  • @chitti1120
    @chitti1120 5 років тому +5

    photoshop but in python

  • @sushrutkenkre105
    @sushrutkenkre105 Рік тому

    Don't understand the use of n here!

  • @proturguenev1820
    @proturguenev1820 4 роки тому +3

    I have an orange, I have a apple
    Uh
    Orange-Apple

  • @snowflakes003
    @snowflakes003 4 роки тому

    tough!

  • @RiRi-jh5pf
    @RiRi-jh5pf 4 роки тому

    very tough