This project demonstrates the detection of lemons in images using MATLAB. By employing image processing techniques, the system can identify and highlight lemons in various environments. The goal of this project is to experiment with MATLAB’s image processing toolbox and explore its potential in fruit detection.
- Preprocessing Images: Convert RGB images to grayscale, apply filtering, and remove noise.
- Lemon Segmentation: Use techniques like thresholding and edge detection to segment lemons from the background.
- Feature Extraction: Extract relevant features like color, shape, and size to distinguish lemons from other objects.
- Visualization: Highlight the detected lemons in the original image by overlaying bounding boxes or contours.
- Image Preprocessing: Noise removal, image resizing, and conversion to appropriate color spaces.
- Segmentation: Application of thresholding, edge detection (e.g., Canny), and morphological operations.
- Object Detection: Analysis of shapes and contours to locate lemons in the image.
- Bounding Box Visualization: Drawing bounding boxes around detected lemons for visual feedback.
Follow the steps below to set up and run the lemon detection script in MATLAB.
- MATLAB (R2019b or higher recommended)
- Image Processing Toolbox (included with most versions of MATLAB)
- Clone the repository:
git clone https://github.com/sunil1519G/Lemon-Detection-using-MATLAB.git
- Navigate to the project directory:
cd Lemon-Detection-using-MATLAB
- Open MATLAB and add the project folder to the MATLAB path.
- Run the script:
lemon_detection.m
Lemon-Detection-using-MATLAB/
│
├── images/ # Contains sample images for testing
├── results/ # Contains the output images with detected lemons
├── lemon_detection.m # Main script for lemon detection
├── README.md # Project documentation
└── LICENSE
- Load Image: The user provides an image containing lemons.
- Preprocess: Convert the image to grayscale, apply filters, and remove noise.
- Segmentation: The image is processed using thresholding and edge detection to segment potential lemon regions.
- Detection: Feature extraction is used to identify lemon-like shapes, and a bounding box is drawn around detected lemons.
- Display: The original image is displayed with detected lemons highlighted.
- Improve detection accuracy by integrating machine learning techniques.
- Expand the detection system to include other fruits or objects.
- Implement real-time detection using a camera feed.
This project is licensed under the MIT License. See the LICENSE file for more details.
Contributions, issues, and feature requests are welcome! Feel free to check out the issues page.
For any inquiries or collaboration, feel free to reach out:
- Author: Sunil1519G
- Email: [email protected]