--- layout: default title: 02. Gabor Filter subtitle: Image Processing --- ----- [PINBlog Gitea Repository](https://gitea.pinblog.codes/CBNU/02_GaborFilter) ----- # Gabor Filter - »ê¾÷ÀΰøÁö´ÉÇаú ´ëÇпø 2022254026 ±èÈ«¿­ --- # **Gabor Filter¶õ?** Gabor Filter´Â ¿µ»ó󸮿¡¼­ Bio-inspired¶ó´Â Å°¿öµå°¡ ÀÖÀ¸¸é ºüÁöÁö¾Ê°í µîÀåÇÑ´Ù. ¿Ü°û¼±À» °ËÃâÇÏ´Â ±â´ÉÀ» ÇÏ´Â ÇÊÅÍ·Î, »ç¶÷ÀÇ ½Ã°¢Ã¼°è°¡ ¹ÝÀÀÇÏ´Â °Í°ú ºñ½ÁÇÏ´Ù´Â ÀÌÀ¯·Î ³Î¸® »ç¿ëµÇ°í ÀÖ´Ù. Gabor Fiter´Â °£´ÜÈ÷ ¸»Çؼ­ »çÀÎ ÇÔ¼ö·Î ¸ðµâ·¹ÀÌ¼Ç µÈ Gaussian Filter¶ó°í »ý°¢ÇÒ ¼ö ÀÖ´Ù. ÆĶó¹ÌÅ͸¦ Á¶ÀýÇÔ¿¡ µû¶ó EdgeÀÇ Å©±â³ª ¹æÇ⼺À» ¹Ù²Ü ¼ö ÀÖÀ¸¹Ç·Î Bio-inspired ¿µ»óó¸® ¾Ë°í¸®Áò¿¡¼­ Ư¡Á¡ ÃßÃâ ¾Ë°í¸®ÁòÀ¸·Î ÇÙ½ÉÀûÀÎ ¿ªÇÒÀ» ÇÏ°í ÀÖ´Ù. 2D Gabor FilterÀÇ ¼ö½ÄÀº ¾Æ·¡¿Í °°´Ù. ![gaborfilter](./images/gaborfilter.png) ![gaborfilter](./images/gaborfilter2.png) ![gaborfilter](./images/gaborfilter3.png) ```cpp cv::Mat cv::getGaborKernel(cv::Size ksize, double sigma, double theta, double lambd, double gamma, double psi = CV_PI*0.5, int ktype = CV_64F) ``` cv::getGaborKernel ÇÔ¼ö´Â OpenCV¿¡¼­ °¡¹öÇÊÅÍ(Gabor filter)¸¦ »ý¼ºÇÏ´Â µ¥ »ç¿ëµÈ´Ù. °¡¹öÇÊÅÍ´Â À̹ÌÁö ó¸®¿Í ÄÄÇ»ÅÍ ºñÀü¿¡¼­ ƯÁ¤ ¹æÇ⼺°ú ÁÖÆļöÀÇ Æ¯Â¡À» °­Á¶ÇÏ´Â µ¥ »ç¿ëµÇ´Â ¼±Çü ÇÊÅÍÀÌ´Ù. ### **Parameters** * ksize: Ä¿³ÎÀÇ Å©±â·Î, cv::Size ŸÀÔ. Ä¿³ÎÀÇ ³Êºñ¿Í ³ôÀ̸¦ ÁöÁ¤. * sigma: °¡¿ì½Ã¾È ÇÔ¼öÀÇ Ç¥ÁØ ÆíÂ÷. °ªÀÌ Ä¿Áú¼ö·Ï Ä¿³ÎÀÇ Å©±â°¡ Ä¿Áö°í, ÇÊÅÍÀÇ °¨µµ°¡ ³·¾ÆÁø´Ù. * theta: ÇÊÅÍÀÇ ¹æÇâÀ» ¶óµð¾È ´ÜÀ§·Î ÁöÁ¤ÇÑ´Ù. 0Àº ¼öÆò ¹æÇâ, CV_PI/2´Â ¼öÁ÷ ¹æÇâÀ» ÀǹÌÇÑ´Ù. * lambd: °¡¹öÇÊÅÍÀÇ ÆÄÀå. À̹ÌÁöÀÇ Æ¯Á¤ ÆÐÅÏ°ú ¾ó¸¶³ª Àß ¸ÅÄ¡ÇÒÁö¸¦ °áÁ¤ÇÑ´Ù. * gamma: °ø°£Á¾È¾ºñ(Spatial aspect ratio)·Î, Ÿ¿øÇü °¡¹ö ÇÔ¼öÀÇ Å¸¿ø¼ºÀ» °áÁ¤ÇÑ´Ù. (gamma=1Àº ¿øÇü, gamma<1Àº Ÿ¿øÇü) * psi: À§»óº¯À§(Phase offset)·Î, °¡¹ö ÇÊÅÍÀÇ À§»óÀ» Á¶ÀýÇÑ´Ù. (ÀϹÝÀûÀ¸·Î CV_PI*0.5°¡ ±âº»°ªÀ¸·Î »ç¿ë) * ktype: Ä¿³Î ŸÀÔ. (º¸Åë CV_64F (64-ºñÆ® ºÎµ¿¼Ò¼öÁ¡)¸¦ »ç¿ë) --- ### ¿¹Á¦ À¥ÆäÀÌÁö[¢Ò]() [Gabor Filter WebPage](https://gaborfilter.pinblog.codes/) * Blazor-OpenCVSharp·Î ±¸ÇöÇÏ¿© °³ÀÎ NAS À¥¼­¹ö·Î ±¸µ¿ Áß * OpenCVSharp-WASMÀÌ ºÒ¾ÈÁ¤ÇÏ¿© ½ÇÁ¦ À¥¼­¹ö¿¡¼­´Â Á¤»óÀûÀ¸·Î µ¿ÀÛÇÏÁö ¾ÊÀ½ * Local¿¡¼­ Debug/Release·Î ºôµå ½Ã, Á¤»óÀûÀ¸·Î µ¿ÀÛÇÔ ![output1](./images/output1.png) ![output2](./images/output2.png) --- ### Âü°í[¢Ò]() - Gabor Filter - Google - ChatGPT - [Blog](https://thinkpiece.tistory.com/304)