• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    迪恩网络公众号

Python color.rgb2xyz函数代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了Python中skimage.color.rgb2xyz函数的典型用法代码示例。如果您正苦于以下问题:Python rgb2xyz函数的具体用法?Python rgb2xyz怎么用?Python rgb2xyz使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。



在下文中一共展示了rgb2xyz函数的13个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的Python代码示例。

示例1: test_rgb2xyz_conversion

 def test_rgb2xyz_conversion(self):
     gt = np.array([[[0.950456, 1.      , 1.088754],
                     [0.538003, 0.787329, 1.06942 ],
                     [0.592876, 0.28484 , 0.969561],
                     [0.180423, 0.072169, 0.950227]],
                    [[0.770033, 0.927831, 0.138527],
                     [0.35758 , 0.71516 , 0.119193],
                     [0.412453, 0.212671, 0.019334],
                     [0.      , 0.      , 0.      ]]])
     assert_almost_equal(rgb2xyz(self.colbars_array), gt)
开发者ID:seberg,项目名称:scikit-image,代码行数:10,代码来源:test_colorconv.py


示例2: salvarcombinacoes

def salvarcombinacoes(img):
    img_rgb = color.convert_colorspace(img, 'RGB', 'RGB')
    img_hsv = color.convert_colorspace(img_rgb, 'RGB', 'HSV')
    img_lab = color.rgb2lab(img_rgb)
    img_hed = color.rgb2hed(img_rgb)
    img_luv = color.rgb2luv(img_rgb)
    img_rgb_cie = color.convert_colorspace(img_rgb, 'RGB', 'RGB CIE')
    img_xyz = color.rgb2xyz(img_rgb)
    img_cmy = rgb2cmy(img_rgb)

    lista = [img_rgb, img_hsv, img_lab, img_hed, img_luv, img_rgb_cie, img_xyz, img_cmy]
    lista2 = ["rgb", "hsv", "lab", "hed", "luv", "rgb_cie", "xyz", "cmy"]
    for i in range(len(lista)):
        for j in range(len(lista)):
            for k in range(3):
                for l in range(3):
                    nome = lista2[i] + str(k) + lista2[j] + str(l) + ".jpg"
                    io.imsave(nome, juntarcanais(lista[i][:, :,k], lista[j][:, :, l]), )

    return
开发者ID:ssscassio,项目名称:PathoSpotter,代码行数:20,代码来源:extrairmagenta.py


示例3: extract_color_descriptors

def extract_color_descriptors(image, space=None, verbose=False):
    """
    Extract color descriptors of the image

    Parameters
    ----------
    image:

    space:
        None, equivalent to rgb
        rgb
        hsv
        xyz
        rgbcie

    Returns
    -------
    Descriptors
    """
    if space == 'hsv':
        image = color.rgb2hsv(image)
    elif space == 'xyz':
        image = color.rgb2xyz(image)
    elif space == 'rgbcie':
        image = color.rgb2rgbcie(image)
    elif space == 'gray' or space == 'grey':
        image = color.rgb2gray(image)

    gen = get_patch(image, size=1)
    descs = []
    for patch, coord in gen:
        if verbose and coord[1] % 5 == 0 and coord[0] == 0:
            print 'computed up to %d, %d' % coord
        desc = patch.flatten()
        desc = np.concatenate((desc, np.array(coord)))
        descs.append(desc)
    return np.array(descs)
开发者ID:NelleV,项目名称:IMANU,代码行数:37,代码来源:descriptors.py


示例4: ColConv

def ColConv(px):
	out = col.rgb2xyz([[px]])[0][0]
	return out
开发者ID:TimSC,项目名称:supra,代码行数:3,代码来源:converge.py


示例5: test_xyz2rgb_conversion

 def test_xyz2rgb_conversion(self):
     # only roundtrip test, we checked rgb2xyz above already
     assert_almost_equal(xyz2rgb(rgb2xyz(self.colbars_array)),
                         self.colbars_array)
开发者ID:seberg,项目名称:scikit-image,代码行数:4,代码来源:test_colorconv.py


示例6: test_xyz_rgb_roundtrip

 def test_xyz_rgb_roundtrip(self):
     img_rgb = img_as_float(self.img_rgb)
     assert_array_almost_equal(xyz2rgb(rgb2xyz(img_rgb)), img_rgb)
开发者ID:AceHao,项目名称:scikit-image,代码行数:3,代码来源:test_colorconv.py


示例7:

    return plt

#Input's Block

    #Single Reader
img = data.imread('img/nor.jpg', False,)
    #Set Reader

#Convert Block
img_rgb = color.convert_colorspace(img, 'RGB', 'RGB') #No need
img_hsv = color.convert_colorspace(img_rgb, 'RGB', 'HSV')
img_lab = color.rgb2lab(img_rgb)
img_hed = color.rgb2hed(img_rgb)
img_luv = color.rgb2luv(img_rgb)
img_rgb_cie = color.convert_colorspace(img_rgb, 'RGB', 'RGB CIE')
img_xyz = color.rgb2xyz(img_rgb)

