🏆
Trusted Scholarly Publisher
Serving Researchers Since 2012

Brain Tumor Detection Image Segmentation using OpenCV

DOI : 10.5281/zenodo.20588589
Download Full-Text PDF Cite this Publication

Text Only Version

Brain Tumor Detection Image Segmentation using OpenCV

Preeti Yadav (1) , Sujeet Gautam (2)

(1) M.Tech, Dept. of CSE, Patel College Of Science & Technology, (RGPV), Bhopal, India

(2) Professors, Dept. of CSE, Patel College Of Science & Technology, (RGPV), Bhopal, India

Abstract – One of the greatest neurological conditions is brain tumors, which need to be detected as soon as possible in order to be efficiently treated .A common technique to detect abnormalities in the brain is magnetic resonance imaging, also known as or MRI. This research uses Open CV image processing methods to propose an automated system for brain tumor detection and segmentation. By accurately and quickly identifying suspicious tumor spots from MRI scans, the method helps radiologists. For healthcare professionals, accurately identifying brain tumors is an extremely challenging task. MRI images are likely to be affected by noise and other environmental factors. As a result, healthcare workers find it challenging to detect tumors and their origins. As a result, we developed a method that uses pictures to recognize a typical brain tumors. Here, we switch the image to grayscale format. We apply a type of filter to eliminate noise as well as other noise in the background from an image. User should select the image. A system using image processing methods to analyze the image. To detect tumors in brain scans, we employed a unique method. However, the photograph’s edges are blurry in the early stages of a brain tumor.

