So im working on my game and i want to detect colors in the background of the game so the player won't get into the black surface, but my problem is that im very new to pygame and cv2 and i have no idea if i can combine them and use the cv2. imread as my background for my game... i tried to do some reasearch but i think i would need some help. In the first lines there is some color detecting from the picture but as i said thats not exactly what i wanted and it shows in 2 different windows. I'm sorry if i spelled anything wrong but english isn't my first language.
i tried to put the cv2.imread photo as ground.surf but it didn't work because of different types of files. Also i tried to check if the x and y of my character with the colors but it kind of did n't worked out.