首页
游戏
影视
直播
广播
听书
音乐
图片
更多
看书
微视
主播
统计
友链
留言
关于
论坛
邮件
推荐
我的硬盘
我的搜索
我的记录
我的文件
我的图书
我的笔记
我的书签
我的微博
Search
1
在IC617中进行xa+vcs数模混仿
81 阅读
2
科普:Memory Compiler生成的Register file和SRAM有何区别?
73 阅读
3
virtuoso和empyrean alps模拟仿真和混仿教程
73 阅读
4
后仿中$setup,$hold与$setuphold
44 阅读
5
文档内容搜索哪家强? 15款文件搜索软件横向评测
35 阅读
默认分类
芯片市场
数字电路
芯片后端
模拟电路
芯片验证
原型与样片验证
算法与架构
DFX与量产封装
PC&Server OS设置
移动OS设置
软件方案
新浪备份
有道备份
登录
Search
标签搜索
python
Docker
vscode
linux
systemverilog
vcs
STM32
PyQT
EDA
FPGA
gvim
cadence
Alist
xilinx
UVM
uos
macos
package
MCU
risc-v
bennyhe
累计撰写
378
篇文章
累计收到
31
条评论
首页
栏目
默认分类
芯片市场
数字电路
芯片后端
模拟电路
芯片验证
原型与样片验证
算法与架构
DFX与量产封装
PC&Server OS设置
移动OS设置
软件方案
新浪备份
有道备份
页面
游戏
影视
直播
广播
听书
音乐
图片
看书
微视
主播
统计
友链
留言
关于
论坛
邮件
推荐
我的硬盘
我的搜索
我的记录
我的文件
我的图书
我的笔记
我的书签
我的微博
搜索到
168
篇与
的结果
2025-07-14
边缘检测类算法(3) (2008-06-06 19:55:15)
// /// 按 Kirsch 算子进行边缘检测 /// /// 位图流 /// public Bitmap Kirsch(Bitmap b) { Matrix3x3 m = new Matrix3x3(); // 5 5 5 // -3 0 -3 // -3 -3 -3 m.Init(-3); m.Center = 0; m.TopLeft = m.TopMid = m.TopRight = 5; Bitmap b1 = m.Convolute((Bitmap)b.Clone()); // -3 5 5 // -3 0 5 // -3 -3 -3 m.Init(-3); m.Center = 0; m.TopMid = m.TopRight = m.MidRight = 5; Bitmap b2 = m.Convolute((Bitmap)b.Clone()); // -3 -3 5 // -3 0 5 // -3 -3 5 m.Init(-3); m.Center = 0; m.TopRight = m.MidRight = m.BottomRight = 5; Bitmap b3 = m.Convolute((Bitmap)b.Clone()); // -3 -3 -3 // -3 0 5 // -3 5 5 m.Init(-3); m.Center = 0; m.MidRight = m.BottomRight = m.BottomMid = 5; Bitmap b4 = m.Convolute((Bitmap)b.Clone()); // -3 -3 -3 // -3 0 -3 // 5 5 5 m.Init(-3); m.Center = 0; m.BottomLeft = m.BottomMid = m.BottomRight = 5; Bitmap b5 = m.Convolute((Bitmap)b.Clone()); // -3 -3 -3 // 5 0 -3 // 5 5 -3 m.Init(-3); m.Center = 0; m.MidLeft = m.BottomLeft = m.BottomMid = 5; Bitmap b6 = m.Convolute((Bitmap)b.Clone()); // 5 -3 -3 // 5 0 -3 // 5 -3 -3 m.Init(-3); m.Center = 0; m.TopLeft = m.MidLeft = m.BottomLeft = 5; Bitmap b7 = m.Convolute((Bitmap)b.Clone()); // 5 5 -3 // 5 0 -3 // -3 -3 -3 m.Init(-3); m.Center = 0; m.TopLeft = m.MidLeft = m.TopMid = 5; Bitmap b8 = m.Convolute((Bitmap)b.Clone()); // 梯度运算 Bitmap b9 = Gradient(Gradient(b1, b2), Gradient(b3, b4)); Bitmap b10 = Gradient(Gradient(b5, b6), Gradient(b7, b8)); b = Gradient(b9, b10); b1.Dispose(); b2.Dispose(); b3.Dispose(); b4.Dispose(); b5.Dispose(); b6.Dispose(); b7.Dispose(); b8.Dispose(); b9.Dispose(); b10.Dispose(); return b; } // end of Kirsch /// /// 按 GaussLaplacian 算子进行边缘检测 /// /// /// public Bitmap GaussLaplacian(Bitmap b) { int[,] kernel = { {-2, -4, -4, -4, -2}, {-4, 0, 8, 0, -4}, {-4, 8, 24, 8, -4}, {-4, 0, 8, 0, -4}, {-2, -4, -4, -4, -2} }; MatrixNxN m = new MatrixNxN(); m.Kernel = kernel; return m.Convolute(b); } // end of GaussLaplacian
2025年07月14日
0 阅读
0 评论
0 点赞
2025-07-14
边缘检测类算法(2) (2008-06-06 19:52:52)
/// /// 按 Sobel 算子进行边缘检测 /// /// 位图流 /// public Bitmap Sobel(Bitmap b) { Matrix3x3 m = new Matrix3x3(); // -1 -2 -1 // 0 0 0 // 1 2 1 m.Init(0); m.TopLeft = m.TopRight = -1; m.BottomLeft = m.BottomRight = 1; m.TopMid = -2; m.BottomMid = 2; Bitmap b1 = m.Convolute((Bitmap)b.Clone()); // -1 0 1 // -2 0 2 // -1 0 1 m.Init(0); m.TopLeft = m.BottomLeft = -1; m.TopRight = m.BottomRight = 1; m.MidLeft = -2; m.MidRight = 2; Bitmap b2 = m.Convolute((Bitmap)b.Clone()); // 0 1 2 // -1 0 1 // -2 -1 0 m.Init(0); m.TopMid = m.MidRight = 1; m.MidLeft = m.BottomMid = -1; m.TopRight = 2; m.BottomLeft = -2; Bitmap b3 = m.Convolute((Bitmap)b.Clone()); // -2 -1 0 // -1 0 1 // 0 1 2 m.Init(0); m.TopMid = m.MidLeft = -1; m.MidRight = m.BottomMid = 1; m.TopLeft = -2; m.BottomRight = 2; Bitmap b4 = m.Convolute((Bitmap)b.Clone()); // 梯度运算 b = Gradient(Gradient(b1, b2), Gradient(b3, b4)); b1.Dispose(); b2.Dispose(); b3.Dispose(); b4.Dispose(); return b; } // end of Sobel /// /// 按 Prewitt 算子进行边缘检测 /// /// 位图流 /// public Bitmap Prewitt(Bitmap b) { Matrix3x3 m = new Matrix3x3(); // -1 -1 -1 // 0 0 0 // 1 1 1 m.Init(0); m.TopLeft = m.TopMid = m.TopRight = -1; m.BottomLeft = m.BottomMid = m.BottomRight = 1; Bitmap b1 = m.Convolute((Bitmap)b.Clone()); // -1 0 1 // -1 0 1 // -1 0 1 m.Init(0); m.TopLeft = m.MidLeft = m.BottomLeft = -1; m.TopRight = m.MidRight = m.BottomRight = 1; Bitmap b2 = m.Convolute((Bitmap)b.Clone()); // -1 -1 0 // -1 0 1 // 0 1 1 m.Init(0); m.TopLeft = m.MidLeft = m.TopMid = -1; m.BottomMid = m.BottomRight = m.MidRight = 1; Bitmap b3 = m.Convolute((Bitmap)b.Clone()); // 0 1 1 // -1 0 1 // -1 -1 0 m.Init(0); m.TopMid = m.TopRight = m.MidRight = 1; m.MidLeft = m.BottomLeft = m.BottomMid = -1; Bitmap b4 = m.Convolute((Bitmap)b.Clone()); // 梯度运算 b = Gradient(Gradient(b1, b2), Gradient(b3, b4)); b1.Dispose(); b2.Dispose(); b3.Dispose(); b4.Dispose(); return b; } // end of Prewitt 分享:
2025年07月14日
0 阅读
0 评论
0 点赞
2025-07-14
边缘检测类算法(1) (2008-06-06 19:50:09)
边缘检测类(包括Roberts, Sobel, Prewitt, Kirsch等算子的边缘检测算法) public class EdgeDetect : ImageInfo { /// /// 对两幅图像进行梯度运算 /// /// 位图 1 /// 位图 2 /// private Bitmap Gradient(Bitmap b1, Bitmap b2) { int width = b1.Width; int height = b1.Height; BitmapData data1 = b1.LockBits(new Rectangle(0, 0, width, height), ImageLockMode.ReadWrite, PixelFormat.Format32bppArgb); BitmapData data2 = b2.LockBits(new Rectangle(0, 0, width, height), ImageLockMode.ReadOnly, PixelFormat.Format32bppArgb); unsafe { byte p1 = (byte)data1.Scan0; byte p2 = (byte)data2.Scan0; int offset = data1.Stride - width * BPP; for (int y = 0; y < height; y++) { for (int x = 0; x < width; x++) { for (int i = 0; i < 3; i++) { int power = (int)Math.Sqrt((p1[i] p1[i] + p2[i] p2[i])); p1[i] = (byte)(power > 255 ? 255 : power); } // i p1 += BPP; p2 += BPP; } // x p1 += offset; p2 += offset; } // y } b1.UnlockBits(data1); b2.UnlockBits(data2); Bitmap dstImage = (Bitmap)b1.Clone(); b1.Dispose(); b2.Dispose(); return dstImage; } // end of Gradient /// /// 按 Roberts 算子进行边缘检测 /// /// 位图流 /// public Bitmap Roberts(Bitmap b) { int width = b.Width; int height = b.Height; Bitmap dstImage = new Bitmap(width, height); BitmapData srcData = b.LockBits(new Rectangle(0, 0, width, height), ImageLockMode.ReadOnly, PixelFormat.Format32bppArgb); BitmapData dstData = dstImage.LockBits(new Rectangle(0, 0, width, height), ImageLockMode.WriteOnly, PixelFormat.Format32bppArgb); int stride = srcData.Stride; int offset = stride - width * BPP; unsafe { byte src = (byte)srcData.Scan0; byte dst = (byte)dstData.Scan0; int A, B; // A(x-1, y-1) B(x, y-1) int C, D; // C(x-1, y) D(x, y) // 指向第一行 src += stride; dst += stride; // 不处理最上边和最左边 for (int y = 1; y < height; y++) { // 指向每行第一列 src += BPP; dst += BPP; for (int x = 1; x < width; x++) { for (int i = 0; i < 3; i++) { A = src[i - stride - BPP]; B = src[i - stride]; C = src[i - BPP]; D = src[i]; dst[i] = (byte)(Math.Sqrt((A - D) (A - D) + (B - C) (B - C))); } // i dst[3] = src[3]; src += BPP; dst += BPP; } // x src += offset; dst += offset; } // y } b.UnlockBits(srcData); dstImage.UnlockBits(dstData); b.Dispose(); return dstImage; } // end of Roberts
2025年07月14日
0 阅读
0 评论
0 点赞
2025-07-14
Altera Quartus II Web版与正式版的比较(2) (2008-06-06 19:38:26)
暂无简介
2025年07月14日
0 阅读
0 评论
0 点赞
2025-07-14
MOV、MOVX、MOVC区别 (2008-06-06 19:48:33)
MOV指令表示单片机内部的寄存器或者存储器之间相互传递数据,而MOVX则表示单片机内部的A累加器与片外的数据存储器传送数据.还有两条是MOVC的指令,它们表示A向ROM(程序存储器)读取数据,因为程序存储器是固定的不可以写的,所以,A只能读数据,却不能向它写数据.换句话说MOVX和MOVC是针对两种不同的存储器而言,一个是数据存储器,另一个却是程序存储器
2025年07月14日
0 阅读
0 评论
0 点赞
1
...
29
30
31
...
34