Keywords – Brain Tumor Detection, MRI, OpenCV, Image Segmentation, Medical Imaging, Computer Vision, processing of images, grayscale , MATLAB.

  1. INTRODUCTION

    Abnormal cell growth within brain structures is the root cause of brain tumors. MRI scan evaluation by manually takes a lot of time to complete and is prone to human error. Tumor areas can be automatically detected with the help of image processing methods. OpenCV can be used for analyzing medical images because it provides effective abilities for segmentation, extraction of features, and image enhancement. To enhance MRI pictures and detect unusual tumor areas, image processing approaches including the process of segmentation grayscale transformation, filtering, or feature extraction are employed. Among these methods, image segmentation is important for identifying the boundaries of tumors and separating between healthy, normal brain structures and malignant ones.For the implementation of image enhancement, segmentation, feature extraction, and visualization techniques, OpenCV offers a robust open-source computer vision framework. In this work, we present an OpenCV based framework for automatic localization of tumors using conventional image processing approaches.In order to reduce noise and enhance image quality, this approach converts MRI images into grayscale and uses filtering techniques. Tumor regions are successfully identified using a specific image segmentation technique, especially for early-stage tumors where image borders are ambiguous. Instead of detecting brain tumors, this approach aims to classify them in order to improve diagnosis and treatment planning.

  2. OBJECTIVES

    Establishing an effective and automated methodology for the identification and classification of brain cancers utilizing traditional MRI (magnetic resonance imaging) scan images is the main goal of the suggested system. enhance an MRI’s quality by using preprocessing techniques like grayscale conversion and image filtering. MRI scans are often affected by noise from the environment and interference, which may affect image clarity and make identifying tumors difficult. The technique also attempts to use improved image segmentation techniques to accurately identify tumor locations in MRI scan data. Automatic brain tumor segmentation using image processing and machine learning techniques has been the subject of numerous investigations. In the study of MRI segmentation of brain tumor methods Wadhwa et al. emphasized the importance of precise segmentation for medical diagnosis. Based on recent surveys, deep learning techniques like U-Net and Vision Transformers reach cutting-edge segmentation performance, but conventional image processing techniques are still useful because to their simple nature of use, understanding, and low computation demands.

    1. Use MRI images to identify brain tumors.

    2. Correctly divide the tumor areas.

    3. Try to make the affected regions clearer to view

    4. Reduce the time to identify a problem.

    Summary of Existing Research

    Author

    Method

    Dataset

    Key Finding

    Wadhwa et al. (2019)

    MRI Segmentation Review

    Multiple MRI datasets

    Traditional methods remain useful

    Menze et al.

    BraTS Benchmark

    BraTS

    Standardized evaluation framework

    Krishnapriya et al. (2023)

    Deep Learning Survey

    BraTS

    Bonato et al. (2025) BraTS Datase

    Bonato et al. (2025)

    BraTS Dataset Review

    BraTS 20122025

    Dataset quality improved steadily

  3. METHODOLOGY

    The suggested method uses MRI images to detect and classify tumors of the brain using a systematic approach.

    Step 1: Image Acquisition The network recognizes an MRI scan representation of brain tissue as an input. The MRI image is obtained from medical imaging sources or medical data sets for tumor evaluation. The BraTS dataset, a popular standard for brain tumor segmentation research, gives MRI brain images.

    Step 2: Image Preprocessing

    The generated MRI image is treated in order to enhance its quality. Standardized image filtering methods are used in this phase to eliminate extraneous abnormalities, noise, and external interference.

    Using Open CV:

    Grayscale the image.

    Using Gaussian Blur to eliminate noise. Set intensity values to normal.

    Preprocessing reduces noise and improves the quality of the image.

    Grayscale Conversion

    gray = cv2.cvtColor(image, cv2.COLOR_BGR2GRAY)

    Gaussian Filtering

    blur = cv2.GaussianBlur(gray, (5,5), 0)

    Step 3: Grayscale Conversion

    A standard MRI image is converted into grayscale representations in order to simplify image processing procedures and minimize machine complexities. Grayscale images enhance the accuracy of classification.

    Step 4: Filtering and Noise Removal

    When clutter is removed and the image is smoothed using filtering methods like the Gauss or average filter process, important tumor-related features are conserved.

    Step 5: Image Enhancement

    Both the contrast and clarity of the malignant places are enhanced by improving the picture. Improvement techniques improve detection of edges and attract focus on abnormal cells.

    Step 6: Image Segmentation

    Tumor areas are differentiated with normal brain cells using improved segmentation of images methods. Tumor borders are established with division, which additionally isolates the affected area for further investigation.

    Binary thresholding separates tumor tissues from normal brain tissues. ret, thresh = cv2.threshold(

    blur, 127,

    255,

    cv2.THRESH_BINRY

    )

    Step 7: Feature Extraction

    Important tumor-related features, including as texture, shape, terms of size, and brightness, are determined from the segmentation image to help in categorization.

    Step 8: Identification and Categorization of Tumors

    By analysing extracted features, the method determines whether tumor is present. When a tumor is identified, the method uses visual characteristics to classify a type of tumor.

    Step 9: Production of Output

    In the end, the equipment presents the recently discovered tumor region together with a classification of results, allowing medical practitioners to effectively evaluate MRI images.

    Algorithm Flow

    Input MRI Image Preprocessing Grayscale Conversion Noise Filtering Image Enhancement Segmentation

    Feature Extraction Tumor Detection Classification Output Result

  4. RESULTS

    The segmented image highlights tumor regions and draws bounding boxes around detected abnormalities. Performance can be evaluated using:

    • Intersection over Union (IoU)

    • Dice Similarity Coefficient (DSC)

    • Accuracy

    • Recall

    • Precision

    Note : Dice and IoU are the most widely used metrics for medical image segmentation.

    Fig. This is the final output after processing the image through the various stages and in a single frame we can see the tumor region

  5. ADVANTAGES

    • Fast and automated detection.

    • Low computational cost.

    • Easy implementation using Open CV.

    • Useful for preliminary diagnosis.

    • No GPU requirement.

    • Suitable for real-time applications.

  6. LIMITATIONS

    • Threshold selection sensitivity

    • The quality of the MRI affects performance.

    • Having difficulty managing intricate tumor boundaries.

    • Less accurate than more sophisticated deep learning techniques.

    • Complex tumors may cause threshold-based segmentation to fail.

    • Performance is affected by MRI quality.

  7. FUTURE WORK

  • Future systems can integrate:

  • CNNs

  • Integration of U-Net architectures.

  • Hybrid OpenCV and Deep Learning models.

  • Vision Transformer-based segmentation.

  • Multi-modal MRI analysis.

  • Real-time clinical deployment.

  • These approaches have shown state-of-the-art performance on BraTS datasets.

