Color Filtering - OpenCV with Python for Image and Video Analysis 7

Color Filtering - OpenCV with Python for Image and Video Analysis 7

sentdex

8 лет назад

166,747 Просмотров

Ссылки и html тэги не поддерживаются


Комментарии:

@JohnDoe-xm1nw
@JohnDoe-xm1nw - 06.11.2021 16:19

HSV values cannot be more than 100 for S and V.
I don't understand this notation. How can i create a range for my own color? For example i want a range for blue.

Ответить
@tharinduheshan8717
@tharinduheshan8717 - 22.04.2021 22:42

Is it possible to use python using a point cloud to extract only the road from the colors on both sides of the road (if there is a plantation like grass)?

Ответить
@jdsingh3607
@jdsingh3607 - 29.03.2021 11:31

can i like display the mask onto a jpg image ?

Ответить
@franklynxavier5643
@franklynxavier5643 - 22.10.2020 09:13

Check this course for an in-depth explanation of OpenCV from beginner to advanced: ​@9M38​

Ответить
@bejaminog6237
@bejaminog6237 - 17.10.2020 23:36

code ?

Ответить
@shankarjadhav1985
@shankarjadhav1985 - 15.10.2020 16:27

Use this for better red masking
lower_red = np.array([0,70,50])
upper_red = np.array([10,255,255])

Ответить
@belalyahya6338
@belalyahya6338 - 09.10.2020 08:00

i believe that it would be much easier if you use "Trackbars" instead of running the code many times.

Ответить
@trumpdonaldcoin
@trumpdonaldcoin - 04.09.2020 17:30

I found this by searching ''whoops you have to put the cd in your computer''

Ответить
@simonzh3903
@simonzh3903 - 23.03.2020 06:19

I'think adjust value of mask by trackbars is a much better way.

Ответить
@computerhousepc7366
@computerhousepc7366 - 05.02.2020 13:41

Adam klavyeye bakmiyor ya adam sin adam

Ответить
@poojakashikar6544
@poojakashikar6544 - 06.12.2019 15:05

how can I change the colour of different part in same image,without disturbing the structure and rendering using any language that is either client side or server side.can u help me?

Ответить
@enesdemirkaya3622
@enesdemirkaya3622 - 20.11.2019 00:25

How can i get mean of the result so i can get how red is the hat? thanks for the videos

Ответить
@arni2343
@arni2343 - 03.11.2019 16:37

now I want a "Make computer vision great again!" hat

Ответить
@satviknema8629
@satviknema8629 - 23.07.2019 10:14

the value in HSV cannot be greater than 100 right? The V attribute tell how much the white light is ixed into the color. 100 means the color will be bright. 0 means it will be more like black

Ответить
@danielgn6227
@danielgn6227 - 15.05.2019 10:30

Just a quick note if you are as bad as me understanding color spaces:
Searching "opencv color picker" brought me to a couple of opencv scripts on GitHub that find the lower and upper values of any color by clicking a couple times the desired color on the image

Ответить
@kartiksharma6625
@kartiksharma6625 - 13.05.2019 19:28

My program is showing attribute error: module 'cv2.cv2' has no attribute'cvtcolor' please help me out

Ответить
@nandankashyapTeaTThinking
@nandankashyapTeaTThinking - 10.05.2019 10:08

I have tried everything as it is but its not working for me. Can you help me out.

Ответить
@MuhittinKaplan
@MuhittinKaplan - 20.04.2019 20:59

Thanks Foll All

Ответить
@utkarsharevanur
@utkarsharevanur - 11.04.2019 09:10

Is there any algorithm for feature detection and matching , which considers the colors of the images.

Ответить
@abhigyannath1134
@abhigyannath1134 - 10.03.2019 21:59

I have this error
C:\Miniconda3\conda-bld\opencv-suite_1533128839831\work\modules\imgproc\src\color.cpp:11214: error: (-215) (scn == 3 || scn == 4) && (depth == 0 || depth == 5) in function cv::cvtColor


how to go about it?

Ответить
@PapaYosif
@PapaYosif - 07.03.2019 18:45

so how do i run code when the color is detected?

Ответить
@tronstinkt5651
@tronstinkt5651 - 24.02.2019 15:49

Module 'cv2' has no 'COLOR_RGB2HSV' member

Ответить
@achrafhamal7128
@achrafhamal7128 - 23.02.2019 21:25

Adding a backtrack is so useful to adjust the colors in real time

Ответить
@sheharyarkhan5852
@sheharyarkhan5852 - 13.02.2019 14:37

Hey there mate
I actually want to detect a rgb trio and sort it by means of a servo
Plz send me some codings...

Ответить
@erkamkocaer2097
@erkamkocaer2097 - 06.02.2019 15:59

how can we change the color? ı didnt understand that . what if ı want make this with blue , how can i write code ?

Ответить
@hexhackbangla8368
@hexhackbangla8368 - 01.02.2019 12:49

i never enjoyed programming before watching your video..

Ответить
@I3LaCkPeArL
@I3LaCkPeArL - 03.01.2019 00:43

Hey, I really like your videos. They help me a lot. What steps would you suggest, when trying to create a "building" recognition for ONE building? It should be able to detect parts of, so you can highlight lets say rooms from the outside.

Ответить
@jhunmichaelaballa535
@jhunmichaelaballa535 - 23.10.2018 18:51

