跪求 C语言图像分割和边缘检测 程序

Python018

跪求 C语言图像分割和边缘检测 程序,第1张

clude<stdio.h>

int main()

{

int len=0

int len2=0

FILE* stream

FILE* stream1

FILE* stream2

char buf[50]

char buf1[50]

char buf2[50]

char text[1024]

printf("input anfile path to open:")

scanf("%s",buf)

stream=fopen(buf,"r+")

fseek(stream,0,SEEK_END)

len=ftell(stream)

printf("the file %s length is %d!\n",buf,len)

len2 = len/2

printf("intput 2 file name: \n")

scanf("%s%s",buf1,buf2)

fseek(stream,0,SEEK_SET)

stream1=fopen(buf1,"w+")

stream2=fopen(buf2,"w+")

fread(text,len2,1,stream)

fwrite(text,len2,1,stream1)

fread(text,len-len2,1,stream)

fwrite(text,len-len2,1,stream2)

fclose(stream)

fclose(stream1)

fclose(stream2)

return 0

}

文件合并

#include<stdio.h>

int main()

{

int len=0

int len2=0

FILE* stream

FILE* stream1

char buf[50]

char buf1[50]

char text[1024]

printf("input anfile path to open:")

scanf("%s",buf)

stream=fopen(buf,"r+")

fseek(stream,0,SEEK_END)

printf("intput another file name: \n")

scanf("%s",buf1)

stream1=fopen(buf1,"r+")

fseek(stream1,0,SEEK_END)

len=ftell(stream1)

fseek(stream1,0,SEEK_SET)

fread(text,len,1,stream1)

fwrite(text,len,1,stream)

fclose(stream)

fclose(stream1)

remove(buf1)//remove the another file

return 0

}

需要在程序目录下有文件存在

这个你不能一开始就是用VHDL设计,我做循环频谱处理,给你说过程,也许对你有用,先用matlab仿真,这一步很重要验证你的方法是不是正确的,这也为你后续的VHDL设计测试做铺垫,因为你设计的vhdl代码需要测试数据,那么就从这里来, 第二步,使用c语言编写算法,这一步的工作是让你熟悉图像边缘检测算法的每一个步骤是如何做到的,因为VHDL是电路标书语言,要对每一BIT都要清楚,C语言的过程可以让你在设计VHDL之前就清楚了,最后一步是转换,只有前两个步骤都做好了,你才可以进行VHDL设计。要不然你设计好了VHDL代码,你测试都不知道怎么测试,哪里出错你都不知道,有了C语言的过程,你可以对某一个子模块进行调试。