MATLAB Answers^{™}

- 3 questions
- 0 answers
- 0 accepted answers
- Reputation: 0

- 0 questions
- 0 answers
- 0 accepted answers
- Reputation: 0

Accepted Answer by Image Analyst

- 0 questions
- 16,981 answers
- 5,488 accepted answers
- Reputation: 27,580

Hi, everybody. I am working on image processing of candle to find the length of the candle, flame and wick(Thread between candle and flame). Using gray scale image,In lab view, the parts of candle and flame are recognized but unable to find the length of the wick. For this I need to use color segmentation (math script)to recognize each part in the image. Could anyone suggest me a method for the above. Thanks in advance.

- 0 questions
- 16,981 answers
- 5,488 accepted answers
- Reputation: 27,580

**Direct link to this answer:**

http://www.mathworks.com/matlabcentral/answers/57813#answer_69973

Answer by Image Analyst
on 3 Jan 2013

- 0 questions
- 16,981 answers
- 5,488 accepted answers
- Reputation: 27,580

Accepted answer

Maybe you should try labview forums. This forum is just for MATLAB.

Show 34 older comments

Link

**Direct link to this comment:**

http://www.mathworks.com/matlabcentral/answers/57813#comment_120364

Thanks for your reply. I am looking for Image color segmentation in mat lab. Thank you.

Link

**Direct link to this comment:**

http://www.mathworks.com/matlabcentral/answers/57813#comment_120371

Link

**Direct link to this comment:**

http://www.mathworks.com/matlabcentral/answers/57813#comment_120437

http://inputcandle.blogspot.se/2013/01/hi-this-is-input-image.html

Hi, thanks for your reply. The above link shows the input image. for this image I need to segment the candle, flame and wick (thread between flame and candle) After segmentation the image should show three different parts. .

please suggest me a method. Thanks in advance.

Link

**Direct link to this comment:**

http://www.mathworks.com/matlabcentral/answers/57813#comment_120439

Link

**Direct link to this comment:**

http://www.mathworks.com/matlabcentral/answers/57813#comment_120444

Link

**Direct link to this comment:**

http://www.mathworks.com/matlabcentral/answers/57813#comment_120452

Link

**Direct link to this comment:**

http://www.mathworks.com/matlabcentral/answers/57813#comment_120461

Thank you. I will try with you suggestion. It's a part of my masters thesis work.

Link

**Direct link to this comment:**

http://www.mathworks.com/matlabcentral/answers/57813#comment_120869

Hi. http://www.blogger.com/blogger.g?blogID=3341042874737247183#allposts

The above method gives the length of the wick. But here i am using this in real time where I need to segment all the three objects. Finally I need to measure different parameters while the candle melts.The above link contains an image which was taken by using usb camera. In this image we can see the wick(Thread between candle and flame). I cannot detect the edges clearly. I have used all the filters but wasn't able to detect the edges of the three objects.could you please help me how to segment this.

Link

**Direct link to this comment:**

http://www.mathworks.com/matlabcentral/answers/57813#comment_120874

Link

**Direct link to this comment:**

http://www.mathworks.com/matlabcentral/answers/57813#comment_120884

Hi can you please tell me how to upload an image directly without using blogger.

Link

**Direct link to this comment:**

http://www.mathworks.com/matlabcentral/answers/57813#comment_120886

Try someplace like tinypic.com. Or see this link.

Link

**Direct link to this comment:**

http://www.mathworks.com/matlabcentral/answers/57813#comment_120895

Hi here is the link for the image from tinypic. http://tinypic.com/view.php?pic=b9hgd0&s=6

Here I am explaining my whole project clearly. I need to create a setup for a candle and measure various parameters during the melting process until it melts completely. I have created a VI in lab view which gives the parameters when an image is read. But that VI is working only for gray scale images and color segmentation can't be done. I need to segment the three objects and then I can call this M-file to lab view. Hope you understand my problem.

Link

**Direct link to this comment:**

http://www.mathworks.com/matlabcentral/answers/57813#comment_120896

**a lot** easier.

Link

**Direct link to this comment:**

http://www.mathworks.com/matlabcentral/answers/57813#comment_120899

Link

**Direct link to this comment:**

http://www.mathworks.com/matlabcentral/answers/57813#comment_120902

Link

**Direct link to this comment:**

http://www.mathworks.com/matlabcentral/answers/57813#comment_121221

http://tinypic.com/r/2e2mcdu/6

