SlideShare a Scribd company logo
1 of 19
Identification of Image
scale using Computer
vision
• ENGI 981B – MASc. Computer Engineering project
• By : Vigneshwar Ramaswamy
• Supervisor: Dr. Stephen Czarnuch
Topics
• Overview of project
• Background
• Objective
• Flow chart
• Methodologies
• Conclusion
Overview
• By 2021, the Canadian Radio Television and Telecommunication has mandated that all the
Canadian telephone companies must support next generation 911 voice and text messaging.
• Next generation text messaging includes provision for videos and Images.
• To achieve this, we develop an Image processing technique to next generation media to pre-
process information and showing the type of severity of the graphic image before Canadian
telecommunications operators receive it.
• The next generation 911 project has a list of challenges like Detection of presence or absence of
humans, Fire detection, Detection of image orientation and camera perspective, Automatic
detection of image blur and distortion in RGB images and finding the image scale of the unknown
image.
• In this project, I am working on part of problem which determines the scale of the image or field of
view of the unknown image.
Background
• The input image will be the Depth image which is estimated by self supervised monocular depth
estimation method which is an existing approach which leads to methodology.
• Following the estimation of the depth, the image is then analyzed to automatically find the image
scale by proposed methodology by using the libraries like OpenCV, Pillow (PIL), NumPy.
Input Depth Image
Raw Image
Proposed
method
Result
Flow Chart
Estimation of Dark
Pixel
• Dark
Pixel
Score
Finding the
Horizon
• Horizon
Score
Removing
Foreground Gradient
• Smooth
gradien
t Score
Object Pixels
• Number
of
Object
Pixels
Final Result
• Final
Score
Input
Image
Estimation of Dark Pixel
• The Dark pixel in this process represents the “Far Background” in the input image. They are not
informative directly but they may help to an understanding of the scale of the image.
• Far Background pixels also called Dark pixels should exist only in Wide field of view Images.
• Range function in OpenCV is used here to estimate the Dark pixel in the input image. The
estimation is determined by counting the dark pixels from the depth image by creating lower and
upper boundary of the dark pixels and counting all the pixels within the boundary.
• Score is determined by following expression,
• Score_stage1 = (Percentage of pixels in boundary/100) * 10
• Where Percentage = (pixel count in boundary/total pixel) *100
Estimation of Dark Pixel
Figure 1: Input image Figure 2: Dark Pixels or far background
Figure 3: Stage 1 score
Figure 4: Output image of stage 1
Finding the horizon in the image
• In this stage, the input image will be the output of the stage 1.
• The horizon in the image will be the region between the background and foreground.
• The horizon gives better understanding of image scale and orientation.
• Horizon is found by Otsu’s thresholding method.
• Horizon score is calculated by the following expression,
• average = (horizon_y1 + horizon_y2)/2
• percentage_of_horizon = (average/height)*100
• score_stage2 = (percentage_of_horizon/100) * 10
• Otsu’s thresholding in image processing is used to perform Automatic image thresholding.
• cv.threshold() function is used where cv.THRESH_OTSU is passed as extra flag.
• The threshold value can be chosen arbitrary. The algorithm then finds the optimal threshold value which
is returned as the output.
• The horizon is plotted in the region between the foreground and the background and the score of the
horizon is calculated.
Finding the horizon in the image
• After finding the horizon, the region above the horizon is removed. The resulting image will be the
input image to the next stage.
Figure 5: Input image Figure 6: output of Otsu’s thresholding Figure 7: plotting the Horizon
Figure 8: Score of stage 2 Figure 9: output image
Removing Foreground Gradient
• Aim of this stage is calculate the smooth gradient (foreground) and the Object pixels in the image.
Here the input image will be the output image of the stage 2.
• The parts of the foreground image that are un-interesting are removed.
• The physical ground is always recorded as the smooth gradient in an image and the gradient occurs
in a direction perpendicular to the horizon. Hence we can remove the pixels of the foreground with
this knowledge.
Figure 10: Input image of stage 3
Smooth
gradient
0
255 uneven
gradient
Removing Foreground Gradient
• Let us consider the input image in matrix form. The values in the first column decreases gradually
because of the smooth gradients and there are no objects in between.
Figure 11: NumPy object array of input image
Removing Foreground Gradient
• To remove the smooth gradients, a condition is passed. “ if the value keeps decreasing and the
difference between the lower pixel and upper pixel is less than or equal to the margin value, that
pixel is removed. This is done to all the columns in the matrix.
• If there is an object in between, the iteration is stopped for that particular column and it starts
from the next column. After the iteration is complete, the output image of the final stage looks like
this. Since the score of foreground gradient is 7.7 and object is 2.29, we can estimate that the
image has maximum of foreground and medium object.
Figure 13: Score of stage 3
Figure 12: output image of stage 3
Graphical Analysis
• This graph shows the analysis of intensity value of the left most column of the image.
• Values move up gradually without any deviation.
Graphical Analysis
• This graph shows the analysis of intensity value of right most column of the image.
• The gradient is smooth, as values move up gradually without any deviation
Graphical Analysis
• This graph shows the analysis of intensity value of the middle column of the image.
• The gradient is not smooth because there is object in this part of the image, hence there is
deviation in the graph.
Uneven gradient
Overall Score
• The overall score is calculated by the following expression
• C_1 * dark_score + C_2 * horizon_score + C_3 * gradient_score + C_4 * Object_pixels
• Where C_i is weighted constants
• The overall score will give you an estimate of the image scale or the field of view, where 0 being
narrow field of view and 10, wide field of view.
• In this case, the overall score will be
• 0.4 * 5.107 + 0.4 * 5.29 + 0.2 * 7.7 + 0.2 * 2.29 = 6.1568
• Since the score is above 5, we can estimate that the Image has wider field of view with medium
size object.
Case 2
Figure 13: score stage 1
Figure 14: score stage 2
Figure 15: score stage 3
Final score = 0.4*3.16+0.4*3.53+0.2*3.69+0.2*6.3 = 4.46
Since the score is below 5, the image scale can be estimated as narrow
field of view with large object.
Conclusion
• A simple approach to estimate the field of view of an unknown image
• With the information obtained from this approach, one could then use existing approaches which
are dependent on the field of view of the image.
•Thank you!