#Save Test Block
"""io.imsave("image_hsv.jpg", img_hsv, )
io.imsave("image_lab.jpg", img_lab, )
io.imsave("image_hed.jpg", img_hed, )
io.imsave("image_luv.jpg", img_luv, )
io.imsave("image_rgb_cie.jpg", img_rgb_cie, )
io.imsave("image_xyz.jpg", img_xyz, )
"""
#Layers Block
"""
canalExtration(img_rgb, "RGB").show()
canalExtration(img_hsv, "HSV").show()
canalExtration(img_lab, "LAB").show()
canalExtration(img_hed, "HED").show()
开发者ID:ssscassio,项目名称:PathoSpotter,代码行数:31,代码来源:ColorSpace_Analisis.py


示例8:

A = io.imread(files[0])
As = transform.rescale(A, 0.25)
io.imshow(A)
plt.grid(False)

# <codecell>

#B = exposure.adjust_sigmoid(A, gain=12)
Bs = exposure.adjust_sigmoid(ski.img_as_float(As), gain=12)
#io.imshow(B - exposure.adjust_sigmoid(ski.img_as_float(A), gain=12))

# <codecell>

#C = color.rgb2xyz(B)[:, :, 1]
Cs = color.rgb2xyz(Bs)[:, :, 1]
io.imshow(Cs)
plt.grid(0)

# <codecell>

#D = filter.threshold_adaptive(C, 301)
Ds = filter.threshold_adaptive(Cs, 75)
io.imshow(Ds)
plt.grid(0)

# <codecell>

#E = morphology.remove_small_objects(~morphology.remove_small_objects(~D, 100), 100)
Es = morphology.remove_small_objects(~morphology.remove_small_objects(~Ds, 10), 10)
io.imshow(Es)
开发者ID:QCaudron,项目名称:Quantitative-Histology,代码行数:30,代码来源:individual.py


示例9:

labels = morphology.watershed(-distance, markers, mask = clean)

io.imshow(labels, interpolation = "nearest", cmap = plt.cm.spectral)

# <codecell>

io.imshow(filter.gaussian_filter(image, 31))

# <codecell>

# Local density

B = image[:, :, 2]
#B = filter.gaussian_filter(np.abs(B - B.mean()), 31)
#io.imshow(B > 1.1*filter.threshold_otsu(B))
io.imshow(color.rgb2xyz(image)[:, :, 2])


#local_density = filter.gaussian_filter(image[:,:,0], 41)# - filter.gaussian_filter(clean, 201)
#io.imshow(local_density > 1.2 * filter.threshold_otsu(local_density, nbins = 1000))
#io.imshow(local_density - local_density.mean() > 0)
"""
#io.imshow(filter.gaussian_filter(clean, 51))
Q = (signal.convolve2d(ski.img_as_float(clean / clean.max()), ski.img_as_float(morphology.disk(201)), "valid"))# - filter.gaussian_filter(clean, 251))
Q -= Q.min()
Q /= Q.max()
io.imshow(Q)
"""

# <codecell>
开发者ID:QCaudron,项目名称:Quantitative-Histology,代码行数:30,代码来源:Analysis-10.py


示例10:

    print "Thread %s. Opening file : %s" % (sys.argv[1], f)


    ### PROCESSING
        
    # Read the image
    A = io.imread(f)
        
    # Constrast enhancement
    print "Thread %s. Sigmoid transform for contrast." % sys.argv[1]
    B = exposure.adjust_sigmoid(A, gain=12)
        
    # Extract luminosity
    print "Thread %s. Generating luminosity." % sys.argv[1]
    C = color.rgb2xyz(B)[:, :, 1]
    
    # Apply adaptive thresholding
    print "Thread %s. Performing adaptive thresholding." % sys.argv[1]
    D = filter.threshold_adaptive(C, 301)
    D2 = filter.threshold_adaptive(C, 301, offset=-0.01)
        
    # Clean
    print "Thread %s. Cleaning image." % sys.argv[1]
    E = morphology.remove_small_objects(~morphology.remove_small_objects(~D, 100), 100)
    E2 = morphology.remove_small_objects(~morphology.remove_small_objects(~D2, 100), 100)
    blur.append(np.abs(E[:2000, 1000:-1000] - E2[:2000, 1000:-1000]).sum() / 6368000.)

    # Save to disk
    io.imsave(f + "_processed.jpg", ski.img_as_float(E))
        
开发者ID:ritamluis,项目名称:Quantitative-Histology,代码行数:29,代码来源:batch.py


示例11: to_xyz

 def to_xyz(self):
     return Image(rgb2xyz(self.to_rgb_from_gray()[:, :, :3])).convert_type(self.dtype)
开发者ID:zshipko,项目名称:imagepy,代码行数:2,代码来源:image.py


示例12: SGD

model.add(Convolution2D(64, 4, 4, border_mode='valid'))
model.add(MaxPooling2D(pool_size=(2, 2)))
model.add(Dropout(0.5))
model.add(Activation('relu'))
model.add(Convolution2D(64, 3, 3, border_mode='valid'))
model.add(Dropout(0.5))
model.add(Activation('relu'))
model.add(Flatten())
model.add(Dense(512))
model.add(Activation('relu'))
model.add(Dense(6))
model.add(Activation('softmax')) #aqui o certo é um htan

sgd = SGD()
model.compile(loss = 'categorical_crossentropy', optimizer = sgd)

env = gym.make('Pong-v0')
obs = env.reset()
xyz = color.rgb2xyz(obs)
y = xyz[:,:,1]	
small = resize(y,(84,84))
in_obs = small.reshape(1, 1, 84, 84)

pred = model.predict(in_obs,batch_size=1,verbose=0)

print(pred)

#h = model.fit(X_train, Y_train, batch_size = 128, nb_epoch=3, validation_data =(X_test, Y_test), verbose=1) 


开发者ID:glazari,项目名称:DQN-reproduction,代码行数:28,代码来源:keras3.py


示例13: rgb2xyz

 def rgb2xyz(self,imageArray):
     return color.rgb2xyz(imageArray)
开发者ID:valavanisleonidas,项目名称:Machine_Learning_Toolkit,代码行数:2,代码来源:ImageProcessing.py



注:本文中的skimage.color.rgb2xyz函数示例由纯净天空整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
Python color.separate_stains函数代码示例发布时间:2022-05-27
下一篇:
Python color.rgb2lab函数代码示例发布时间:2022-05-27
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap