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

圖像處理:'Coca-Cola Can' 識(shí)別的算法改進(jìn)

Image Processing: Algorithm Improvement for #39;Coca-Cola Can#39; Recognition(圖像處理:Coca-Cola Can 識(shí)別的算法改進(jìn))
本文介紹了圖像處理:'Coca-Cola Can' 識(shí)別的算法改進(jìn)的處理方法,對(duì)大家解決問題具有一定的參考價(jià)值,需要的朋友們下面隨著小編來一起學(xué)習(xí)吧!

問題描述

過去幾年我參與過的最有趣的項(xiàng)目之一是關(guān)于 庫在 C++ 中完成.

預(yù)處理:對(duì)于圖像預(yù)處理,即將圖像轉(zhuǎn)換為更原始的形式以提供給算法,我使用了兩種方法:

  1. 將顏色域從 RGB 更改為 在 2 個(gè)先行步驟后獲取所有項(xiàng)目的輪廓.

算法:我為此任務(wù)選擇的算法本身取自 (SIFT) 或

  • 獨(dú)特的圖像特征來自尺度不變的關(guān)鍵點(diǎn)
  • ORB:SIFT 或 SURF 的有效替代方案
  • One of the most interesting projects I've worked on in the past couple of years was a project about image processing. The goal was to develop a system to be able to recognize Coca-Cola 'cans' (note that I'm stressing the word 'cans', you'll see why in a minute). You can see a sample below, with the can recognized in the green rectangle with scale and rotation.

    Some constraints on the project:

    • The background could be very noisy.
    • The can could have any scale or rotation or even orientation (within reasonable limits).
    • The image could have some degree of fuzziness (contours might not be entirely straight).
    • There could be Coca-Cola bottles in the image, and the algorithm should only detect the can!
    • The brightness of the image could vary a lot (so you can't rely "too much" on color detection).
    • The can could be partly hidden on the sides or the middle and possibly partly hidden behind a bottle.
    • There could be no can at all in the image, in which case you had to find nothing and write a message saying so.

    So you could end up with tricky things like this (which in this case had my algorithm totally fail):

    I did this project a while ago, and had a lot of fun doing it, and I had a decent implementation. Here are some details about my implementation:

    Language: Done in C++ using OpenCV library.

    Pre-processing: For the image pre-processing, i.e. transforming the image into a more raw form to give to the algorithm, I used 2 methods:

    1. Changing color domain from RGB to HSV and filtering based on "red" hue, saturation above a certain threshold to avoid orange-like colors, and filtering of low value to avoid dark tones. The end result was a binary black and white image, where all white pixels would represent the pixels that match this threshold. Obviously there is still a lot of crap in the image, but this reduces the number of dimensions you have to work with.
    2. Noise filtering using median filtering (taking the median pixel value of all neighbors and replace the pixel by this value) to reduce noise.
    3. Using Canny Edge Detection Filter to get the contours of all items after 2 precedent steps.

    Algorithm: The algorithm itself I chose for this task was taken from this awesome book on feature extraction and called Generalized Hough Transform (pretty different from the regular Hough Transform). It basically says a few things:

    • You can describe an object in space without knowing its analytical equation (which is the case here).
    • It is resistant to image deformations such as scaling and rotation, as it will basically test your image for every combination of scale factor and rotation factor.
    • It uses a base model (a template) that the algorithm will "learn".
    • Each pixel remaining in the contour image will vote for another pixel which will supposedly be the center (in terms of gravity) of your object, based on what it learned from the model.

    In the end, you end up with a heat map of the votes, for example here all the pixels of the contour of the can will vote for its gravitational center, so you'll have a lot of votes in the same pixel corresponding to the center, and will see a peak in the heat map as below:

    Once you have that, a simple threshold-based heuristic can give you the location of the center pixel, from which you can derive the scale and rotation and then plot your little rectangle around it (final scale and rotation factor will obviously be relative to your original template). In theory at least...

    Results: Now, while this approach worked in the basic cases, it was severely lacking in some areas:

    • It is extremely slow! I'm not stressing this enough. Almost a full day was needed to process the 30 test images, obviously because I had a very high scaling factor for rotation and translation, since some of the cans were very small.
    • It was completely lost when bottles were in the image, and for some reason almost always found the bottle instead of the can (perhaps because bottles were bigger, thus had more pixels, thus more votes)
    • Fuzzy images were also no good, since the votes ended up in pixel at random locations around the center, thus ending with a very noisy heat map.
    • In-variance in translation and rotation was achieved, but not in orientation, meaning that a can that was not directly facing the camera objective wasn't recognized.

    Can you help me improve my specific algorithm, using exclusively OpenCV features, to resolve the four specific issues mentioned?

    I hope some people will also learn something out of it as well, after all I think not only people who ask questions should learn. :)

    解決方案

    An alternative approach would be to extract features (keypoints) using the scale-invariant feature transform (SIFT) or Speeded Up Robust Features (SURF).

    You can find a nice OpenCV code example in Java, C++, and Python on this page: Features2D + Homography to find a known object

    Both algorithms are invariant to scaling and rotation. Since they work with features, you can also handle occlusion (as long as enough keypoints are visible).

    Image source: tutorial example

    The processing takes a few hundred ms for SIFT, SURF is bit faster, but it not suitable for real-time applications. ORB uses FAST which is weaker regarding rotation invariance.

    The original papers

    • SURF: Speeded Up Robust Features
    • Distinctive Image Features from Scale-Invariant Keypoints
    • ORB: an efficient alternative to SIFT or SURF

    這篇關(guān)于圖像處理:'Coca-Cola Can' 識(shí)別的算法改進(jìn)的文章就介紹到這了,希望我們推薦的答案對(duì)大家有所幫助,也希望大家多多支持html5模板網(wǎng)!

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

    相關(guān)文檔推薦

    What is the fastest way to transpose a matrix in C++?(在 C++ 中轉(zhuǎn)置矩陣的最快方法是什么?)
    Sorting zipped (locked) containers in C++ using boost or the STL(使用 boost 或 STL 在 C++ 中對(duì)壓縮(鎖定)容器進(jìn)行排序)
    Rotating a point about another point (2D)(圍繞另一個(gè)點(diǎn)旋轉(zhuǎn)一個(gè)點(diǎn) (2D))
    How do I construct an ISO 8601 datetime in C++?(如何在 C++ 中構(gòu)建 ISO 8601 日期時(shí)間?)
    Sort list using STL sort function(使用 STL 排序功能對(duì)列表進(jìn)行排序)
    Is list::size() really O(n)?(list::size() 真的是 O(n) 嗎?)
    主站蜘蛛池模板: 在线钠离子分析仪-硅酸根离子浓度测定仪-油液水分测定仪价格-北京时代新维测控设备有限公司 | 鑫铭东办公家具一站式定制采购-深圳办公家具厂家直销 | 博客-悦享汽车品质生活| 服务器之家 - 专注于服务器技术及软件下载分享 | 河南包装袋厂家_河南真空袋批发价格_河南服装袋定制-恒源达包装制品 | 定制液氮罐_小型气相液氮罐_自增压液氮罐_班德液氮罐厂家 | 曙光腾达官网-天津脚手架租赁-木板架出租-移动门式脚手架租赁「免费搭设」 | 震动筛选机|震动分筛机|筛粉机|振筛机|振荡筛-振动筛分设备专业生产厂家高服机械 | 新车测评网_网罗汽车评测资讯_汽车评测门户报道 | 合景一建-无尘车间设计施工_食品医药洁净车间工程装修总承包公司 | 仿古瓦,仿古金属瓦,铝瓦,铜瓦,铝合金瓦-西安东申景观艺术工程有限公司 | 阿里巴巴诚信通温州、台州、宁波、嘉兴授权渠道商-浙江联欣科技提供阿里会员办理 | 菏泽商标注册_菏泽版权登记_商标申请代理_菏泽商标注册去哪里 | 滚筒烘干机_转筒烘干机_滚筒干燥机_转筒干燥机_回转烘干机_回转干燥机-设备生产厂家 | 宿舍管理系统_智慧园区系统_房屋/房产管理系统_公寓管理系统 | 蜂窝块状沸石分子筛-吸附脱硫分子筛-萍乡市捷龙环保科技有限公司 | 披萨石_披萨盘_电器家电隔热绵加工定制_佛山市南海区西樵南方综合保温材料厂 | 东莞画册设计_logo/vi设计_品牌包装设计 - 华略品牌设计公司 | 量子管通环-自清洗过滤器-全自动反冲洗过滤器-沼河浸过滤器 | 防爆型气象站_农业气象站_校园气象站_农业四情监测系统「山东万象环境科技有限公司」 | 仓储笼_仓储货架_南京货架_仓储货架厂家_南京货架价格低-南京一品仓储设备制造公司 | 塑料撕碎机_编织袋撕碎机_废纸撕碎机_生活垃圾撕碎机_废铁破碎机_河南鑫世昌机械制造有限公司 | 南汇8424西瓜_南汇玉菇甜瓜-南汇水蜜桃价格 | 鲁网 - 山东省重点新闻网站,山东第一财经门户 | 昆明化妆培训-纹绣美甲-美容美牙培训-昆明博澜培训学校 | 江苏皓越真空设备有限公司| 无线对讲-无线对讲系统解决方案-重庆畅博通信 | 数控走心机-走心机价格-双主轴走心机-宝宇百科| 耐酸碱胶管_耐腐蚀软管总成_化学品输送软管_漯河利通液压科技耐油耐磨喷砂软管|耐腐蚀化学软管 | 钢绞线万能材料试验机-全自动恒应力两用机-混凝土恒应力压力试验机-北京科达京威科技发展有限公司 | 天津散热器_天津暖气片_天津安尼威尔散热器制造有限公司 | 移动厕所租赁|移动卫生间|上海移动厕所租赁-家瑞租赁 | 郑州外墙清洗_郑州玻璃幕墙清洗_郑州开荒保洁-河南三恒清洗服务有限公司 | 蓄电池回收,ups电池后备电源回收,铅酸蓄电池回收,机房电源回收-广州益夫铅酸电池回收公司 | 专注提供国外机电设备及配件-工业控制领域一站式服务商-深圳市华联欧国际贸易有限公司 | 电动葫芦-河北悍象起重机械有限公司 | 烘干设备-热泵烘干机_广东雄贵能源设备有限公司 | 深圳美安可自动化设备有限公司,喷码机,定制喷码机,二维码喷码机,深圳喷码机,纸箱喷码机,东莞喷码机 UV喷码机,日期喷码机,鸡蛋喷码机,管芯喷码机,管内壁喷码机,喷码机厂家 | 武汉高低温试验箱_恒温恒湿试验箱厂家-武汉蓝锐环境科技有限公司 | 谈股票-今日股票行情走势分析-牛股推荐排行榜 | 有机废气处理-rto焚烧炉-催化燃烧设备-VOC冷凝回收装置-三梯环境 |