Highlight an object in an image?

Click For Summary
SUMMARY

This discussion focuses on highlighting an object in an image using MATLAB, specifically for a beginner attempting to isolate food on a plate. The user proposes a method involving converting the image to binary, applying pixel edge detection, and using mathematical morphology to differentiate food from the background. The conversation emphasizes the challenges of defining food in varying contexts and suggests that without clear rules, the task may be overly complex.

PREREQUISITES
  • Basic understanding of MATLAB programming
  • Familiarity with image processing concepts
  • Knowledge of pixel edge detection techniques
  • Understanding of mathematical morphology in image analysis
NEXT STEPS
  • Research MATLAB image processing toolbox functions
  • Learn about pixel edge detection algorithms in MATLAB
  • Explore mathematical morphology techniques for image segmentation
  • Study methods for defining and recognizing objects in images
USEFUL FOR

Beginner MATLAB users, image processing enthusiasts, and anyone interested in object recognition and segmentation in images.

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