More Related Content

What's hot

Threshold Selection for Image segmentation
Threshold Selection for Image segmentationThreshold Selection for Image segmentation
Threshold Selection for Image segmentation
Parijat Sinha
 
Visual cryptography scheme for color images
Visual cryptography scheme for color imagesVisual cryptography scheme for color images
Visual cryptography scheme for color images
iaemedu
 
Comparative study on image segmentation techniques
Comparative study on image segmentation techniquesComparative study on image segmentation techniques
Comparative study on image segmentation techniques
gmidhubala
 
Image representation
Image representationImage representation
Image representation
Rahul Dadwal
 

What's hot (19)

COM2304: Morphological Image Processing
COM2304: Morphological Image ProcessingCOM2304: Morphological Image Processing
COM2304: Morphological Image Processing
 
Threshold Selection for Image segmentation
Threshold Selection for Image segmentationThreshold Selection for Image segmentation
Threshold Selection for Image segmentation
 
METHOD FOR A SIMPLE ENCRYPTION OF IMAGES BASED ON THE CHAOTIC MAP OF BERNOULLI
METHOD FOR A SIMPLE ENCRYPTION OF IMAGES BASED ON THE CHAOTIC MAP OF BERNOULLIMETHOD FOR A SIMPLE ENCRYPTION OF IMAGES BASED ON THE CHAOTIC MAP OF BERNOULLI
METHOD FOR A SIMPLE ENCRYPTION OF IMAGES BASED ON THE CHAOTIC MAP OF BERNOULLI
 
Image segmentation
Image segmentationImage segmentation
Image segmentation
 
Segmentation Techniques -II
Segmentation Techniques -IISegmentation Techniques -II
Segmentation Techniques -II
 
Image segmentation
Image segmentationImage segmentation
Image segmentation
 