Hi, the above link shows an example image with blue back ground.I need to do color segmentation to find the length of the wick. can you please suggest a method. If it works then i can take an image from real world and test it. thank you.

Link

**Direct link to this comment:**

http://www.mathworks.com/matlabcentral/answers/57813#comment_121225

Link

**Direct link to this comment:**

http://www.mathworks.com/matlabcentral/answers/57813#comment_121257

http://tinypic.com/r/334u55c/6

Hi, the above link shows an image of a candle with light green(paper) background. can you suggest a method to segment.

Link

**Direct link to this comment:**

http://www.mathworks.com/matlabcentral/answers/57813#comment_121260

Yes! Much, much better. Simply extract all three color channels:

% Extract the individual red, green, and blue color channels. redChannel = rgbImage(:, :, 1); greenChannel = rgbImage(:, :, 2); blueChannel = rgbImage(:, :, 3);

Find where all three channels are dark

thresholdValue = 20; % Whatever... wick = (redChannel < thresholdValue) & ... greenChannel < thresholdValue) & ... blueChannel < thresholdValue);

Link

**Direct link to this comment:**

http://www.mathworks.com/matlabcentral/answers/57813#comment_121267

Link

**Direct link to this comment:**

http://www.mathworks.com/matlabcentral/answers/57813#comment_121269

Link

**Direct link to this comment:**

http://www.mathworks.com/matlabcentral/answers/57813#comment_121316

Link

**Direct link to this comment:**

http://www.mathworks.com/matlabcentral/answers/57813#comment_121640

Link

**Direct link to this comment:**

http://www.mathworks.com/matlabcentral/answers/57813#comment_121641

Link

**Direct link to this comment:**

http://www.mathworks.com/matlabcentral/answers/57813#comment_121696

Link

**Direct link to this comment:**

http://www.mathworks.com/matlabcentral/answers/57813#comment_121718

Did I not say how to use values? Like

blackWickPixels = valueImage < 20; % or whatever value works. candlePixels = valueImage>200 & saturationImage< 20;

Yes you have confused me. If you don't mean like the above, then what do you mean when you ask how you are supposed to use the values?

Link

**Direct link to this comment:**

http://www.mathworks.com/matlabcentral/answers/57813#comment_122176

I am sorry. finally i got the desired result. credit goes to you and thank you.

Link

**Direct link to this comment:**

http://www.mathworks.com/matlabcentral/answers/57813#comment_124297

Link

**Direct link to this comment:**

http://www.mathworks.com/matlabcentral/answers/57813#comment_124303

Link

**Direct link to this comment:**

http://www.mathworks.com/matlabcentral/answers/57813#comment_127867

Hi, when the above segmentation is working for 1 image, but in real time, I am not able to achieve the segmentation. I need to take several images while the candle is burning down and every time I have to change the threshold values for each image.This is becoming complex and uneasy to distinguish the images. could you please help me with any logic that it detects candle length(white part) as one component and then it goes to flame and wick.Here I am attaching one of my real time images.

http://tinypic.com/r/2ymbw2q/6. Thanks In advance.

Link

**Direct link to this comment:**

http://www.mathworks.com/matlabcentral/answers/57813#comment_127869

Sorry, but to make it more robust would take more time than I can devote to your project.

Link

**Direct link to this comment:**

http://www.mathworks.com/matlabcentral/answers/57813#comment_127877

Link

**Direct link to this comment:**

http://www.mathworks.com/matlabcentral/answers/57813#comment_128711

Link

**Direct link to this comment:**

http://www.mathworks.com/matlabcentral/answers/57813#comment_128781

Link

**Direct link to this comment:**

http://www.mathworks.com/matlabcentral/answers/57813#comment_128969

Thanks for your reply. I will try.

Link

**Direct link to this comment:**

http://www.mathworks.com/matlabcentral/answers/57813#comment_130187

Link

**Direct link to this comment:**

http://www.mathworks.com/matlabcentral/answers/57813#comment_130193

I presume this is directed to saam, who probably has this completed by now.

MATLAB and Simulink resources for Arduino, LEGO, and Raspberry Pi test

Learn moreOpportunities for recent engineering grads.

Apply Today
## 1 Comment

## Mmmm (view profile)

Direct link to this comment:http://www.mathworks.com/matlabcentral/answers/57813#comment_182623

Can you please send me the part of your code where you are detecting flame. I am working on my school project and I am new in the MATLAB world so I am a little bit lost. I guess you can help me with this issue.