What if you are using a kinect sensor? How can I interface it with that code? Thanks a lot

Ответить
@indiansoftwareengineer4899
@indiansoftwareengineer4899 - 02.10.2018 13:55

how can I detect hand/ skin color instead of red color of hat?
what values should I give in lower_red and upper_red?
here?
lower_red = np.array([150,50,50])
upper_red = np.array([180,255,255])

Ответить
@shikharagrawal1797
@shikharagrawal1797 - 29.09.2018 08:32

Is there any reason why you wrote k==27 ?

Ответить
@shikharagrawal1797
@shikharagrawal1797 - 29.09.2018 08:30

waitKey(0) doesn't display video. It displays a fixed image. The first image captured on the webcam.

Ответить
@shoebmoin10
@shoebmoin10 - 05.09.2018 21:38

𝐌𝐚𝐧𝐲 𝐩𝐞𝐨𝐩𝐥𝐞 𝐡𝐚𝐯𝐞 𝐝𝐨𝐮𝐛𝐭 𝐢𝐧 𝐭𝐡𝐢𝐬 𝐜𝐨𝐝𝐞:
𝐤 = 𝐜𝐯𝟐.𝐰𝐚𝐢𝐭𝐊𝐞𝐲(𝟓) & 𝟎𝐱𝐅𝐅
𝐢𝐟 𝐤 == 𝟐𝟕:
𝐛𝐫𝐞𝐚𝐤

𝟏. In cv2.waitKey(x) the parameter x indicates the delay in the frame display i.e a new frame is displayed in our video feed after x seconds (try keeping it 1000 to check the difference,1fps ).

𝟐. cv2.waitkey() returns the key pressed on the keyboard, according to the code above if ASCII value of that key is 27(ESC key) then we are breaking out of the loop.

𝟑. Now the 0xFF is a hexadecimal number = 255 which in binary is equal to 1111111 so doing a '&' Operation means we only care about the last 7 bits of the ASCII value returned.

Ответить
@aladdinalhaffar9187
@aladdinalhaffar9187 - 04.09.2018 23:25

Thx for the efforts and I have two questions :
1 - what are the details of
k = cv2.waitKey(5) & 0xFF
if k == 27:
break
and thier use
2 - how can we end the while loop and get destroy all windows to be executed

Ответить
@anthol4736
@anthol4736 - 17.08.2018 19:56

hi, i've got a problem, do you use the picamera to do this? because with my USB camera the pixel format is not 'BGR'

Ответить
@aardvarrock9657
@aardvarrock9657 - 25.07.2018 23:52

I've been wracking my brains around how these color masks work all day, thanks!

Ответить
@aayushsingh9622
@aayushsingh9622 - 24.07.2018 13:15

what is the range of sat and val in opencv ?

is the usual range in (0-100%)?

Ответить
@mahmmdalhrbiy4968
@mahmmdalhrbiy4968 - 19.07.2018 18:43

hsv = cv2.cvtColor(frame, cv2.COLOR_BGR2HSV)
error: ..\..\..\modules\imgproc\src\color.cpp:3961: error: (-215) (scn == 3 || scn == 4) && (depth == CV_8U || depth == CV_32F) in function cv::cvtColor

Ответить
@16rongon
@16rongon - 12.07.2018 18:42

What does waitKey(5) do?

Ответить
@ddtkhoa7766
@ddtkhoa7766 - 08.07.2018 06:30

I don't know how to determine lower and higher HSV array?

Ответить
@tristanshah9716
@tristanshah9716 - 12.06.2018 21:54

why do you need the underscore in this line? _, frame = cap.read()

Ответить
@theycallmemorphine
@theycallmemorphine - 11.06.2018 20:38

Just to add some more..... Red lies in a region where we cant define using single numpy-array/mask. So, I've done this!
## only for red -30 to 0 and 0 to 30 - 2masks
lower_red = np.array([150,50,50])
upper_red = np.array([180,255,255])
mask1 = cv2.inRange(hsv_version, lower_red, upper_red)

lower_red = np.array([0,50,50])
upper_red = np.array([30,255,255])
mask2 = cv2.inRange(hsv_version, lower_red, upper_red)
mask = cv2.bitwise_or(mask1,mask2)
res = cv2.bitwise_and(frame, frame, mask=mask)

Ответить
@TheXT550
@TheXT550 - 11.06.2018 12:45

Hey sentdex, Guys and Girls,

i want to recognize a color, and if it is recognized i want to count it or give it a value for example (red = 50, Black = 20).

if red or black was recognized I should be issued the number.

any Idea ????

need help :-)

Ответить
@vaibhavchhabra800
@vaibhavchhabra800 - 13.05.2018 21:26

Please explain in a bit more detail otherwise Awesome video

Ответить
@johnmicohalvarez6890
@johnmicohalvarez6890 - 06.03.2018 17:14

what camera did you use for this project?

Ответить
@speckkie9397
@speckkie9397 - 04.03.2018 12:49

So if I am using a video, python speeds up the video to about 3x or 4x the original speed. Can I slow that down somehow? Didn't find anything in the opencv documentation at first glance.

Ответить
@athirasoman7701
@athirasoman7701 - 27.02.2018 12:53

This is a good tutorial.But I need to mask green pixels .So can you pls mention the green color's upper bound and lower bound?

Ответить