분류 전체보기 210

It is what it is. ?

https://youtube.com/shorts/9Eu6jOUwN-Q?si=NKR6WPCYcOcsvf74 구어체에서 친구나 지인들에게 주로 불행한 일이 일어 났을때 일어난 일을 받아들여 라는 뜻으로 쓰인다.    "It is what it is" is a term used informally when speaking to friends or peers. It means that you accept whatever it is that happened to you. Often, this term is used when something unfortunate happens but you just accept the outcome of it or try and turn it into a positive conn..

youtube english 2025.02.14

Color를 Grayscale 로 변환 (커스텀 비율)

칼라 이미지를 그레이스케일로 변환시에 OpenCV는 아래 함수를 사용한다.cv::cvtColor(color, gray, cv::COLOR_BGR2GRAY); 위의 함수는 표준 변환 비율( 0.299 ∙ Red + 0.587 ∙ Green + 0.114 ∙ Blue) 을 사용한다. 이는 인간의 눈에는 Green이 민감하게 반응하기 때문에 제일 반영 비율이 높다. 하지만 필요에 따라서는 똑같은 비율을 사용하고자 할 때가 있을 것이며 아래의 함수를 사용하면 간단히 적용 가능하다.단, 위의 함수에 비해 속도는 상당히 느려진다.cv::transform(color, gray, cv::Matx13f(0.333, 0.333, 0.333));처리 시간 테스트사용 이미지: 17500 x 12812  Pixels (224...

opencv 2025.02.14

dict 을 이용한 일괄 문자열 바꿔치기

s = "hello world, have a great day"r_dict = {"hello": "hi", "world": "earth", "great": "wonderful"} 1. Loop 를 이용한 replacefor key, value in r_dict.items():     s = s.replace(key, value) print(s)-> "hi earth, have a wonderful day" 2. 정규표현 re.sub()import re # "스페이스 + ( hello|world|great ) + 스페이스"# lambda match는 매치 될때마다 매치 문자열 오브젝트가 할당 => 문자열은 object.group()# s 는 초기 문자열result = re.sub(r'\b(?:' + '|'..

data science/python 2025.02.12