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.
@@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'
@@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
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?
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.
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.
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?
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:])
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.
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
@@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? :)
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).
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
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
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.
@@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'
@@kumarabhishek5652 same error, did you found out the solution for it?
@@kumarabhishek5652 me too same error
@@kumarabhishek5652 look at this
stackoverflow.com/questions/32970397/opencv-errorsizes-of-input-arguments-do-not-match
This help me in previous video
@@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
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?
It's good to know that taking Calculus 3 and Differential Equations had something to do with programming.
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.
can't you just resize your images?
worked great, thank you!
thank you, it was useful
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.
Very nice, but I feel like you could just do smoothing filter on the middle between those two halves.
Great concepts. Thank you!
@ProgrammingKnowledge
Excuse me , sir , where can i find the image you used in the video?
Watch the 3rd video
nice ,simplest tutorial.
how to download used imaegs in this video?
You're the best.
Sir can we blend an image with a vdo of same size
thanks bro.....
Bro u did not mentioned about even rows correction after pyrDown
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?
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:])
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.
convert it into numpy
photoshop but in python
How can i get the images
You did blending but in only one way. what if I want to use a mask for a different type of blending
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
you will not be able to stack the images
Scale the image by a factor which is common for both
what is the use of that "n" variable?
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
Why I've got error in the
laplacian = cv2.subtract(gp_apple[i-1], gaussian_expanded)
Somebody please help
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
I have an orange, I have a apple
Uh
Orange-Apple
Didn't understand anything 😭 someone please recommend me a good thoery based opencv course
Google it. It should help.
I wrote the same code but it didn't work, when I copied his code and pasted it work :)
@@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? :)
It was easy
If you followed tutorials from tutorial 1
and you need to have basic knowledge on numpy and matplotlib library.
: )
@@razi_official Magic 😂
i am getting error in the last for loop second line
@Grant Fox thank you
Error while reconstructing the image. Error in pyrUp function.
Can some one help me out with this.
Try to copy and paste a code piece here. This way probably somebody would be able to help you...
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).
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
Hi,
There is also an cv2.Laplacian function.
Could you have used this too?
that one is to finding the edges in an image
tough!
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
use some online tool to resize the image (iloveimg.com) and place both images in 512 x 512 resolution, it worked for me
@@abdielribeiro2955 can u share ur code?
how can i execute this code in linux
Download PyCharm. Download OpenCV. Import openCV by typing import cv2. Finally just type the code
the steps are in the begining of the tutorials
Don't understand the use of n here!
very tough