Colorspace like RGB, HSB, LAB - color-scheme

is there any colorspace like RGB or HSV or LAB with just only one float ?
With i could calculate?
And methods to convert RGV to the float and back ?

There are tons of colorspaces out there. You can find a good matrix of "convert this to that" at Bruce Lindbloom's site.

Related

What do the channels do in CNN?

I am a newbie in CNN and I want to ask what does the channels do in SSD for example? For what reason they exist? For example 18X18X1024 (third number)?
Thanks for any answer.
The dimensions of an image can be represented using 3 numbers. For example, a color image in CIFAR-10 dataset has a height of 32 pixels, width of 32 pixels and is represented as 32 x 32 x 3. Here 3 represents the number of channels in your image. Color images have a channel size of 3 (usually RGB), while a grayscale image will have a channel size of 1.
A CNN will learn features of the images that you feed it, with increasing levels of complexity. These features are represented by the channels. The deeper you go into the network, the more channels you will have that represents these complex features. These features are then used by the network to perform object detection.
In your example, 18X18X1024 means your input image is now represented with 1024 channels, where each channel represents some complex feature/information about the image.
Since you are a beginner, I suggest you look into how CNNs work in general, before diving into object detection. A good start would be image classification using CNNs. I hope this answers your question. Happy learning!! :)

How to extracted 3d models from CIE RGB space

I have a lengthy hexadecimal string data,The data contents are RGB which can stand for X Y Z.Now How can I extracted the 3D model from the RGB color space?OpenCV helps? Or some other library.Now I can come up with a idea.First find the min cube of the colors.Then use scan line to find out the useful points.Then combine the points to surface. Is there a more mature program?
Your data is a cloud of 3D points (COP). The Point Cloud Library - PCL: pointclouds.org offer various tools for processing such data.

How to detect text region in image?

Given an image (i.e. newspaper, scanned newspaper, magazine etc), how do I detect the region containing text? I only need to know the region and remove it, don't need to do text recognition.
The purpose is I want to remove these text areas so that it will speed up my feature extraction procedure as these text areas are meaningless for my application. Anyone know how to do this?
BTW, it will be good if this can be done in Matlab!
Best!
You can use Stroke Width Transform (SWT) to highlight text regions.
Using my mex implementation posted here, you can
img = imread('http://i.stack.imgur.com/Eyepc.jpg');
[swt swtcc] = SWT( img, 0, 10 );
Playing with internal parameters of the edge-map extraction and image filtering in SWT.m can help you tweak the resulting mask to your needs.
To get this result:
I used these parameters for the edge map computation in SWT.m:
edgeMap = single( edge( img, 'canny', [0.05 0.25] ) );
Text detection in natural images is an active area of research in computer vision community. U can refer to ICDAR papers. But in your case I think it should be simple enough. As you have text from newspaper or magazines, it should be of fixed size and horizontally oriented.
So, you can apply scanning window of a fixed size, say 32x32. Train it on ICDAR 2003 training dataset for positive windows having text in it. U can use a small feature set of color and gradients and train an SVM which would give a positive or negative result for a window having text or not.
For reference go to http://crypto.stanford.edu/~dwu4/ICDAR2011.pdf . For code, you can try their homepages
This example in the Computer Vision System Toolbox in Matlab shows how to detect text using MSER regions.
If your image is well binarized and you know the usual size of the text you could use the HorizontalRunLengthSmoothing and VerticalRunLengthSmoothing algorithms. They are implemented in the open source library Aforge.Net but it should be easy to reimplement them in Matlab.
The intersection of the result image from these algorithm will give you a good indication that the region contains text, it is not perfect but it is fast.

[EDITED]Implementing Difference of Gaussian

I'm not sure if I'm doing the right way.
IplImage *dog_1 = cvCreateImage(cvGetSize(oriImg), oriImg->depth, oriImg->nChannels);
IplImage *dog_2 = cvCreateImage(cvGetSize(oriImg), oriImg->depth, oriImg->nChannels);
int kernel2 = 1;
int kernel1 = 5;
cvSmooth(oriImg, dog_2, CV_GAUSSIAN, kernel2, kernel2);
cvSmooth(oriImg, dog_1, CV_GAUSSIAN, kernel1, kernel1);
cvSub(dog_2, dog_1, dst, 0);
Am I doing the right way? Is the above the correct way of doing DOG? I just tried it from the explanation from wiki. But I could not get the desired image like in the wiki page http://en.wikipedia.org/wiki/Difference_of_Gaussians
[Edited]
I quote this from wiki page
"Difference of Gaussians is a grayscale image enhancement algorithm that involves the subtraction of one blurred version of an original grayscale image from another, less blurred version of the original. The blurred images are obtained by convolving the original grayscale image with Gaussian kernels having different standard deviations."
While reading a paper, the DoG image is done by
Original image, I(x,y) -> Blurs -> I1(x,y)
I1(x,y) -> Blurs -> I2(x,y)
output = I2(x,y) - I1(x,y)
As you see it's a slightly different from what I'm doing where I get the I1 and I2 using different kernel from the original image
Which one is the correct one or I misinterpret the meaning in the wiki?
If the image you've attached is your sample output, it doesn't necessarily look wrong. The DoG operation is quite simple: blur with two Gaussians of different sizes and compute the difference image. That appears to be what your code is doing, so I'd say you have it right.
If your worries stem from looking at the Wikipedia article (where the image is predominantly white, rather than black), it is just the inversion of the image that you have. I would not worry about that.

Image scaling in C

I am designing a jpeg to bmp decoder which scales the image. I have been supplied with the source code for the decoder so my actual work is to design a scaler . I do not know where to begin. I have scouted the internet for the various scaling algorithms but am not sure where to introduce the scaling. So should I do the the scaling after the image is converted into bmp or should I do this during the decoding at the MCU level. am confused :(
If you guys have some information to help me out, its appreciated. any material to read, source code to analyse etc....
Oh I forgot to mention one more thing, this is a porting project from the pc platform to a fpga, so, not all the library files are available on the target platform.
There are many ways to scale an image.
The easiest way is to decode the image and then scale using a naive scaling algorithm, something like:
dest_pixel [x,y] = src_pixel [x * x_scale_factor, y * y_scale_factor]
where x/y_scale_factor is
src_size / dest_size
Once you have that working, you can look into more complex scaling systems, things like bilinear filter. For example, the destination pixel is the average of several source pixels when reducing the size and an interpolation of several source pixels when increasing the size.

Resources