OpenCV Python Tutorial For Beginners 11- Bitwise Operations (bitwise AND, OR, NOT and XOR)

preview_player
Показать описание
In this video on OpenCV Python Tutorial For Beginners, I am going to show How to perform Bitwise Operations on Images. This includes bitwise AND, OR, NOT and XOR operations. So we will see How to use Bitwise Operators (bitwise_and, bitwise_or, bitwise_xor, bitwise_not) in an image in OpenCV. Bitwise operations likebitwise_and(), bitwise_or(), bitwise_xor(), and bitwise_not() are
useful when working with masks

OpenCV is an image processing library created by Intel and later supported by Willow Garage and now maintained by Itseez. opencv is available on Mac, Windows, Linux. Works in C, C++, and Python.
it is Open Source and free. opencv is easy to use and install.

Starting with an overview of what the course will be covering, we move on to discussing morphological operations and practically learn how they work on images. We will then learn contrast enhancement using equalization and contrast limiting. Finally we will learn 3 methods to subtract the background from the video and implement them using OpenCV.

At the end of this course, you will have a firm grasp of Computer Vision techniques using OpenCV libraries. This course will be your gateway to the world of data science.

Feel the real power of Python and programming! The course offers you a unique approach of learning how to code by solving real world problems.

#ProgrammingKnowledge #ComputerVision #OpenCV
★★★Top Online Courses From ProgrammingKnowledge ★★★

★★★ Online Courses to learn ★★★

★★★ Follow ★★★

DISCLAIMER: This video and description contains affiliate links, which means that if you click on one of the product links, I’ll receive a small commission. This help support the channel and allows us to continue to make videos like this. Thank you for the support!
Рекомендации по теме
Комментарии
Автор

image1_png is not included in the sample data from Github, so I made my own. You can download it here:

JuanCarlos
Автор

code to generate img2

img2 = np.full((250, 500, 3), 255, dtype=np.uint8)
img2 = cv2.rectangle(img2, (0, 0), (250, 250), (0, 0, 0), -1)

sonamdhingra
Автор

it would be nice to include the images that you use along with the code on Github

AngelTaylorgang
Автор

What is the possible use case of bitwise operation in images?

parishilanrayamajhi
Автор

what is this used for? Why would we need such operations with images? They must be useful for something. but what is that exactly?

code-wise
Автор

I have a question!!!
I wrote the following code:


import cv2
import numpy as np

img1 = np.zeros((250, 500, 3), np.uint8)
img2 = cv2.rectangle(img1, (200, 0), (300, 100), (255, 255, 255), -1)

cv2.imshow("img1", img1)
cv2.imshow("img2", img2)
cv2.waitKey(0)
cv2.destroyAllWindows()


When I execute it, it shows both images as they were the same, as the expectation was the first img only black and the second img with a white square. I am using the Visual Studio.
Any idea why it is happening?

gustavoghedim
Автор

What are the minimum technical specifications for a computer needed to work with computer vision?

aidenstill
Автор

Sir please can I explain this bitwise operations on coloured images using truth table because I tried it with coloured images I got the output but still it explanation is beyond my reach ..please exapin its working on coloured images as well...

simplethoughtsvaishnavi
Автор

this is black and white image so itls give result for for black =0 and white=1 ....it;s working perfacct but what if image is color then it's rare chance that two same pixxel match,

rajushingadiya
Автор

I have a question, where can I find the images utilized throughout the videos?

nelsonalvarez
Автор

File "C:/Users/User1/Downloads/opencv/chapter5.py", line 17, in <module>
bitAnd = cv2.bitwise_and(img1, img2)
cv2.error: OpenCV(4.2.0) error: (-209:Sizes of input arguments do not match) The operation is neither 'array op array' (where arrays have the same size and type), nor 'array op scalar', nor 'scalar op array' in function 'cv::binary_op'

lakshmitejaswi
Автор

I am not getting the dst as shown though i am writing the same code

rahulsai
Автор

I get a very small window as output . How shall I resolve this problem

smritipradhan
Автор

is bitwise operation only aplicable to black and white images

punitchoudhary
Автор

i canot find this image_1.png in opencv file

vedantkirve