C# OpenCvSharp DNN 深度神经网络下的风格迁移模型

目录

介绍

效果

项目

代码

下载


C# OpenCvSharp DNN 深度神经网络下的风格迁移模型

介绍

深度神经网络下的风格迁移模型,适用于OpenCv、EmguCv。

斯坦福大学李飞飞团队的风格迁移模型是一种基于深度学习的图像处理技术,可以将一张图像的风格转移到另一张图像上。该模型最初由Gatys等人提出,后来被李飞飞团队进一步优化和改进。该模型在图像处理领域具有广泛的应用,例如艺术风格转换、视频风格迁移等。

github地址:https://github.com/jcjohnson/fast-neural-style

效果

eccv16/composition_vii.t7

eccv16/la_muse.t7

eccv16/starry_night.t7

eccv16/the_wave.t7

instance_norm/candy.t7

instance_norm/feathers.t7

instance_norm/la_muse.t7

instance_norm/mosaic.t7

instance_norm/the_scream.t7

instance_norm/udnie.t7

项目

代码

保存图像

if (pictureBox2.Image == null)

{

return;

}

Bitmap output = new Bitmap(pictureBox2.Image);

var sdf = new SaveFileDialog();

sdf.Title = "保存";

sdf.Filter = "Images (*.bmp)|*.bmp|Images (*.emf)|*.emf|Images (*.exif)|*.exif|Images (*.gif)|*.gif|Images (*.ico)|*.ico|Images (*.jpg)|*.jpg|Images (*.png)|*.png|Images (*.tiff)|*.tiff|Images (*.wmf)|*.wmf";

if (sdf.ShowDialog() == DialogResult.OK)

{

switch (sdf.FilterIndex)

{

case 1:

{

output.Save(sdf.FileName, ImageFormat.Bmp);

break;

}

case 2:

{

output.Save(sdf.FileName, ImageFormat.Emf);

break;

}

case 3:

{

output.Save(sdf.FileName, ImageFormat.Exif);

break;

}

case 4:

{

output.Save(sdf.FileName, ImageFormat.Gif);

break;

}

case 5:

{

output.Save(sdf.FileName, ImageFormat.Icon);

break;

}

case 6:

{

output.Save(sdf.FileName, ImageFormat.Jpeg);

break;

}

case 7:

{

output.Save(sdf.FileName, ImageFormat.Png);

break;

}

case 8:

{

output.Save(sdf.FileName, ImageFormat.Tiff);

break;

}

case 9:

{

output.Save(sdf.FileName, ImageFormat.Wmf);

break;

}

}

MessageBox.Show("保存成功,位置:" + sdf.FileName);

}

复制代码
if (pictureBox2.Image == null)
{
    return;
}
Bitmap output = new Bitmap(pictureBox2.Image);
var sdf = new SaveFileDialog();
sdf.Title = "保存";
sdf.Filter = "Images (*.bmp)|*.bmp|Images (*.emf)|*.emf|Images (*.exif)|*.exif|Images (*.gif)|*.gif|Images (*.ico)|*.ico|Images (*.jpg)|*.jpg|Images (*.png)|*.png|Images (*.tiff)|*.tiff|Images (*.wmf)|*.wmf";
if (sdf.ShowDialog() == DialogResult.OK)
{
    switch (sdf.FilterIndex)
    {
        case 1:
            {
                output.Save(sdf.FileName, ImageFormat.Bmp);
                break;
            }
        case 2:
            {
                output.Save(sdf.FileName, ImageFormat.Emf);
                break;
            }
        case 3:
            {
                output.Save(sdf.FileName, ImageFormat.Exif);
                break;
            }
        case 4:
            {
                output.Save(sdf.FileName, ImageFormat.Gif);
                break;
            }
        case 5:
            {
                output.Save(sdf.FileName, ImageFormat.Icon);
                break;
            }
        case 6:
            {
                output.Save(sdf.FileName, ImageFormat.Jpeg);
                break;
            }
        case 7:
            {
                output.Save(sdf.FileName, ImageFormat.Png);
                break;
            }
        case 8:
            {
                output.Save(sdf.FileName, ImageFormat.Tiff);
                break;
            }
        case 9:
            {
                output.Save(sdf.FileName, ImageFormat.Wmf);
                break;
            }
    }
    MessageBox.Show("保存成功,位置:" + sdf.FileName);
}

下载

源码下载

可运行程序exe包下载

相关推荐
聚客AI14 分钟前
📈超越Prompt Engineering:揭秘高并发AI系统的上下文工程实践
人工智能·llm·agent
北极光SD-WAN组网28 分钟前
某电器5G智慧工厂网络建设全解析
人工智能·物联网·5g
十八岁牛爷爷30 分钟前
通过官方文档详解Ultralytics YOLO 开源工程-熟练使用 YOLO11实现分割、分类、旋转框检测和姿势估计(附测试代码)
人工智能·yolo·目标跟踪
阿杜杜不是阿木木1 小时前
什么?OpenCV调用cv2.putText()乱码?寻找支持中文的方法之旅
人工智能·opencv·计算机视觉
燃尽了,可无1 小时前
C#基础编程核心知识点总结
开发语言·c#
赴3351 小时前
图像边缘检测
人工智能·python·opencv·计算机视觉
机器视觉知识推荐、就业指导2 小时前
如何消除工业视觉检测中的反光问题
人工智能·计算机视觉·视觉检测
周润发的弟弟2 小时前
2025年Java在中国开发语言排名分析报告
人工智能
杭州泽沃电子科技有限公司2 小时前
工业环境电缆火灾预防的分布式光纤在线监测
运维·人工智能·科技·安全
没有梦想的咸鱼185-1037-16632 小时前
AI大模型支持下的:CMIP6数据分析与可视化、降尺度技术与气候变化的区域影响、极端气候分析
人工智能·python·深度学习·机器学习·chatgpt·数据挖掘·数据分析