기계 학습을 사용하여 손으로 쓴 서명 이미지의 배경 제거 (Using machine learning to remove background in image of hand-written signature)


문제 설명

기계 학습을 사용하여 손으로 쓴 서명 이미지의 배경 제거 (Using machine learning to remove background in image of hand‑written signature)

저는 머신 러닝을 처음 접합니다. 문서 하단에 서명이 있는 문서를 준비하고 싶습니다. 이를 위해 문서에 배치할 사용자 서명의 사진을 찍고 있습니다.

기계 학습을 사용하여 이미지에서 서명 부분만 추출하여 문서에 배치하려면 어떻게 해야 합니까? 입력 예: Input

gif 형식으로 예상되는 출력: 출력


참조 솔루션

방법 1:

Extract the green image plane. Then take the complementary of the gray value of every pixel as the transparency coefficient. Then you can perform compositing to the destination.

https://en.wikipedia.org/wiki/Alpha_compositing

방법 2:

A simple image‑processing technique using OpenCV should work. The idea is to obtain a binary image then bitwise‑and the image to remove the non‑signature details. Here's the results:

Input image

enter image description here

Binary image

enter image description here

Result

enter image description here

Code

import cv2

# Load image, convert to grayscale, Gaussian blur, Otsu's threshold
image = cv2.imread('1.jpg')
gray = cv2.cvtColor(image, cv2.COLOR_BGR2GRAY)
blur = cv2.GaussianBlur(gray, (3,3), 0)
thresh = cv2.threshold(blur, 0, 255, cv2.THRESH_BINARY_INV + cv2.THRESH_OTSU)[1]

# Bitwise‑and and color background white
result = cv2.bitwise_and(image, image, mask=thresh)
result[thresh==0] = [255,255,255]

cv2.imshow('thresh', thresh)
cv2.imshow('result', result)
cv2.waitKey()

(by Ruturaj MoreYves Daoustnathancy)

참조 문서

  1. Using machine learning to remove background in image of hand‑written signature (CC BY‑SA 2.5/3.0/4.0)

#Artificial-Intelligence #Machine-Learning #image-processing #tensorflow #deep-learning






관련 질문

C++의 Langtons Ant(콘솔) - 코어 덤프됨 (Langtons Ant in C++ (console) - core dumped)

그리드 맵 탐색/채우기 알고리즘 (Algorithm for exploring/filling grid map)

사이먼 마크 투 오픈 소스 코드 (cyman mark two open souce code)

가위바위보 AI 이슈 (Rock paper scissors AI issue)

::pause >nul은 무엇을 의미합니까? (배치로) (What does ::pause >nul mean/do? (in batch))

4x4 TicTacToe 보드의 Minimax 알고리즘 (Minimax algorithm in 4x4 TicTacToe board)

타의 추종을 불허하는 minimax 검사기 알고리즘 (Unbeatable minimax checkers algorithm)

기계 학습을 사용하여 손으로 쓴 서명 이미지의 배경 제거 (Using machine learning to remove background in image of hand-written signature)

유효한 인덱스를 반환하지 않는 Tensorflow 텍스트 생성 (Tensorflow text generation not returning valid index)

NLP의 의미론적 유사성(텍스트 비교) - 최고의 패키지 또는 클라우드 서비스? (Semantic similarity (text comparison) in NLP - best package or cloud service?)

Android 애플리케이션에 RASA 챗봇 통합 (Integration of RASA Chatbot on Android Application)

Python과 함께 스레딩을 사용할 때 발생하는 코루틴 오류, RuntimeWarning: 코루틴 'time_messege'가 기다리지 않았습니다. (Coroutine error when using threading with python, RuntimeWarning: coroutine 'time_messege' was never awaited)







코멘트