Highlight an object in an image?

Click For Summary

Discussion Overview

The discussion centers around the challenge of highlighting an object, specifically food, in an image using MATLAB. Participants explore various methods and considerations related to image processing techniques, particularly in the context of distinguishing food from other elements in the image.

Discussion Character

  • Exploratory, Technical explanation, Debate/contested, Homework-related

Main Points Raised

  • A new user seeks assistance in using MATLAB to highlight food in an image, proposing methods such as creating a binary image or using edge detection techniques.
  • Some participants question the necessity of using MATLAB, suggesting that similar tasks can be accomplished more easily with other graphics processing programs.
  • One participant emphasizes the complexity of defining what constitutes food in an image, raising concerns about distinguishing food from non-food items based on color and shape.
  • Another participant suggests that narrowing down the types of images could simplify the problem, proposing specific criteria for identifying food based on visual characteristics.

Areas of Agreement / Disagreement

There is no consensus on the best approach to highlight food in the image, with differing opinions on the feasibility of the task and the appropriateness of using MATLAB versus other software.

Contextual Notes

Participants express uncertainty regarding the definitions and rules needed to effectively identify food in images, highlighting the challenges posed by similar colors and shapes in the context of image analysis.

Jinzo9090
Messages
2
Reaction score
0
Hi Everybody
I'm a new user and hope I have posted in the correct section.

I'm a beginner in MATLAB and image processing.
Using matlab, I have to highlight in an object in an image.

I have an input image where there is a plate with a food. I need to produce an output image where only food is highlighted.

It does not matter that the food can be distinguished. It must be something very simple. Whatever is fine (for example, making a red frame around the food; or treating the food as a all white foreground and the rest as a whole all black background; or just a black image with the edges of the food colored in white ... etc. )

That's my reasoning: I thought that first of all, it might be useful to convert the black and white image (0-255). Then run a pixel edge control technique and the pixel intensity control technique to recognize the dish; Next, the elements in the dish, recognized as in the foreground, are labeled with value 1. Next, I create a matrix of the same size as the input image, with all values at zero. In this matrix, I'll put at 1 the values labeled before, in the same coordinates. In this way, the output image is a binary image where the food has a value of 1 and everything else has a value of 0. And I will only see the white pixels of the food.

Can someone help me to implement in matlab?
 
Physics news on Phys.org
Why do you have to do it in matlab? It's trivial in most graphics processing programs
upload_2017-6-3_12-19-23.png
 
phinds said:
Why do you have to do it in matlab? It's trivial in most graphics processing programs
View attachment 204799

Because for this task I have to use MATLAB (Unfortunately).
I think it's useful to use math morphology. The result I want to get is similar to this:
170603_172910_68f893591caabb9G.jpg
 
Weird. Good luck.
 
Well I know a little bit about image analysis, having done it full time for the last 37 years. You have to define what food is. How would the computer know that the red stripes on the table cloth are stripes and not licorice ropes? How would it know that the chopsticks are not breadsticks or burnt spaghetti? How does it know that a white plate is not food but white mashed potatoes are food when both are white? You need to make up rules that describe all these situations and run the rules. I think you are doomed to failure unless you can narrow it down. It would be super challenging even for experts. For example, you might look for white in the image and see if it has a hole in the white region, which would indicate a white plate with something on it that you can assume is food. Assuming that none of the food breaks up the ring-shaped white region by hanging off the side of the plate (which would turn it into a "C" shape), then you have a problem which is now much much easier to solve. If you can't narrow down the types of images you look at to something simple like that, then I wouldn't even try.
 

Similar threads

Replies
1
Views
2K
  • · Replies 1 ·
Replies
1
Views
2K
  • · Replies 2 ·
Replies
2
Views
3K
  • · Replies 2 ·
Replies
2
Views
2K
  • · Replies 15 ·
Replies
15
Views
2K
  • · Replies 4 ·
Replies
4
Views
2K
Replies
4
Views
8K
Replies
1
Views
8K
  • · Replies 2 ·
Replies
2
Views
5K
  • · Replies 1 ·
Replies
1
Views
6K