Fuzzy c-means clustering for image segmentation
Fuzzy c-means  clustering for image segmentationFuzzy c-means  clustering for image segmentation
Fuzzy c-means clustering for image segmentation
 
PPT s04-machine vision-s2
PPT s04-machine vision-s2PPT s04-machine vision-s2
PPT s04-machine vision-s2
 
Image segmentation
Image segmentationImage segmentation
Image segmentation
 
face recognition based on PCA
face recognition based on PCAface recognition based on PCA
face recognition based on PCA
 
Dital Image Processing (Lab 2+3+4)
Dital Image Processing (Lab 2+3+4)Dital Image Processing (Lab 2+3+4)
Dital Image Processing (Lab 2+3+4)
 
Visual cryptography scheme for color images
Visual cryptography scheme for color imagesVisual cryptography scheme for color images
Visual cryptography scheme for color images
 
Comparative study on image segmentation techniques
Comparative study on image segmentation techniquesComparative study on image segmentation techniques
Comparative study on image segmentation techniques
 
IMAGE SEGMENTATION TECHNIQUES
IMAGE SEGMENTATION TECHNIQUESIMAGE SEGMENTATION TECHNIQUES
IMAGE SEGMENTATION TECHNIQUES
 
Im seg04
Im seg04Im seg04
Im seg04
 
Image segmentation
Image segmentation Image segmentation
Image segmentation
 
Image representation
Image representationImage representation
Image representation
 
Edge Detection and Segmentation
Edge Detection and SegmentationEdge Detection and Segmentation
Edge Detection and Segmentation
 
point processing
point processingpoint processing
point processing
 

Similar to Identification of image scale using computer vision

Image enhancement
Image enhancementImage enhancement
Image enhancement
Ayaelshiwi
 

Similar to Identification of image scale using computer vision (20)

Object detection at night
Object detection at nightObject detection at night
Object detection at night
 
Image enhancement
Image enhancementImage enhancement
Image enhancement
 
DIP Notes Unit-1 PPT , engineering, computer Science
DIP Notes Unit-1 PPT , engineering, computer ScienceDIP Notes Unit-1 PPT , engineering, computer Science
DIP Notes Unit-1 PPT , engineering, computer Science
 
DIP Notes Unit-1 PPT.pdf
DIP Notes Unit-1 PPT.pdfDIP Notes Unit-1 PPT.pdf
DIP Notes Unit-1 PPT.pdf
 
Image enhancement techniques
Image enhancement techniquesImage enhancement techniques
Image enhancement techniques
 
image enhancement image enhancement imag
image enhancement image enhancement imagimage enhancement image enhancement imag
image enhancement image enhancement imag
 
thesis
thesisthesis
thesis
 
Practical Digital Image Processing 2
Practical Digital Image Processing 2Practical Digital Image Processing 2
Practical Digital Image Processing 2
 
Image enhancement ppt nal2
Image enhancement ppt nal2Image enhancement ppt nal2
Image enhancement ppt nal2
 
Image enhancement in the spatial domain1
Image enhancement in the spatial domain1Image enhancement in the spatial domain1
Image enhancement in the spatial domain1
 
Image Enhancement in the Spatial Domain1.ppt
Image Enhancement in the Spatial Domain1.pptImage Enhancement in the Spatial Domain1.ppt
Image Enhancement in the Spatial Domain1.ppt
 
Image enhancement lecture
Image enhancement lectureImage enhancement lecture
Image enhancement lecture
 
OpenCV.pdf
OpenCV.pdfOpenCV.pdf
OpenCV.pdf
 
motion and feature based person tracking in survillance videos
motion and feature based person tracking in survillance videosmotion and feature based person tracking in survillance videos
motion and feature based person tracking in survillance videos
 
Digital image processing
Digital image processingDigital image processing
Digital image processing
 
Report
ReportReport
Report
 
Image processing
Image processingImage processing
Image processing
 
ImSeg04.ppt
ImSeg04.pptImSeg04.ppt
ImSeg04.ppt
 
