[英]Image color cloning using opencv
I was trying to clone the image color.我试图克隆图像颜色。 So far I have done with creating the mask and color it but I am getting the solid color of the image but I was expecting the output like this
到目前为止,我已经完成了蒙版的创建和着色,但我得到了图像的纯色,但我期待像这样的 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)
I think you can use Image Blending using Pyramids.我认为您可以使用 Pyramids 使用图像混合。 Here you can find more information about it:
在这里您可以找到有关它的更多信息:
https://docs.opencv.org/master/dc/dff/tutorial_py_pyramids.html https://docs.opencv.org/master/dc/dff/tutorial_py_pyramids.html
https://theailearner.com/tag/image-blending-using-pyramids-opencv/ https://theailearner.com/tag/image-blending-using-pyramids-opencv/
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.