[英]Image color cloning using opencv
我試圖克隆圖像顏色。 到目前為止,我已經完成了蒙版的創建和着色,但我得到了圖像的純色,但我期待像這樣的 output
def colorchange(self):
res = self.image_m_c #Original Image
copyimg = np.copy(res)
r = self.t5.value() #R,G,B Channel using slider
g = self.t6.value()
b = self.t7.value()
copyimg = cv2.cvtColor(copyimg, cv2.COLOR_BGR2HSV)
img = self.new_image #Mask of the image
copyimg[img!=0]=(b,g,r) #Coloring the mask
copyimg = cv2.cvtColor(copyimg, cv2.COLOR_HSV2BGR)
cv2.imshow("IMAGE",copyimg)
我認為您可以使用 Pyramids 使用圖像混合。 在這里您可以找到有關它的更多信息:
https://docs.opencv.org/master/dc/dff/tutorial_py_pyramids.html
https://theailearner.com/tag/image-blending-using-pyramids-opencv/
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.