Highlight an object in an image?

In summary, the conversation discusses a user's need to highlight food in an image using MATLAB. They suggest using math morphology and creating rules to identify food in the image. They also mention that the task is challenging and may require narrowing down the types of images to be analyzed.
  • #1
Jinzo9090
2
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
  • #2
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
 
  • #3
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
 
  • #5
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.
 

1. How do you highlight an object in an image?

To highlight an object in an image, you can use a photo editing software such as Adobe Photoshop or GIMP. These programs have tools such as the "lasso" or "magic wand" tool that allow you to select and highlight specific parts of an image. You can also use the "highlight" or "outline" options to add a border or color to the selected object.

2. What is the purpose of highlighting an object in an image?

The purpose of highlighting an object in an image is to draw attention to it and make it stand out from the rest of the image. This can be useful in presentations, marketing materials, or any other visual content where you want to emphasize a specific element.

3. Can you highlight more than one object in an image?

Yes, you can highlight multiple objects in an image using the same methods mentioned in the first question. You can also use the "group" or "merge" options to combine multiple highlighted objects into one group.

4. Is it possible to highlight an object in an image without using software?

Yes, it is possible to highlight an object in an image without using software. You can print out the image and physically highlight the object using a highlighter or colored pencil. However, this method is not as precise as using software and may not be suitable for digital images.

5. Can I customize the color and thickness of the highlight in an image?

Yes, most photo editing software allows you to customize the color and thickness of the highlight in an image. You can choose from a variety of colors and adjust the thickness of the highlight to your desired size. This allows for more flexibility in highlighting an object and making it stand out in the image.

Similar threads

  • MATLAB, Maple, Mathematica, LaTeX
Replies
1
Views
126
  • MATLAB, Maple, Mathematica, LaTeX
Replies
1
Views
1K
  • MATLAB, Maple, Mathematica, LaTeX
Replies
2
Views
2K
  • Engineering and Comp Sci Homework Help
Replies
2
Views
4K
  • MATLAB, Maple, Mathematica, LaTeX
Replies
15
Views
2K
  • Engineering and Comp Sci Homework Help
Replies
1
Views
831
  • MATLAB, Maple, Mathematica, LaTeX
Replies
4
Views
1K
  • MATLAB, Maple, Mathematica, LaTeX
Replies
4
Views
7K
  • Computing and Technology
Replies
7
Views
833
Back
Top