Skip to content

anishdhakal15/ComputerVision_Task

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

14 Commits
 
 
 
 
 
 
 
 

Repository files navigation

Rectangles to work with

Rectangle Numbering Problem

  • At first i converted given image to grey scale
  • Then i have applied threshold on greyscale image
  • After then i looked for contours and iterate through them
  • Approximated each contours Polygons
  • By taking hight and width of contours, i cropped original images into parts
  • Because of my limited knowledge on contour selection i cannot find best method to select only lines inside rectangle, so i used a technique in which i made two contours and subtracted on eachother

Two images with different contour selection method

Which produces this image

Similarly

By subtracting them we get following output

Rectangle Alignment

To align rectangle i have followed following steps

  • At first step , generated contours of each rectangle
  • Then, fetched number of angles in which they are tilted
  • Applying opencv 2D rotation method to fix their rotation
  • Then placed side by side using cv2.concatenate() method By using these steps following output is generated

About

Rectangle Sorting and alignment

Topics

Resources

Stars

Watchers

Forks

Languages