×

resample python

resample python(python的image.merge去掉红色西数)

admin admin 发表于2023-12-08 03:18:59 浏览39 评论0

抢沙发发表评论

本篇文章给大家谈谈resample python,以及python的image.merge去掉红色西数对应的知识点,文章可能有点长,但是希望大家可以阅读完,增长自己的知识,最重要的是希望对各位有所帮助,可以解决了您的问题,不要忘了收藏本站喔。

本文目录

python的image.merge去掉红色西数

纯净天空当前位置: 首页》》代码示例》》Python》》正文Python Image.merge方法代码示例本文整理汇总了Python中PIL.Image.merge方法的典型用法代码示例。如果您正苦于以下问题:Python Image.merge方法的具体用法?Python Image.merge怎么用?Python Image.merge使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类PIL.Image的用法示例。在下文中一共展示了Image.merge方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的Python代码示例。示例1: resolve▲ 点赞 6 ▼# 需要导入模块: from PIL import Image # 或者: from PIL.Image import merge def resolve(ctx): from PIL import Image if isinstance(ctx, list): ctx = net.load_parameters(’superres.params’, ctx=ctx) img = Image.open(opt.resolve_img).convert(’YCbCr’) y, cb, cr = img.split() data = mx.nd.expand_dims(mx.nd.expand_dims(mx.nd.array(y), axis=0), axis=0) out_img_y = mx.nd.reshape(net(data), shape=(-3, -2)).asnumpy() out_img_y = out_img_y.clip(0, 255) out_img_y = Image.fromarray(np.uint8(out_img_y), mode=’L’) out_img_cb = cb.resize(out_img_y.size, Image.BICUBIC) out_img_cr = cr.resize(out_img_y.size, Image.BICUBIC) out_img = Image.merge(’YCbCr’, ).convert(’RGB’) out_img.save(’resolved.png’) 开发者ID:awslabs,项目名称:dynamic-training-with-apache-mxnet-on-aws,代码行数:19,代码来源:super_resolution.py示例2: distort_image▲ 点赞 6 ▼# 需要导入模块: from PIL import Image # 或者: from PIL.Image import merge def distort_image(im, hue, sat, val): im = im.convert(’HSV’) cs = list(im.split()) cs.point(lambda i: i * sat) cs.point(lambda i: i * val) def change_hue(x): x += hue*255 if x 》 255: x -= 255 if x 《 0: x += 255 return x cs.point(change_hue) im = Image.merge(im.mode, tuple(cs)) im = im.convert(’RGB’) return im 开发者ID:XiaoYee,项目名称:emotion_classification,代码行数:20,代码来源:utils.py示例3: distort_image▲ 点赞 6 ▼# 需要导入模块: from PIL import Image # 或者: from PIL.Image import merge def distort_image(im, hue, sat, val): im = im.convert(’HSV’) cs = list(im.split()) cs.point(lambda i: i * sat) cs.point(lambda i: i * val) def change_hue(x): x += hue*255 if x 》 255: x -= 255 if x 《 0: x += 255 return x cs.point(change_hue) im = Image.merge(im.mode, tuple(cs)) im = im.convert(’RGB’) #constrain_image(im) return im 开发者ID:andy-yun,项目名称:pytorch-0.4-yolov3,代码行数:21,代码来源:image.py示例4: open_base_img▲ 点赞 6 ▼# 需要导入模块: from PIL import Image # 或者: from PIL.Image import merge def open_base_img(full_profile, res, base_color, color): # get base image according to profile and perceptual gray of key color base_num = str(.index(base_color) + 1) # open image and convert to Lab with Image.open(’images/{0}_{1}{2}.png’.format(*full_profile, base_num)) as img: key_img = img.resize((int(s * res / 200) for s in img.size), resample=Image.BILINEAR).convert(’RGBA’) if full_profile l, a, b = ImageCms.applyTransform(key_img, rgb2lab_transform).split() # convert key color to Lab # a and b should be scaled by 128/100, but desaturation looks more natural rgb_color = color_objects.sRGBColor(*ImageColor.getrgb(color), is_upscaled=True) lab_color = color_conversions.convert_color(rgb_color, color_objects.LabColor) l1, a1, b1 = lab_color.get_value_tuple() l1, a1, b1 = int(l1 * 256 / 100), int(a1 + 128), int(b1 + 128) # change Lab of base image to match that of key color l = ImageMath.eval(’convert(l + l1 - l_avg, "L")’, l=l, l1=l1, l_avg=base_color) a = ImageMath.eval(’convert(a + a1 - a, "L")’, a=a, a1=a1) b = ImageMath.eval(’convert(b + b1 - b, "L")’, b=b, b1=b1) key_img = ImageCms.applyTransform(Image.merge(’LAB’, (l, a, b)), lab2rgb_transform).convert(’RGBA’) if full_profile in (’ISO’, ’BIGENTER’): key_img.putalpha(alpha) return key_img 开发者ID:CQCumbers,项目名称:kle_render,代码行数:27,代码来源:key.py示例5: __call__▲ 点赞 6 ▼# 需要导入模块: from PIL import Image # 或者: from PIL.Image import merge def __call__(self, video_path, frame_indices): with h5py.File(video_path, ’r’) as f: flow_data = for flow in self.flows: flow_data.append(f) video = for i in frame_indices: if i 《 len(flow_data): frame = ).convert("RGB") output_img_dim = 672 assert result_img.size == (output_img_dim, output_img_dim) LOGGER.info("Super Resolution example success.") result_img.save("super_res_output.jpg") return result_img 开发者ID:awslabs,项目名称:dynamic-training-with-apache-mxnet-on-aws,代码行数:28,代码来源:super_resolution.py示例15: color▲ 点赞 5 ▼# 需要导入模块: from PIL import Image # 或者: from PIL.Image import merge def color(src, target): num_pixels = src.size colors = src.getcolors(num_pixels) rgb = sum(c for c in colors), sum( c for c in colors) rgb = rgb / num_pixels bands = target.split() for i, v in enumerate(rgb): out = bands.point(lambda p: int(p * v / 255)) bands.paste(out) return Image.merge(target.mode, bands) 开发者ID:avrae,项目名称:avrae,代码行数:13,代码来源:playertoken.py注:本文中的PIL.Image.merge方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。2008-2022 | 纯净天空 | 简体 | 繁体 | 联系我们 | 京ICP备15018527号-1 | 赞助商

python 有没有对信号进行升采样的方法,从1000点序列数据转成10000点数据

这个里面他的话这个是可以进行进行采样的方法,然后再从他的点训练数据中转换乘1000点的话,它都是里面是转化的,数据比较多,所以所以的话工程量比较大。

以上就是我们为大家找到的有关“resample python(python的image.merge去掉红色西数)”的所有内容了,希望可以帮助到你。如果对我们网站的其他内容感兴趣请持续关注本站。