Skip to content

Computer Vision; Deciding whether food is mixed enough compared to selected sample image.

Notifications You must be signed in to change notification settings

mongshil553/Computer-Vision-Hue-Entropy-Utilizing-Sliding-Window

Repository files navigation

Computer-Vision-Food-Mixture-Level-Decision-System

Utilizing Computer Vision to decide whether food is mixed enough compared to selected sample image.

Result

  

When given a standard image, the system decides whether entry image is well mixed or lacks mixed level than the standard image.




This is an image of actually using a camera to evaluate whether current food is well mixed. "Good" with green background means food mixed level is high enough, and "Bad" with red background means food is not yet mixed well enough.

Utilizing Hue Entropy

Key idea to solving this problem is Using Hue compoment of an image. Convert the RGB Image into HSV Image, Getting Hue, Saturation, Value information. Hue is mainly used to define what color the bit is. By calculating the Entropy of Hue, we get to know how diverse the colors are in an image.

Via Using 3 Kernels; 20% window size, 25% window size, 30% window size, we calculate the final entropy for the specific pixel.
   

Following is the example of Entropies calculated for 4 image examples.

Finally, we calculate the standard deviation of the entropies in the image. If the standard deviation is high, it means that particular hue values occur in specific region, not prevailing in the entire image. On the other hand, if the standard deviation is low, hue entropies does not change a lot in the image thus, hue values are uniform throughout the entire image.


Code Structure

1. Image Gaussian Filtering(Smoothing), Image subsampling(reduce size)

2. Convert RGB Image to HSV

3. Hue domain Median Filtering; Used for reducing noise in calculating entropy, where (1,2,3) entropy is higher than that of (2,2,2)

4. Evaluate entropy for each one of 3 sliding window, then calcuate the average which will be the entropy for that specific pixel.

5. Run Gaussian Filtering to reduce noise.

6. Calcuate standard deviation for the hue entropies.

Acknowledgement

This system does not guarantee correct analysis of given image. The result could differ from the changes in light setting, resolution of the camera, image noise, unwanted parts such as plate included in the image, etc. Also, the code is very dirty.
   

Image Sources

Image used in this project is both collected from the Internet and created by our teammates.
Sources of Images collected from the Internet are the following:
https://www.youtube.com/watch?v=X7ozj9FPvNA
https://blog.naver.com/kutty1945/222251561774
https://www.10000recipe.com/recipe/1395916

About

Computer Vision; Deciding whether food is mixed enough compared to selected sample image.

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Contributors 4

  •  
  •  
  •  
  •  

Languages