pbootcms网站模板|日韩1区2区|织梦模板||网站源码|日韩1区2区|jquery建站特效-html5模板网

高斯拉普拉斯算子是用于斑點檢測還是邊緣檢測

Is Laplacian of Gaussian for blob detection or for edge detection?(高斯拉普拉斯算子是用于斑點檢測還是邊緣檢測?)
本文介紹了高斯拉普拉斯算子是用于斑點檢測還是邊緣檢測?的處理方法,對大家解決問題具有一定的參考價值,需要的朋友們下面隨著小編來一起學習吧!

問題描述

以下代碼來自(被要求刪除鏈接).但我想知道它究竟是如何工作的.如果這被認為是邊緣檢測或斑點檢測,我感到很困惑,因為

如果您有一個半徑為 3 且值 1 以內核為中心的斑點,并且背景的值為 0,您將獲得非常強烈(負面)的響應.很清楚為什么如果半徑設置得當它可以進行斑點檢測.

邊緣檢測呢?好吧,它不像 Sobel 算子,它為您提供梯度和對邊緣的強烈響應.Sobel 算子不會為您提供準確的邊緣,因為梯度通常會在幾個像素上上升和下降.您的邊緣將是幾個像素寬.為了使其定位更準確,我們可以在局部找到具有最大(或最小)梯度的像素.這意味著它的二階導數(拉普拉斯算子)應該為零,或者在該點處有一個過零.

您可以看到處理后的圖像既有明帶又有暗帶.過零是邊緣.要在內核中看到這一點,請嘗試手動在內核上滑動一個完美的步進邊緣以查看響應如何變化.

對于你的第二個問題,我想絕對是試圖找到淺色和深色斑點(淺色斑點,深色背景;深色斑點,淺色背景),因為它們分別給出強烈的負面和強烈的正面回應.然后它在每個像素位置找到所有圖像的最大值.對于每個輸出像素,它使用圖像上具有最大響應的像素作為輸出.我認為他的理由是具有強烈沖動(小斑點)的像素是焦點.

他正在使用 bitwise_not 作為復制機制.它將掩碼指定的一些像素設置為源圖像的按位非.最后,您將獲得由來自不同來源的像素組成的 output,但所有這些像素均未按位進行.要恢復真實圖像,只需再次不"它們,如 NOT(NOT(x)) = x.255-x 正是這樣做的.我認為 copyTo 也可以,不確定為什么他選擇了其他方式.

圖片取自 http://fourier.eng.hmc.edu/e161/lectures/gradient/node8.html.

The following code is provided from (was asked to remove the link). But I was wondering how it exactly works. I was confused if this was considered edge detection or blob detection, as Wikipedia list the Laplacian of Gaussian (LoG) as blob detection.

Also, could somebody explain and provide a deeper explanation for why the absolute value is calculated and what is going on in the focus_stack() function?

#   Compute the gradient map of the image
def doLap(image):

    # YOU SHOULD TUNE THESE VALUES TO SUIT YOUR NEEDS
    kernel_size = 5         # Size of the laplacian window
    blur_size = 5           # How big of a kernal to use for the gaussian blur
                            # Generally, keeping these two values the same or very close works well
                            # Also, odd numbers, please...

    blurred = cv2.GaussianBlur(image, (blur_size,blur_size), 0)
    return cv2.Laplacian(blurred, cv2.CV_64F, ksize=kernel_size)

#
#   This routine finds the points of best focus in all images and produces a merged result...
#
def focus_stack(unimages):
    images = align_images(unimages)

    print "Computing the laplacian of the blurred images"
    laps = []
    for i in range(len(images)):
        print "Lap {}".format(i)
        laps.append(doLap(cv2.cvtColor(images[i],cv2.COLOR_BGR2GRAY)))

    laps = np.asarray(laps)
    print "Shape of array of laplacians = {}".format(laps.shape)

    output = np.zeros(shape=images[0].shape, dtype=images[0].dtype)

    abs_laps = np.absolute(laps)
    maxima = abs_laps.max(axis=0)
    bool_mask = abs_laps == maxima
    mask = bool_mask.astype(np.uint8)
    for i in range(0,len(images)):
        output = cv2.bitwise_not(images[i],output, mask=mask[i])

    return 255-output

