一区二区三区电影_国产伦精品一区二区三区视频免费_亚洲欧美国产精品va在线观看_国产精品一二三四

聯系我們 - 廣告服務 - 聯系電話:
您的當前位置: > 關注 > > 正文

天天看熱訊:【計算】邊緣水平邊緣豎直邊緣計算 Robert詳解

來源:CSDN 時間:2023-03-02 09:43:35

目錄

計算

邊緣


(資料圖片僅供參考)

水平邊緣

豎直邊緣

計算

Mat src = (Mat_(3, 3) << 1, 2, 3, 4, 5, 6, 7, 8, 9);//X方向—Robert算子Mat imgx;Mat kernel_x = (Mat_(2, 2) << 1, 0, 0, -1);filter2D(src, imgx, -1, kernel_x, Point(-1, -1), 0, 0);Mat imgy;//Y方向—Robert算子Mat kernel_y = (Mat_(2, 2) << 0, 1, -1, 0);filter2D(src, imgy, -1, kernel_y, Point(-1, -1), 0, 0);

src                                                  kernel_x                                    kernel_y

imgx                                                      img_y

image_x值計算:                                                             image_y值計算:

image_x(0, 0) = 1 * 0 + 0 * 0 + 0 * 0 + (-1) * 1 = -1         image_y(0, 0) = 0 * 0 + 1 * 0 + (-1) * 0 +  0 * 1 =0

image_x(0, 1) = 1 * 0 + 0 * 0 + 0 * 1 + (-1) * 2 = -2         image_y(0, 1) = 0 * 0 + 1 * 0 + (-1) * 1 + 0 * 2 = -1

...                                                                                     ...

image_x(1, 1) = 1 * 1 + 0 * 2 + 0 * 4 + (-1) * 5 = -4         image_y(1, 1) = 0 * 1 + 1 * 2 + (-1) * 4 + 0 * 5 = -2

...                                                                                     ...

image_x(2, 2) = 1 * 5 + 0 * 6 + 0 * 8 + (-1) * 9 = -4         image_y(2, 2) = 0 * 5 + 1 * 6 + (-1) * 8 + 0 * 9 = -2

邊緣

Mat src = (Mat_(5, 5) << 1, 2, 3, 4, 5,                         2, 3, 6, 5, 7,                        25, 35, 45, 35, 55,                         7, 8, 9, 10, 11,                         7, 3, 6, 8, 11);//X方向—Robert算子Mat imgx;Mat kernel_x = (Mat_(2, 2) << 1, 0, 0, -1);filter2D(src, imgx, -1, kernel_x, Point(-1, -1), 0, 0);Mat imgy;//Y方向—Robert算子Mat kernel_y = (Mat_(2, 2) << 0, 1, -1, 0);filter2D(src, imgy, -1, kernel_y, Point(-1, -1), 0, 0);

水平邊緣

src

imgx                                                                                       imgy

豎直邊緣

Mat src = (Mat_(5, 5) << 1, 2, 3, 4, 5,                         2, 3, 6, 5, 7,                        25, 35, 45, 35, 55,                         7, 8, 9, 10, 11,                         7, 3, 6, 8, 11);Mat tsrc = src.t();//X方向—Robert算子Mat imgx;Mat kernel_x = (Mat_(2, 2) << 1, 0, 0, -1);filter2D(tsrc, imgx, -1, kernel_x, Point(-1, -1), 0, 0);Mat imgy;//Y方向—Robert算子Mat kernel_y = (Mat_(2, 2) << 0, 1, -1, 0);filter2D(tsrc, imgy, -1, kernel_y, Point(-1, -1), 0, 0);

tsrc

責任編輯:

標簽:

相關推薦:

精彩放送:

新聞聚焦
Top 主站蜘蛛池模板: 临清市| 九江县| 遵化市| 葫芦岛市| 法库县| 上饶县| 大理市| 吉木萨尔县| 绥芬河市| 阳西县| 江陵县| 马公市| 霞浦县| 中阳县| 黑山县| 隆安县| 屏山县| 柳江县| 滁州市| 乐清市| 长宁县| 蒙阴县| 珠海市| 大厂| 泰兴市| 射阳县| 山东省| 秦皇岛市| 紫金县| 山东| 汝城县| 昌图县| 大埔区| 光泽县| 孟村| 焦作市| 尼勒克县| 阿图什市| 陇川县| 桐庐县| 景泰县|