Concepts in Image Processing

Image Moment

M p q = d e f ∑ x ∑ y x p y q I ( x , y ) M_{pq}\xlongequal{def}\sum_x \sum_y x^p y^q I(x, y) Mpqdef xyxpyqI(x,y)
so the centroid of image is
( x , y ) = ( M 10 M 00 , M 01 M 00 ) (x,y) = \left( \frac{M_{10}}{M_{00}},\frac{M_{01}}{M_{00}} \right) (x,y)=(M00M10,M00M01)
compute moments in python:

M = cv2.moments(c)

reference: Image moment

Canny Edge Detection

a multi-stage algorithm
  1. Noise Reduction
    • Gaussian Filter
  2. Finding Intensity Gradient of the Image
    1. filter with Sobel Kernel in both horizontal and vertical direction to get first derivative in horizontal direction G x G_x Gx and vetical direcition G y G_y Gy
    2. G = G x 2 + G y 2 θ = arctan ⁡ ( G y G x ) G=\sqrt{G_x^2 + G_y^2} \\ \theta = \arctan \left(\dfrac{G_y}{G_x}\right) G=Gx2+Gy2 θ=arctan(GxGy)
  3. Non-maximum Suppression
  4. Hysteresis Thresholding
    • what is it: Standard and Hysteresis Thresholding
    • We need two threshold values, minVal and maxVal. Any edges with intensity gradient more than maxVal are sure to be edges and those below minVal are sure to be non-edges, so discarded. Those who lie between these two thresholds are classified edges or non-edges based on their connectivity. If they are connected to “sure-edge” pixels, they are considered to be part of edges. Otherwise, they are also discarded.
OpenCV
edges = cv2.Canny(image, 100, 200)

reference: Canny Edge Detection

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 1
    评论
评论 1
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值