ImSeg04 (2).ppt
ImSeg04 (2).pptImSeg04 (2).ppt
ImSeg04 (2).ppt
 
DIP Lecture 7-9.pdf
DIP Lecture 7-9.pdfDIP Lecture 7-9.pdf
DIP Lecture 7-9.pdf
 

Recently uploaded

Final DBMS Manual (2).pdf final lab manual
Final DBMS Manual (2).pdf final lab manualFinal DBMS Manual (2).pdf final lab manual
Final DBMS Manual (2).pdf final lab manual
BalamuruganV28
 
Artificial intelligence presentation2-171219131633.pdf
Artificial intelligence presentation2-171219131633.pdfArtificial intelligence presentation2-171219131633.pdf
Artificial intelligence presentation2-171219131633.pdf
Kira Dess
 
21P35A0312 Internship eccccccReport.docx
21P35A0312 Internship eccccccReport.docx21P35A0312 Internship eccccccReport.docx
21P35A0312 Internship eccccccReport.docx
rahulmanepalli02
 

Recently uploaded (20)

Final DBMS Manual (2).pdf final lab manual
Final DBMS Manual (2).pdf final lab manualFinal DBMS Manual (2).pdf final lab manual
Final DBMS Manual (2).pdf final lab manual
 
SLIDESHARE PPT-DECISION MAKING METHODS.pptx
SLIDESHARE PPT-DECISION MAKING METHODS.pptxSLIDESHARE PPT-DECISION MAKING METHODS.pptx
SLIDESHARE PPT-DECISION MAKING METHODS.pptx
 
5G and 6G refer to generations of mobile network technology, each representin...
5G and 6G refer to generations of mobile network technology, each representin...5G and 6G refer to generations of mobile network technology, each representin...
5G and 6G refer to generations of mobile network technology, each representin...
 
Independent Solar-Powered Electric Vehicle Charging Station
Independent Solar-Powered Electric Vehicle Charging StationIndependent Solar-Powered Electric Vehicle Charging Station
Independent Solar-Powered Electric Vehicle Charging Station
 
NEWLETTER FRANCE HELICES/ SDS SURFACE DRIVES - MAY 2024
NEWLETTER FRANCE HELICES/ SDS SURFACE DRIVES - MAY 2024NEWLETTER FRANCE HELICES/ SDS SURFACE DRIVES - MAY 2024
NEWLETTER FRANCE HELICES/ SDS SURFACE DRIVES - MAY 2024
 
Interfacing Analog to Digital Data Converters ee3404.pdf
Interfacing Analog to Digital Data Converters ee3404.pdfInterfacing Analog to Digital Data Converters ee3404.pdf
Interfacing Analog to Digital Data Converters ee3404.pdf
 
Instruct Nirmaana 24-Smart and Lean Construction Through Technology.pdf
Instruct Nirmaana 24-Smart and Lean Construction Through Technology.pdfInstruct Nirmaana 24-Smart and Lean Construction Through Technology.pdf
Instruct Nirmaana 24-Smart and Lean Construction Through Technology.pdf
 
Artificial Intelligence in due diligence
Artificial Intelligence in due diligenceArtificial Intelligence in due diligence
Artificial Intelligence in due diligence
 
Insurance management system project report.pdf
Insurance management system project report.pdfInsurance management system project report.pdf
Insurance management system project report.pdf
 
Artificial intelligence presentation2-171219131633.pdf
Artificial intelligence presentation2-171219131633.pdfArtificial intelligence presentation2-171219131633.pdf
Artificial intelligence presentation2-171219131633.pdf
 
Raashid final report on Embedded Systems
Raashid final report on Embedded SystemsRaashid final report on Embedded Systems
Raashid final report on Embedded Systems
 
Fuzzy logic method-based stress detector with blood pressure and body tempera...
Fuzzy logic method-based stress detector with blood pressure and body tempera...Fuzzy logic method-based stress detector with blood pressure and body tempera...
Fuzzy logic method-based stress detector with blood pressure and body tempera...
 
handbook on reinforce concrete and detailing
handbook on reinforce concrete and detailinghandbook on reinforce concrete and detailing
handbook on reinforce concrete and detailing
 
