{"id":8265,"date":"2024-06-16T12:01:01","date_gmt":"2024-06-16T04:01:01","guid":{"rendered":""},"modified":"2024-06-16T12:01:01","modified_gmt":"2024-06-16T04:01:01","slug":"\u9ad8\u65af\u6a21\u7cca\u53c2\u6570\u600e\u4e48\u8c03_\u56fe\u50cf\u7f16\u7a0b","status":"publish","type":"post","link":"https:\/\/mushiming.com\/8265.html","title":{"rendered":"\u9ad8\u65af\u6a21\u7cca\u53c2\u6570\u600e\u4e48\u8c03_\u56fe\u50cf\u7f16\u7a0b"},"content":{"rendered":"
\u751f\u6210\u7ed3\u679c\uff1a<\/p>\n
<\/p>\n
\u4ee3\u7801\u5982\u4e0b\uff1a<\/p>\n
private void creategaos_Click(object sender, EventArgs e)
{
\n
\/\/\u751f\u6210\u4e8c\u7ef4\u9ad8\u65af\u6ee4\u6ce2\u7cfb\u6570\/\/
int nWidowSize = 3;
\/\/ double nSigma = 0.4;
double nSigma = 1.0;
\/\/ double nSigma = 1.4;
\/\/ double* pdKernal_2 = new double[nWidowSize*nWidowSize]; \/\/\u5b9a\u4e49\u4e8c\u7ef4\u9ad8\u65af\u6838\u6570\u7ec4
double[] pdKernal_2 = new double[3 * 3];
double dSum_2 = 0.0; \/\/\u6c42\u548c\uff0c\u8fdb\u884c\u5f52\u4e00\u5316
\/\/\/\u4e8c\u7ef4\u9ad8\u65af\u51fd\u6570\u516c\u5f0f
x*x+y*y \/\/\/
-1*-------------- \/\/\/
1 2*nSigma*nSigma \/\/\/
---------------- e \/\/\/
2*pi*nSigma*nSigma \/\/\/
\/\/\/
int nCenter = (nWidowSize) \/ 2;
for (int i = 0; i < nWidowSize; i++)
{
\n
for (int j = 0; j < nWidowSize; j++)
{
\n
int nDis_x = i - nCenter;
int nDis_y = j - nCenter;
double temp= (nDis_x * nDis_x + nDis_y * nDis_y);
double \u6307\u6570 = Math.Exp(-(1 \/ 2.0) * temp \/ (nSigma * nSigma));
pdKernal_2[i + j * nWidowSize] = \u6307\u6570 \/ (2 * 3. * nSigma * nSigma);
dSum_2 += pdKernal_2[i + j * nWidowSize];
}
}
for (int i = 0; i < nWidowSize; i++)
{
\n
for (int j = 0; j < nWidowSize; j++) \/\/\u8fdb\u884c\u5f52\u4e00\u5316
{
\n
pdKernal_2[i + j * nWidowSize] \/= dSum_2;
}
}<\/p>\n
}<\/p>\n
\u6211\u4eec\u5e38\u7528\u7684\u9ad8\u65af\u6a21\u677f\u662f\uff08\u5de6\uff09\uff0c\u5bf9\u6bd4\u6211\u4eec\u653e\u5927100\u7684\u7a0b\u5e8f\u751f\u6210\u7ed3\u679c\uff08\u53f3\uff09\uff1a<\/p>\n
<\/p>\n
\u6211\u60f3\uff0c\u7528\u53f3\u8fb9\u7684gaos\u751f\u6210\u64cd\u4f5c\u50cf\u7d20\uff0c\u5e94\u8be5\u4e5f\u662f\u53ef\u4ee5\u7684\uff0c\u8bd5\u4e00\u8bd5\uff1f<\/p>\n
\u5bf9\u4e00\u4e2a\u50cf\u7d20buffer[i*w+h]\u64cd\u4f5c\u5982\u4e0b\uff1a<\/p>\n
int n0 = (j * w + i);
gaosbuffer[n0] = (byte)((7*buffer[n0 - w - 1] + 12 * buffer[n0 - w] +7* buffer[n0 - w + 1] +
12 * buffer[n0 - 1] + 20 * buffer[n0] + 12 * buffer[n0 + 1] +
7*buffer[n0 + w - 1] + 12 * buffer[n0 + w] + 7*buffer[n0 + w + 1]) \/ 100);<\/p>\n
<\/p>\n","protected":false},"excerpt":{"rendered":"\u9ad8\u65af\u6a21\u7cca\u53c2\u6570\u600e\u4e48\u8c03_\u56fe\u50cf\u7f16\u7a0b\u751f\u6210\u7ed3\u679c\uff1a\u4ee3\u7801\u5982\u4e0b\uff1aprivatevoidcreategaos_Click(objectsender,EventArgse){\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/...","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[],"tags":[],"_links":{"self":[{"href":"https:\/\/mushiming.com\/wp-json\/wp\/v2\/posts\/8265"}],"collection":[{"href":"https:\/\/mushiming.com\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/mushiming.com\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/mushiming.com\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/mushiming.com\/wp-json\/wp\/v2\/comments?post=8265"}],"version-history":[{"count":0,"href":"https:\/\/mushiming.com\/wp-json\/wp\/v2\/posts\/8265\/revisions"}],"wp:attachment":[{"href":"https:\/\/mushiming.com\/wp-json\/wp\/v2\/media?parent=8265"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/mushiming.com\/wp-json\/wp\/v2\/categories?post=8265"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/mushiming.com\/wp-json\/wp\/v2\/tags?post=8265"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}