🐍Python

    [OpenCV] 07-2. Pose Estimation

    이번 장에서는이미지에서 3D 효과를 생성하기 위해 calib3d 모듈을 이용하는 법을 배워볼 것이다.Basics매우 작은 섹션이 될 것이다. camera calibration를 하는 동안에는. camera matrix, 왜곡 계수등을 찾았었다. 패턴 이미지가 주어졌을 때, 위의 정보를 가지고 pose를 계산하고나, 물체가 공간에 어떻게 놓여있는지(회전,옮김)를 알 수 있다. 평면 물체에 대해서, Z축을 0이라고 할 수 있고, 이제 패턴 이미지를 보기 위해 카메라가 어디에 위치해야하는지가 문제가 된다. 그래서, 만약 물체가 공간에 어떻게 놓여있는지를 안다면, 물체에 2D 도형을 그려서 3D 효과를 시뮬레이션할 수 있다. 백문이 불여일견! 한 번 해보자!우리의 문제..

    [알고리즘] 50. Encryption

    An English text needs to be encrypted using the following encryption scheme. First, the spaces are removed from the text. Let be the length of this text. Then, characters are written into a grid, whose rows and columns have the following constraints:For example, the sentence , after removing spaces is characters long. is between and , so it is written in the form of a grid with 7 rows and 8 colu..

    [OpenCV] 07-1. Camera Calibration

    이번 장에서는카메라상에서 왜곡, 카메라의 내재/외적 파라미터 등이러한 파라미터들과 왜곡되지않은 이미지등을 찾아볼 것이다.Basics오늘날의 값싼 핀홀 카메라는 이미지에 많은 왜곡을 불러온다. 두 가지 주요한 왜곡은 방사형 왜곡(radial distortion)과 접선형 왜곡(tangential distortion)이다.방사형 왜곡은 직선을 곡선처럼 보이게 한다. 이미지를 화면 중앙에서 멀어지게 한다면 이는 더 많은 영향을 미치게 된다. 예를 들어서, 아래의 이미지를 보면, 체스 보드의 양 끝 가장자리를 빨간 선으로 표시를 해두었다. 하지만 가장자리가 직선이 아니고, 빨간 선과도 일치하지 않는 것을 볼 수 있다. 예측된 직선들은 돌출되어있다. 왜곡(dist..

    [알고리즘] 49. Modified Kaprekar Numbers

    A modified Kaprekar number is a positive whole number with a special property. If you square it, then split the number into two integers and sum those integers, you have the same value you started with.Consider a positive whole number with digits. We square to arrive at a number that is either digits long or digits long. Split the string representation of the square into two parts, and . The rig..

    [OpenCV] 06-3. Background Subtraction

    이번 장에서는OpenCV에서 가능한 배경 제거 방법에 대해서 알아볼 것이다.Basics배경 제거는 많은 비전 기반의 응용의 전처리 단계에서 주로 이뤄진다. 예를 들어, 정적인 카메라로 방을 들어오는 / 나가는 방문자들의 수를 세거나, 차량으로 부터 교통 정보를 추출하는 등의 경우가 존재한다. 이 모든 경우에, 사람이나 차량만들 추출할 필요가 있다. 기술적으로, 정적인 배경으로부터 움직이는 전경(foreground)을 추출할 필요가 있다.만약 방문자 없는 방, 차량 없는 도로같이, 배경만 있는 이미지라면, 매우 쉬운 일이 된다. 배경으로 부터 새로운 이미지를 빼기만 하면 된다. 그러면 전경만 얻을 수 있다. 하지만 많은 경우에, 이런 이미지와 같지 않기에, 가..

    [알고리즘] 48. Taum and B'day

    Taum is planning to celebrate the birthday of his friend, Diksha. There are two types of gifts that Diksha wants from Taum: one is black and the other is white. To make her happy, Taum has to buy black gifts and white gifts.The cost of each black gift is units.The cost of every white gift is units.The cost of converting each black gift into white gift or vice versa is units.Help Taum by deducing..