History of Indian Railways - the story of Growth & Modernization
History of Indian Railways - the story of Growth & ModernizationHistory of Indian Railways - the story of Growth & Modernization
History of Indian Railways - the story of Growth & Modernization
 
21P35A0312 Internship eccccccReport.docx
21P35A0312 Internship eccccccReport.docx21P35A0312 Internship eccccccReport.docx
21P35A0312 Internship eccccccReport.docx
 
15-Minute City: A Completely New Horizon
15-Minute City: A Completely New Horizon15-Minute City: A Completely New Horizon
15-Minute City: A Completely New Horizon
 
Maximizing Incident Investigation Efficacy in Oil & Gas: Techniques and Tools
Maximizing Incident Investigation Efficacy in Oil & Gas: Techniques and ToolsMaximizing Incident Investigation Efficacy in Oil & Gas: Techniques and Tools
Maximizing Incident Investigation Efficacy in Oil & Gas: Techniques and Tools
 
21scheme vtu syllabus of visveraya technological university
21scheme vtu syllabus of visveraya technological university21scheme vtu syllabus of visveraya technological university
21scheme vtu syllabus of visveraya technological university
 
8th International Conference on Soft Computing, Mathematics and Control (SMC ...
8th International Conference on Soft Computing, Mathematics and Control (SMC ...8th International Conference on Soft Computing, Mathematics and Control (SMC ...
8th International Conference on Soft Computing, Mathematics and Control (SMC ...
 
NO1 Best Powerful Vashikaran Specialist Baba Vashikaran Specialist For Love V...
NO1 Best Powerful Vashikaran Specialist Baba Vashikaran Specialist For Love V...NO1 Best Powerful Vashikaran Specialist Baba Vashikaran Specialist For Love V...
NO1 Best Powerful Vashikaran Specialist Baba Vashikaran Specialist For Love V...
 

Identification of image scale using computer vision

  • 1. Identification of Image scale using Computer vision • ENGI 981B – MASc. Computer Engineering project • By : Vigneshwar Ramaswamy • Supervisor: Dr. Stephen Czarnuch
  • 2. Topics • Overview of project • Background • Objective • Flow chart • Methodologies • Conclusion
  • 3. Overview • By 2021, the Canadian Radio Television and Telecommunication has mandated that all the Canadian telephone companies must support next generation 911 voice and text messaging. • Next generation text messaging includes provision for videos and Images. • To achieve this, we develop an Image processing technique to next generation media to pre- process information and showing the type of severity of the graphic image before Canadian telecommunications operators receive it. • The next generation 911 project has a list of challenges like Detection of presence or absence of humans, Fire detection, Detection of image orientation and camera perspective, Automatic detection of image blur and distortion in RGB images and finding the image scale of the unknown image. • In this project, I am working on part of problem which determines the scale of the image or field of view of the unknown image.
  • 4. Background • The input image will be the Depth image which is estimated by self supervised monocular depth estimation method which is an existing approach which leads to methodology. • Following the estimation of the depth, the image is then analyzed to automatically find the image scale by proposed methodology by using the libraries like OpenCV, Pillow (PIL), NumPy. Input Depth Image Raw Image Proposed method Result
  • 5. Flow Chart Estimation of Dark Pixel • Dark Pixel Score Finding the Horizon • Horizon Score Removing Foreground Gradient • Smooth gradien t Score Object Pixels • Number of Object Pixels Final Result • Final Score Input Image
  • 6. Estimation of Dark Pixel • The Dark pixel in this process represents the “Far Background” in the input image. They are not informative directly but they may help to an understanding of the scale of the image. • Far Background pixels also called Dark pixels should exist only in Wide field of view Images. • Range function in OpenCV is used here to estimate the Dark pixel in the input image. The estimation is determined by counting the dark pixels from the depth image by creating lower and upper boundary of the dark pixels and counting all the pixels within the boundary. • Score is determined by following expression, • Score_stage1 = (Percentage of pixels in boundary/100) * 10 • Where Percentage = (pixel count in boundary/total pixel) *100
  • 7. Estimation of Dark Pixel Figure 1: Input image Figure 2: Dark Pixels or far background Figure 3: Stage 1 score Figure 4: Output image of stage 1
  • 8. Finding the horizon in the image • In this stage, the input image will be the output of the stage 1. • The horizon in the image will be the region between the background and foreground. • The horizon gives better understanding of image scale and orientation. • Horizon is found by Otsu’s thresholding method. • Horizon score is calculated by the following expression, • average = (horizon_y1 + horizon_y2)/2 • percentage_of_horizon = (average/height)*100 • score_stage2 = (percentage_of_horizon/100) * 10 • Otsu’s thresholding in image processing is used to perform Automatic image thresholding. • cv.threshold() function is used where cv.THRESH_OTSU is passed as extra flag. • The threshold value can be chosen arbitrary. The algorithm then finds the optimal threshold value which is returned as the output. • The horizon is plotted in the region between the foreground and the background and the score of the horizon is calculated.
  • 9. Finding the horizon in the image • After finding the horizon, the region above the horizon is removed. The resulting image will be the input image to the next stage. Figure 5: Input image Figure 6: output of Otsu’s thresholding Figure 7: plotting the Horizon Figure 8: Score of stage 2 Figure 9: output image
  • 10. Removing Foreground Gradient • Aim of this stage is calculate the smooth gradient (foreground) and the Object pixels in the image. Here the input image will be the output image of the stage 2. • The parts of the foreground image that are un-interesting are removed. • The physical ground is always recorded as the smooth gradient in an image and the gradient occurs in a direction perpendicular to the horizon. Hence we can remove the pixels of the foreground with this knowledge. Figure 10: Input image of stage 3 Smooth gradient 0 255 uneven gradient
  • 11. Removing Foreground Gradient • Let us consider the input image in matrix form. The values in the first column decreases gradually because of the smooth gradients and there are no objects in between. Figure 11: NumPy object array of input image
  • 12. Removing Foreground Gradient • To remove the smooth gradients, a condition is passed. “ if the value keeps decreasing and the difference between the lower pixel and upper pixel is less than or equal to the margin value, that pixel is removed. This is done to all the columns in the matrix. • If there is an object in between, the iteration is stopped for that particular column and it starts from the next column. After the iteration is complete, the output image of the final stage looks like this. Since the score of foreground gradient is 7.7 and object is 2.29, we can estimate that the image has maximum of foreground and medium object. Figure 13: Score of stage 3 Figure 12: output image of stage 3
  • 13. Graphical Analysis • This graph shows the analysis of intensity value of the left most column of the image. • Values move up gradually without any deviation.
  • 14. Graphical Analysis • This graph shows the analysis of intensity value of right most column of the image. • The gradient is smooth, as values move up gradually without any deviation
  • 15. Graphical Analysis • This graph shows the analysis of intensity value of the middle column of the image. • The gradient is not smooth because there is object in this part of the image, hence there is deviation in the graph. Uneven gradient
  • 16. Overall Score • The overall score is calculated by the following expression • C_1 * dark_score + C_2 * horizon_score + C_3 * gradient_score + C_4 * Object_pixels • Where C_i is weighted constants • The overall score will give you an estimate of the image scale or the field of view, where 0 being narrow field of view and 10, wide field of view. • In this case, the overall score will be • 0.4 * 5.107 + 0.4 * 5.29 + 0.2 * 7.7 + 0.2 * 2.29 = 6.1568 • Since the score is above 5, we can estimate that the Image has wider field of view with medium size object.
  • 17. Case 2 Figure 13: score stage 1 Figure 14: score stage 2 Figure 15: score stage 3 Final score = 0.4*3.16+0.4*3.53+0.2*3.69+0.2*6.3 = 4.46 Since the score is below 5, the image scale can be estimated as narrow field of view with large object.
  • 18. Conclusion • A simple approach to estimate the field of view of an unknown image • With the information obtained from this approach, one could then use existing approaches which are dependent on the field of view of the image.