# Image Segmentation using Texture and Color
1. [Dependencies](#dependencies)
2. [Algorithm](#algorithm)
3. [Files and Usage](#files-and-usage)
### Citing `imageSegmentation`
Please cite our work if `Image Segmentation using Texture and Color` and our approach helps your research.
```
@Misc{imageSegmentation,
author = {{Dhall*}, A. and {Chandak*} Y.}
title = "{Image Segmentation using Texture and Color}",
howpublished = {\url{https://github.com/ankitdhall/imageSegmentation}},
year = {2015}
}
```
## Dependencies
* OpenCV for C++
## Algorithm
The proposal deals with finding objects of interest in an image. Since, an image may have many objects in different poses; classifiers on the image can’t be run directly. We will first segment the image and extract individual objects. This will help us provide a localized region which can be used as input to the classifier and eventually to identify the object of interest. Based on the low-level features defined, we can narrow down on the possible classifiers to be used.
Most of the available libraries provide functions to perform automatic segmentation based only on watershed, graph cuts and similar methods. These methods don’t take into account the texture properties of the image. For this week, we have analyzed two simple but very critical features of an image: texture and color. We have used these features to implement our own image segmentation algorithm.
First, we implemented a simple way to group similar colored regions together. It is hard to define a distance metric using the RGB color space so we converted the image to HSV color space to facilitate a simple metric to check for color similarity. Random points are selected for region growing. Pixels are clubbed together based on the color similarity metric. Once complete, we obtain a crude segmentation based on color.
Next, we find the gradient direction of individual pixels and group small patches of 20x20 px with overlaps. These patches define the texture pattern of the region by considering the frequency of each gradient direction. Statistical measures such as mean, variance, density and mode are performed on the gradient patches to quantize texture for better comparison. The regions with similar texture are merged using the same technique defined above.
Finally, we combine the above results to get a clearer segmentation of the image. This approach gives better results than the individual results from segmentation based on color or texture alone. But we were unable to define a really good similarity score that would decide when to choose texture similarity and when to consider similarity of color. We are still working on how to combine these results together. Suggestions on how we could tune or redefine the scoring metric are welcome.
The individual texture quantization and color segmentation can be used to improve other building blocks and applications.
## Files and Usage
* main.cpp - contains the initial calls and the final merge function
* color.cpp - performs segmentation based solely on color information of the image
* texture.cpp - performs segmentation based solely on texture information of the image
* histogram.cpp - genetares the histogram of 'Hue' of the image in HSV color space
* header.h - contains the function prototypes
没有合适的资源?快使用搜索试试~ 我知道了~
在 C++ 中 使用纹理和颜色特征进行图像分割_ C++_代码_下载
共7个文件
cpp:4个
h:1个
license:1个
1.该资源内容由用户上传,如若侵权请联系客服进行举报
2.虚拟产品一经售出概不退款(资源遇到问题,请及时私信上传者)
2.虚拟产品一经售出概不退款(资源遇到问题,请及时私信上传者)
版权申诉
5星 · 超过95%的资源 4 下载量 188 浏览量
2022-06-17
10:42:52
上传
评论 1
收藏 12KB ZIP 举报
温馨提示
算法 该提案涉及在图像中查找感兴趣的对象。因为,一张图像可能有许多不同姿势的物体;图像上的分类器不能直接运行。我们将首先分割图像并提取单个对象。这将帮助我们提供一个局部区域,该区域可用作分类器的输入并最终识别感兴趣的对象。基于定义的低级特征,我们可以缩小可能使用的分类器。 大多数可用的库都提供了仅基于分水岭、图形切割和类似方法执行自动分割的功能。这些方法没有考虑图像的纹理属性。本周,我们分析了图像的两个简单但非常关键的特征:纹理和颜色。我们已经使用这些特性来实现我们自己的图像分割算法。 首先,我们实现了一种将相似颜色区域组合在一起的简单方法。使用 RGB 颜色空间很难定义距离度量,因此我们将图像转换为 HSV 颜色空间,以方便使用简单的度量来检查颜色相似性。选择随机点进行区域增长。基于颜色相似性度量将像素组合在一起。完成后,我们获得基于颜色的粗略分割。 接下来,我们找到单个像素的梯度方向,并将重叠的 20x20 像素的小块分组。这些补丁通过考虑每个梯度方向的频率来定义区域的纹理图案。对梯度补丁执行统计测量,如均值、方差、密度和模式,以量化纹理以进行更好的比较。使用上面定义的相同技
资源推荐
资源详情
资源评论
收起资源包目录
imageSegmentation-master.zip (7个子文件)
imageSegmentation-master
histogram.cpp 2KB
color.cpp 5KB
LICENSE 1KB
texture.cpp 8KB
main.cpp 13KB
README.md 3KB
header.h 1KB
共 7 条
- 1
资源评论
- 难受的一批2024-02-09怎么能有这么好的资源!只能用感激涕零来形容TAT...
- guangcheng1232023-05-21资源内容总结地很全面,值得借鉴,对我来说很有用,解决了我的燃眉之急。
- Dghghdg2023-05-22超级好的资源,很值得参考学习,对我启发很大,支持!
- Fri7Qxy2023-01-13非常有用的资源,可以直接使用,对我很有用,果断支持!
快撑死的鱼
- 粉丝: 1w+
- 资源: 9156
下载权益
C知道特权
VIP文章
课程特权
开通VIP
上传资源 快速赚钱
- 我的内容管理 展开
- 我的资源 快来上传第一个资源
- 我的收益 登录查看自己的收益
- 我的积分 登录查看自己的积分
- 我的C币 登录后查看C币余额
- 我的收藏
- 我的下载
- 下载帮助
安全验证
文档复制为VIP权益,开通VIP直接复制
信息提交成功