Color image detection in image

I have an image that is a depth map that I filtered further than the first 25% of the image.

It looks something like this: enter image description here

There are two color images in the image, one is my hand (with a part of my face behind it), and the other is a table in the lower left corner. How can I find an image to find these drops? I would like to be able to draw a rectangle around them, if possible.

I can also do this (ignore shades and filter on black or white): enter image description here

+8
c # image-processing nui
source share
5 answers

This may be redundant for what you need, but there is a great c # shell for OpenCV libraries.

I have successfully used OpenCV in C ++ to detect blob, so you may find it useful for what you are trying to do.

http://www.emgu.com/wiki/index.php/Main_Page

and wiki page on OpenCV:

http://en.wikipedia.org/wiki/OpenCV

Edited to add: Here is the blobs detection library for Emgu in C #. There are even some nice features of arranging the drop in the downward region (useful for filtering noise).

http://www.emgu.com/forum/viewtopic.php?f=3&t=205

Change again:

If Emgu is too heavy, Aforge.NET also includes some blob detection methods.

http://www.aforgenet.com/framework/

+2
source share

Select a random pixel as the starting pixel. This becomes region A. Extend A repeatedly until A becomes larger. This is your area.

The extension method of A is to search for neighboring pixels in A, so that they have the same color for at least one neighboring pixel in A.

What "similar color" means to you is somewhat variable. If you can make exactly two colors, as you say in another answer, then โ€œsimilarโ€ is โ€œequalโ€. Otherwise, โ€œlikeโ€ will mean colors that have RGB values โ€‹โ€‹or not everything, where each component of the two colors is in small numbers from each other (that is, 255, 128, 128 is similar to 252, 125, 130).

You can also limit the selected pixels to look like a seed pixel, but this works better when a person selects a seed. (I believe that this is what is done in Photoshop, for example.)

This may be better than edge detection, because you can deal with gradients without filtering them out of existence, and you do not need to process the resulting detected edges in a consistent area. The disadvantage is that the gradient can go all the way from black to white, and it will register as the same area, but it may be what you want. In addition, you must be careful with the implementation, otherwise it will be too slow.

+3
source share

If the image really represents only two or more different colors (very little blurring between the colors), this is a simple case for detecting edge> algorithm.

+2
source share

You can use something like sample code from this question: find color in image in C #

This will help you find the x / y of certain colors in your image. Then you can use min x / max x and min y / max y to draw your rectangles.

+1
source share

Detecting an object from an image based on the color of the object using C #

To detect an object based on its color, there is a simple algorithm for this. You must choose a filtering method. Steps usually

Take an image Apply ur filtering Apply sacking to subtract the background and get ur objects find all the positions of the objects to mark the objects First you need to select a filtering method, there are many filtering methods provided for C #. basically I prefer filters with forfor, for this they have few filters that they

ColorFiltering ChannelFiltering HSLFiltering YCbCrFiltering EuclideanColorFiltering my favorite is EuclideanColorFiltering, it's easy and simple. for other filtering you can find out more about them here. U need to download Aforge dll for use in ur code. More information on the exact steps can be found here: Link

0
source share

All Articles