Click here to Skip to main content
15,908,111 members
Please Sign up or sign in to vote.
1.00/5 (1 vote)
See more:
C#
void srcn(short int** pd,int* nse,int il,int jl)
{
	int i,j,k,l;
	double std,avg,temp;
	for(i=rn;i<il-rn;i++){
		for(j=rn;j<jl-rn;j++){
			avg=0;
			temp=0;
			std=0;
			for(k=-rn;k<=rn;k++){
				for(l=-rn;l<=rn;l++){
					avg+=(double)pd[i+k][j+l];
				}
			}
			avg=avg/((double)sn*sn);
			for(k=-rn;k<=rn;k++){
				for(l=-rn;l<=rn;l++){
				temp+=((double)pd[i+k][j+l]-avg)*((double)pd[i+k][j+l]-avg);
				}
			}
			std=pow(temp/((double)sn*sn),0.5);
			if(std<c*drt){
				nse[0]++;
			}
			else{
				nse[1]++;
			}
		}
	}
	
}


What I have tried:

I want to convert this code to the Python
Posted
Comments
Richard MacCutchan 29-Feb-16 11:46am    
OK, and what is the problem?
kai jia 29-Feb-16 19:50pm    
how did convert this code to the Python or Verilog,I want to transplant this code to the FPGA,so i must convert this code to the Verilog and then.

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900