- 博客(31)
- 资源 (3)
- 收藏
- 关注
原创 C#实现鼠标拖拽区域截图
代码 internal enum SizeGrip { None = 0, Top, Bottom, Left, Right, TopLeft, TopRight, BottomLeft, BottomRight, All } internal class OperateObject { priv
2021-04-23 11:04:33
2134
1
原创 sql删除表中的数据只留100行数据
delete FROM [PCSDB].[dbo].[T_Formula] WHERE ID IN(select ID from [PCSDB].[dbo].[T_Formula] order by ID offset 100 rows)
2020-07-24 10:52:05
2226
原创 C# Http post 上传数据通用方法
public List<Models.get_time_filesModel> get_time_files(int user_id,int type) { string data = JObject.Parse(HttpHelp.getData(HttpHelp.HttpPost(rootPath+"upload/get_time_files", "type="+type+"&user_id=196")))["res"].ToString();.
2020-07-21 19:08:56
1178
1
原创 C# http get 获取数据通用方法
//获取数据模型 public List<myCollectionModel> myCollection(int page, int limit) { try { string url = “服务器母地址”+ "collect/user?page=" + page + "&limit=" + limit; return HttpHelp.HttpGetData
2020-07-20 17:40:40
2097
原创 C#读取Excel表xlsx文档中的数据
//读取EXCEL的方法 (用范围区域读取数据) private List<string[]> ReadExcel(string strFileName) { //载入xlsx文档 Spire.Xls.Workbook workbook = new Spire.Xls.Workbook(); workbook.LoadFromFile(strFileName)
2020-07-20 17:27:15
993
原创 C#多重条件查询表格数据
/// <summary> /// 查询 /// </summary> /// <param name="sender"></param> /// <param name="e"></param> private void btnQuery_Click(object sender, EventArgs e) { if
2020-07-20 14:22:05
525
原创 C# 生成带二维表头的Excel表
这里用到第三方库Microsoft.Office.Interop.Excel,添加该引用后,鼠标右键该引用查看属性,将嵌入互操作类型true改为fase,电脑上需要下载office2013或者更高版本private void btnliving_Click(object sender, EventArgs e) { DataTabletoExcel1(dt, DateTime.Now.Ticks + ".xlsx");
2020-07-19 22:22:09
684
2
原创 C#对接php接口 Http POST上传文件
/// <summary> /// 上传文件 /// </summary> /// <param name="fileAdress">文件地址</param> /// <returns></returns> public responseObject UploadFile(string fileAdress) { //
2020-05-28 20:12:47
1104
原创 C#对接php接口 Http POST上传数据
/// <summary> /// 数据上传发送 /// </summary> /// <param name="obj">要上传的对象</param> /// <returns></returns> public responseObject UploadString(updownObject obj) { //服
2020-05-28 19:50:28
921
原创 C#实现Matlab中的fft2函数和fftshift函数
Mat fft2( Mat src) { Mat Fourier = new Mat(); int mat_type = (int)src.Depth; if (mat_type>15) { Debug.Print("报错"); } if (mat_type < 7) { .
2020-05-24 19:24:56
1119
原创 C#实现Matlab中的padarray函数
public Matrix<byte> padarray(Matrix<byte> src, int RowPad, int ColPad) { int n = src.Rows; int m = src.Cols; Mat temp1 = new Mat(n, m + ColPad * 2, DepthType.Cv32F, 1); Matrix<byte>
2020-05-24 19:21:26
224
原创 C#实现图片平移
private void Button2_Click(object sender, EventArgs e) { Image<Gray, byte> src = new Image<Gray, byte>(ImagePath); src = ImagePan(src, 100, -100); pictureBox2.Image = src.Bitmap; } p
2020-05-09 16:26:07
1664
原创 C#实现图片放大缩小
//times需要放大或者缩小的倍数public Bitmap imresize(Bitmap Image, double times) { int width = Image.Width; int height = Image.Height; int IOwidth = (int)Math.Round(wi...
2020-05-03 16:40:25
5740
原创 C# 实现gabor滤波
string ImagePath; private void Button1_Click(object sender, EventArgs e) { OpenFileDialog openfile = new OpenFileDialog(); if (openfile.ShowDialog() ==...
2020-05-03 15:39:26
534
4
原创 C#实现改变图片的像素
/// <summary> /// 改变图片像素 /// </summary> /// <param name="bmp"></param> /// <param name="newW">需要改变的像素宽</param> /// <param...
2020-04-27 12:01:34
2486
原创 C# 三个坐标点实现二次贝塞尔曲线并在曲线上生产出更多的坐标点
/// <summary> /// 计算两点之间的二次贝塞尔曲线点集。 /// </summary> private static IList<Point> CalculateBezierPoints(Point begin, Point handle, Point end) { ...
2020-04-27 11:54:51
1591
原创 matlab实现断开,去除二值化图中的相交线、连接线
bw= bwmorph(im2bw(I),'skel',inf);figure,imshow(bw);title('骨架提取');img=double(bw); img = imgaussfilt(img,.5); zz_out = zeros(size(img)); %%150调节显示多少for ii = -5:.1:150 se = strel('line',20,ii)...
2020-04-27 11:42:59
2196
2
原创 matlab实现断开二值化图中的分支
%%通过去除骨架图中的分支点达到断开分支bw = bwmorph(im2bw(I),'skel',inf);figure,imshow(bw);title('骨架提取');bw2 = bwmorph(bw,'spur');figure,imshow(bw2);title('毛刺去除');bw3 = bwmorph(bw2,'branchpoints');figure,imshow(bw...
2020-04-27 11:33:56
880
原创 matlab实现灰度图转rgb图
%%img为灰度图function rgbimg = gray2rgb(img)[rows,cols]=size(img); r=zeros(rows,cols); g=zeros(rows,cols); b=zeros(rows,cols); r=double(img); g=double(img); b=double(img); rgbimg=cat(3,r,g,b);en...
2020-04-27 10:21:06
15185
3
原创 matlab实现图片锐化处理
function img = Sharpening(src)I = src;% 读取rgb图a=1;% model=[0 -2*a 0;-2*a 1+4*a -2*a;0 -2*a 0];[m,n]=size(I);Ig=I;for i=2:m-1 for j=2:n-1 Ig(i,j)=(1+4*a).*I(i,j)-a.*(I(i+1,j)+I(i-1,j...
2020-04-27 10:17:36
1168
原创 matlab实现调整图片的对比度
%src为rgb图像,Contrast为调节的对比度值,调节范围为【-100,100】function img = ContrastAdjust(src,Contrast)Image=double(src);R=Image(:,:,1);G=Image(:,:,2);B=Image(:,:,3);Average=127;%调整参数[-100,100]Contrast=Co...
2020-04-27 10:12:20
5280
原创 matlab实现调整图片的饱和度
%src为rgb图像,saturation为调节的饱和度值,调节范围为【-100,100】function Image_new = SaturationAdjustment(src,saturation)Image=src;Image=double(Image);R=Image(:,:,1);G=Image(:,:,2);B=Image(:,:,3);[row, col] = siz...
2020-04-27 10:07:54
8146
4
原创 matlab实现调节整图片的亮度
%src为rgb图像,light为调节的亮度值,调节范围为【-255,255】function Image_new = Brightness(src,light)Image=double(src);R=Image(:,:,1);G=Image(:,:,2);B=Image(:,:,3);%%%% 求出原始图像亮度分量I=(R+G+B)/3;%%% 利用原始图像的亮度分量结合R,G,...
2020-04-27 10:00:44
7279
1
原创 C# 获取二值化图的骨架图
private void 灰度归一化_Click(object sender, EventArgs e) { //ImgPath = @"C:\Users\Administrator\Desktop\222.jpg"; Image<Bgr, byte> image1 = new Image<Bgr, byte&g...
2020-04-27 09:33:09
436
2
原创 C# emgu 多个算子边缘检测
private void button6_Click(object sender, EventArgs e) { //简单图像处理 Mat src = CvInvoke.Imread(ImgPath, ImreadModes.Color); CvInvoke.CvtColor(src, src, ColorCo...
2019-11-20 13:13:55
220
原创 C# emgu 计算图像的平均亮度
private void button7_Click(object sender, EventArgs e) { Mat src = CvInvoke.Imread(ImgPath, ImreadModes.Color); CvInvoke.CvtColor(src, src, ColorConversion.Rgb2Gray);...
2019-11-20 13:11:58
1704
原创 WPF ScrollViewer中添加可折叠的内容显示框
for (int i = 0; i < 10; i++) { Expander expander = new Expander(); expander.IsExpanded = true; expander.ExpandDirection = ExpandDirection.Dow...
2019-11-12 13:16:25
569
原创 WPF 鼠标右键弹窗修改删除
TextBlock tbx = new TextBlock(); tbx.MouseRightButtonDown += Tbx_MouseRightButtonDown; private void Tbx_MouseRightButtonDown(object sender, MouseButtonEventArgs e) { TextBlock t...
2019-11-12 13:01:43
595
原创 C# emgu画出图片中的轮廓线
public static Bitmap getContours(string imgPath){ Mat src = new Image<Bgr, byte>((Bitmap)Bitmap.FromFile( imgPath)).Mat; Mat dst = new Mat(); //Canny 边缘检测算子 C...
2019-11-12 12:54:27
897
原创 C#删除文件出现文件被占用的解决办法
在这里插入代码片```public void WipeFile(string filename, int timesToWrite) { try { if (File.Exists(filename)) { //设置文件的属性为正...
2019-10-11 11:26:16
2515
3
原创 C# 读取xml文件中节点和子节点的值
private void ReadXml() { XmlDocument doc = new XmlDocument(); //Resources文件夹下加载xml doc.LoadXml(Properties.Resources.XML文件名); //获得根节点 ...
2019-07-18 18:50:21
8504
2
空空如也
TA创建的收藏夹 TA关注的收藏夹
TA关注的人