Image Segmentation
This code helps you to understand and draw boundaries on objects of a particular image.
Description
Here is the approach that I used to detect the blocks:
1) Converted the image to grayscale
2) Applied threshold (simple binary threshold, with a handpicked value of 150 as the threshold value)
3) Applied dilation to thicken lines in the image, leading to more compact objects and fewer white space fragments. Used a high value for a number of iterations, so dilation is very heavy (13 iterations, also handpicked for optimal results).
4) Identified contours of objects in a resulting image using the OpenCV find contours function.
5) Drew a bounding box (rectangle) circumscribing each contoured object - each frames a block of text.
Please let me know your valuable feedback on the video by means of comments. Please like and share the video. Do not forget to subscribe to my channel for more educational videos.
Any problem you can comment down.
Want more education? Connect with me here:
Twitter:
Github:
Subscribe:
Organizations:
Youtube:
Related searches
object detection using OpenCV source code python
object detection using image processing python
real-time object detection OpenCV python code
object detection OpenCV-python GitHub
object detection code in python
OpenCV detects an object in the image
OpenCV object-detection GitHub
how to train OpenCV to detect an object