CONCLUSION

In this task, various image analysis processes are being used to process MRI images in order to enhance detection accuracy and image quality. MRI brain scans are initially fed into the system and converted to grayscale form with the goal of simplifying visualization while decreasing computational complexity. Screen To determine the success rate of the proposed method, a set of MRI (magnetic resonance imaging) brain images, including both normal and tumor-affected scans, have been used. This research shows how OpenCV may be utilized to segment images from MRI scans and identify brain tumors. Tumor areas can be effectively localized using preprocessing and region extraction. Although OpenCV-based approaches are straightforward as well as computationally effective, incorporating deep learning techniques can enhance segmentation robustness and accuracy even more. An OpenCV-based framework to perform MRI image-based brain tumor identification and segmentation is presented in this research. To efficiently identify tumor locations, the methodology incorporates preprocessing, thresholding, morphological operations, contour extraction, and localization procedures. Tests show that the suggested approach maintains computing the economy while obtaining acceptable accuracy in segmentation. OpenCV-based segmentation remains a workable and understandable solution for educational and initial clinical applications, even though deep learning approaches beat conventional methods. The tumor area analysis conclusion is shown below. A system distinguishes an abnormal tumor portion from healthy tissue nearby by using division approaches and image analysis techniques.

REFERENCES

  1. Bauer S, Wiest R, Nolte LP, Reyes M. A survey of MRI-based medical image analysis for brain tumor studies. Physics in Medicine & Biology. 2013;58(13):97129.

  2. Kharrat A, Benamrane N, Messaoud MB, Abid M. Detection of brain tumor in medical images. In International Conference on Signals, Circuits and Systems. 2010 (pp. 16). IEEE.

  3. Gonzalez RC, Woods RE. Digital Image Processing. 4th ed. Pearson Education; 2018.

  4. Russ JC. The Image Processing Handbook. 7th ed. CRC Press; 2016.

  5. Bradski G. The OpenCV Library. Dr. Dobbs Journal of Software Tools. 2000.

  6. Suetens P. Fundamentals of Medical Imaging. Cambridge University Press; 2017.

  7. Pereira S, Pinto A, Alves V, Silva CA. Brain tumor segmentation using convolutional neural networks in MRI images. IEEE Transactions on Medical Imaging. 2016;35(5):12401251.

  8. Havaei M, Davy A, Warde-Farley D, et al. Brain tumor segmentation with deep neural networks. Medical Image Analysis. 2017;35:1831.

  9. Tustison NJ, Avants BB, Cook PA, et al. N4ITK: Improved N3 bias correction. IEEE Transactions on Medical Imaging. 2010;29(6):13101320.

  10. Zuiderveld K. Contrast limited adaptive histogram equalization. In Graphics Gems IV. Academic Press; 1994. pp. 474485.

  11. Saha J, Bandyopadhyay MK. Brain tumor detection using MRI image processing and segmentation techniques. International Journal of Advanced Research in Computer Science. 2017;8(5):234239.

  12. Kumar S, Singh D. Brain tumor detection based on MRI using image segmentation. International Journal of Engineering Research & Technology. 2018;7(4):8590.

  13. Dixit A, Jain P. Brain tumor detection using image processing techniques in MRI images. International Journal of Computer Applications. 2018;179(39):2026.

  14. Ahmed S, Mohan BJ. MRI brain tumor classification using machine learning. International Journal of Computer Science and Information Security. 2019;17(6):112119.

  15. Roy S, Bandyopadhyay SK. Detection and quantification of brain tumor from MRI images using image processing. International Journal of Computer Applications. 2015;120(9):1520.

  16. LeCun Y, Bengio Y, Hinton G. Deep learning. Nature. 2015;521(7553):436444.

  17. Litjens G, Kooi T, Bejnordi BE, et al. A survey on deep learning in medical image analysis. Medical Image Analysis. 2017;42:6088.