8월, 2021의 게시물 표시

Change image background

이미지
 In order to change the image background, it is important to distinguish the boundary between the person and the background well.  In YouTube broadcasting and TV broadcasting, the chroma key technique is used to accurately distinguish the boundary between the person and the background. Background removal using chroma key A chroma key is a technique used in film, video and still photography to replace a portion of an image with a new image. This is most commonly used to replaced a coloured background with a different setting.  The background color used for chroma key is usually blue or green. Persons who appear in the background of Chromakey must not wear clothes of the same color as Chromakey. If possible, wear complementary colors to accurately distinguish the boundary. <Chromakey example> Change chroma key photo background in OpenCV This task is very easy. For chroma key photos, the boundary line can be distinguished fairly accurately only with the OpenCV function. Convert chro

Image Processing #12 - Detecting the center of text or curved line

이미지
 There are times when you need information about the center line of text or curved parts of an image. I'm making a drawing robot these days. After the robot drew the picture, I needed this method to sign it. If the center line pixel location information of the signature image is grasped, the robot can naturally sign by drawing a pen while passing through these pixels. Even when developing an autonomous driving robot, in order not to deviate from the road designated by the robot, it may be possible to identify the center line of the road and move it around this line. Implementing this function in OpenCV is quite simple. opencv-contrib-python not opencv-python There is one thing to note. It is recommended to install opencv-contrib-python instead of opencv-python, which is normally installed to use OpenCV in Python. In this example, a function called cv2.ximgproc.thinning is used, but ximgproc is not supported by opencv-python. opencv-contrib-python is installed with additional module