解決方案

EDIT: Cris Luengo is right. Ignore the part about edge detector.


Laplacian of Gaussian(LoG) can be used as both edge detector and blob detector. I will skip the detailed mathematics and rationale, I think you can read them on a book or some websites here, here and here.

To see why it can be used as both, let's look at its plot and kernel.

If you have a blob with radius of 3 and value 1 centered at the kernel, and the background has value 0, you will have a very strong (negative) response. It is clear why it can do blob detection if the radius is set properly.

How about edge detection? Well it is not like Sobel operator which gives you gradient and strong response for edges. Sobel operator does not give you accurate edges as the gradient usually rise and fall across a few pixels. Your edge would then be several pixels wide. To make it localize more accurate, we can find the pixel with maximum (or minimum) gradient locally. This implies its second derivative (Laplacian) should equal zero, or has a zero-crossing at that point.

You can see the processed image has both a light and dark band. The zero-crossing is the edge. To see this with a kernel, try sliding a perfect step edge across the kernel manually to see how the respond changes.

For you second question, I guess the absolute is trying to find both light and dark blob (light blob, dark background; dark blob, light background) as they gives strong negative and strong positive response respectively. It then find the max across all images at each pixel location. For each output pixel, it uses the pixel at the image with the maximum response as output. I think his rationale is that pixels with strong impulse (small blob) are in-focus.

He is using bitwise_not as a copy mechanism. It sets some pixels, specified by the mask, to the bitwise not of the source image. At the end, you would have output consisting of pixels from different sources, except that all of them have undergone bitwise not. To recover the true image, simply 'NOT' them again, as NOT(NOT(x)) = x. 255-x does exactly that. I think a copyTo would work too, not sure why he chose otherwise.

Images taken from http://fourier.eng.hmc.edu/e161/lectures/gradient/node8.html.

這篇關于高斯拉普拉斯算子是用于斑點檢測還是邊緣檢測?的文章就介紹到這了,希望我們推薦的答案對大家有所幫助,也希望大家多多支持html5模板網!

【網站聲明】本站部分內容來源于互聯網,旨在幫助大家更快的解決問題,如果有圖片或者內容侵犯了您的權益,請聯系我們刪除處理,感謝您的支持!

相關文檔推薦

