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

Поделиться
HTML-код
  • Опубликовано: 15 ноя 2024

Комментарии • 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

    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.

  • @hieupham-ff6kw
    @hieupham-ff6kw 4 года назад +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.

  • @MarcosGarcia-mc8oj
    @MarcosGarcia-mc8oj Год назад

    worked great, thank you!

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

    thank you, it was useful

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

  • @umutcoskun4247
    @umutcoskun4247 5 лет назад +1

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

  • @namdang540
    @namdang540 4 года назад

    Great concepts. Thank you!

  • @M1122-s3g
    @M1122-s3g 4 года назад +1

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

  • @leef918
    @leef918 4 года назад

    nice ,simplest tutorial.

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

    how to download used imaegs in this video?

  • @PardeepSingh-wn2vy
    @PardeepSingh-wn2vy 5 лет назад

    You're the best.

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

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

  • @shashanksharmadon4295
    @shashanksharmadon4295 4 года назад

    thanks bro.....

  • @manilambardar3163
    @manilambardar3163 4 года назад

    Bro u did not mentioned about even rows correction after pyrDown

  • @rajandas7676
    @rajandas7676 3 года назад

    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:])

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

  • @chitti1120
    @chitti1120 5 лет назад +5

    photoshop but in python

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

    How can i get the images

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

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

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

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

  • @proturguenev1820
    @proturguenev1820 4 года назад +3

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

  • @danianiazi8229
    @danianiazi8229 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 😂

  • @mohdyusuftutorial2452
    @mohdyusuftutorial2452 4 года назад

    i am getting error in the last for loop second line

  • @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 2 года назад

      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

  • @PeterH1900
    @PeterH1900 4 года назад

    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

  • @snowflakes003
    @snowflakes003 4 года назад

    tough!

  • @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 4 года назад

    how can i execute this code in linux

    • @theneongamer4957
      @theneongamer4957 4 года назад

      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

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

    Don't understand the use of n here!

  • @RiRi-jh5pf
    @RiRi-jh5pf 4 года назад

    very tough