How to draw a rectangle around a region of interest in python(如何在python中的感興趣區域周圍繪制一個矩形)
How can I detect and track people using OpenCV?(如何使用 OpenCV 檢測和跟蹤人員?)
How to apply threshold within multiple rectangular bounding boxes in an image?(如何在圖像的多個矩形邊界框中應用閾值?)
How can I download a specific part of Coco Dataset?(如何下載 Coco Dataset 的特定部分?)
Detect image orientation angle based on text direction(根據文本方向檢測圖像方向角度)
Detect centre and angle of rectangles in an image using Opencv(使用 Opencv 檢測圖像中矩形的中心和角度)
主站蜘蛛池模板: 山东活动策划|济南活动公司|济南公关活动策划-济南锐嘉广告有限公司 | 【ph计】|在线ph计|工业ph计|ph计厂家|ph计价格|酸度计生产厂家_武汉吉尔德科技有限公司 | 布袋除尘器|除尘器设备|除尘布袋|除尘设备_诺和环保设备 | 模具钢_高速钢_不锈钢-万利钢金属材料 | 免费分销系统 — 分销商城系统_分销小程序开发 -【微商来】 | 磨煤机配件-高铬辊套-高铬衬板-立磨辊套-盐山县宏润电力设备有限公司 | 石栏杆_青石栏杆_汉白玉栏杆_花岗岩栏杆 - 【石雕之乡】点石石雕石材厂 | 齿轮减速机_齿轮减速电机-VEMT蜗轮蜗杆减速机马达生产厂家瓦玛特传动瑞环机电 | 上海办公室装修公司_办公室设计_直营办公装修-羚志悦装 | 砂石生产线_石料生产线设备_制砂生产线设备价格_生产厂家-河南中誉鼎力智能装备有限公司 | 锻造液压机,粉末冶金,拉伸,坩埚成型液压机定制生产厂家-山东威力重工官方网站 | 桥架-槽式电缆桥架-镀锌桥架-托盘式桥架 - 上海亮族电缆桥架制造有限公司 | 天津热油泵_管道泵_天津高温热油泵-天津市金丰泰机械泵业有限公司【官方网站】 | 无尘烘箱_洁净烤箱_真空无氧烤箱_半导体烤箱_电子防潮柜-深圳市怡和兴机电 | 金属波纹补偿器厂家_不锈钢膨胀节价格_非金属伸缩节定制-庆达补偿器 | 活性氧化铝球|氧化铝干燥剂|分子筛干燥剂|氢氧化铝粉-淄博同心材料有限公司 | 定量包装秤,吨袋包装称,伸缩溜管,全自动包装秤,码垛机器人,无锡市邦尧机械工程有限公司 | 能耗监测系统-节能监测系统-能源管理系统-三水智能化 | 超声波清洗机_超声波清洗机设备_超声波清洗机厂家_鼎泰恒胜 | 欧盟ce检测认证_reach检测报告_第三方检测中心-深圳市威腾检验技术有限公司 | 视频直播 -摄影摄像-视频拍摄-直播分发 | 消电检公司,消电检价格,北京消电检报告-北京设施检测公司-亿杰(北京)消防工程有限公司 | 井式炉-台车式回火炉-丹阳市电炉厂有限公司 | 课件导航网_ppt课件_课件模板_课件下载_最新课件资源分享发布平台 | TTCMS自助建站_网站建设_自助建站_免费网站_免费建站_天天向上旗下品牌 | 超声骨密度仪-动脉硬化检测仪器-人体成分分析仪厂家/品牌/价格_南京科力悦 | 检验科改造施工_DSA手术室净化_导管室装修_成都特殊科室建设厂家_医疗净化工程公司_四川华锐 | 河南橡胶接头厂家,河南波纹补偿器厂家,河南可曲挠橡胶软连接,河南套筒补偿器厂家-河南正大阀门 | 昆山PCB加工_SMT贴片_PCB抄板_线路板焊接加工-昆山腾宸电子科技有限公司 | 空气能采暖,热泵烘干机,空气源热水机组|设备|厂家,东莞高温热泵_正旭新能源 | 365文案网_全网创意文案句子素材站 | 合肥地磅_合肥数控切割机_安徽地磅厂家_合肥世佳电工设备有限公司 | 哈希PC1R1A,哈希CA9300,哈希SC4500-上海鑫嵩实业有限公司 | 水稻烘干机,小麦烘干机,大豆烘干机,玉米烘干机,粮食烘干机_巩义市锦华粮食烘干机械制造有限公司 水环真空泵厂家,2bv真空泵,2be真空泵-淄博真空设备厂 | 定制防伪标签_防伪标签印刷_防伪标签厂家-510品保防伪网 | 宜兴市恺瑞德环保科技有限公司| 沈阳庭院景观设计_私家花园_别墅庭院设计_阳台楼顶花园设计施工公司-【沈阳现代时园艺景观工程有限公司】 | 碳纤维布-植筋胶-灌缝胶-固特嘉加固材料公司 | 超声波焊接机,振动摩擦焊接机,激光塑料焊接机,超声波焊接模具工装-德召尼克(常州)焊接科技有限公司 | 选宝石船-陆地水上开采「精选」色选机械设备-青州冠诚重工机械有限公司 | 数显恒温培养摇床-卧式/台式恒温培养摇床|朗越仪器 |