SlideShare a Scribd company logo
1 of 7
DIP Homework: 3
Q- 5 You are preparing a report and have to install in it an image of size 2048 * 2048 pixels?
a- Assuming on limitations on the printer, what would the resolution in line pairs mm
have to be for the image to fit in a space of size 5*5cm?
Answer: the resolution of the fitting in the space size of 5*5 can be calculated
2048 𝐿𝑖𝑛𝑒𝑠
50 𝑚𝑚
≅ 41 lines / min
≅ 20 lines / min
b- What would the resolution have to be in dpi for the image to fit in 2*2 inches?
Answer: the image resolution for fitting 2*2 inch will be calculated as
2048 𝑑𝑜𝑡𝑠
2 𝑖𝑛𝑐ℎ
= 1024 dots per inch
Q- 11 When discussing linear indexing in section 2.4, we arrived at the linear index in Eq.
(2.14) by inspection. The same argument used there can be extended to a 3-D array with
coordinates x,y and z, and corresponding dimensions M, N and P. The linear index for any
(x,y,z) is S = x + M (y + Nz) = x + Mg + Myz
Start with expression and
a- *Drive Eq. (2.15)
b- Drive Eq. (2.16)
Answer:
For 2D array to 1D array (leaner)
∝ = 𝑀𝑦 + 𝑥
𝑥 = ∝ +𝑥
⟹ 𝑦 =
𝑎−𝑥
𝑀
For 3D case we have
( 𝑥, 𝑦, 𝑧) ⟶ 𝑠
M
N
y
x
m-1
0
𝑠 = 𝑥 + 𝑚 ( 𝑦 + 𝑁𝑧) ⟹ 𝑥 = 𝑠 𝑚𝑜𝑑 𝑚
𝑠 − 𝑥 = 𝑚 (𝑦 + 𝑁𝑧)
𝑦 + 𝑁𝑧 =
𝑠−𝑥
𝑀
⟹ 𝑦 = (
𝑠−𝑥
𝑀
) 𝑚𝑜𝑑 𝑀
Since the (
𝑠−𝑥
𝑀
) < 𝑀 , (
𝑠−𝑥
𝑀
) 𝑚𝑜𝑑 𝑁 =
𝑠−𝑥
𝑀
. The maximum value of S is MN - 1 and, the
maximum of x is 0.
Q- 16 Develop an algorithm for converting a one-pixel-thick m-path to a 4-paths?
Answer: Any pixel p (x, y) has two vertical and two horizontal neighbors, given by (x+1,
y), (x-1, y), (x, y+1), (x, y-1) and This set of pixels are called the 4-neighbors of P, and is
denoted by N4 (P) and each of them are at a unit distance from P. We assume that (x,y) is
spatial location of the starting of 4-path. and in image path is represented by 1's and
remaining values are 0's.
1- we assign (p,q) is the m-connected neighborhood of (x,y) which is not processed yet
2- For each pixel is unit distance from (x,y)
3- Check whether the common 4-neighborhood pixel position of (x,y) and (p,q) is part of
existing path, if not make any one of the common 4-neighborhood to be 1, else no need
to do anything(because it is already 4-connected).
4- We assign (x,y )= (p,q)
5- 4-neighbors of p, denoted by N4(p): (x-1, y), (x+1, y), (x, y-1), and (x, y+1).
The solution to this problem consists of defining all possible neighborhood shapes to go from a
diagonal segment to a corresponding 4-connected segment, as shown in fig bellow. The algorithm
then simply looks for the appropriate match every time a diagonal segment is encountered in the
boundary for converting from an m-connected path to a 4-connected path simply involves
detecting diagonal segments and converting them to the appropriate 4-connected segment.
Q- 14 Consider the two image subsets, S1 and S2, shown in the following figure. For V = {1},
determine whether these two subsets are (a) 4-adjacent, (b) 8-adjacent, or (c) m-adjacent.
A- Let p and q be as shown in Fig. Then:
(a) S1 and S2 are not 4-connected because q is not in the set N4(p);
(b) S1 and S2 are 8-connected because q is in the set N8(p);
(c) S1 and S2 are m-connected because
(i) q is in ND(p), and
(ii) the set N4(p) ∩ N4(q) is empty
B- Paths
A (digital) path (or curve) from pixel p with coordinates (x, y) to pixel q with coordinates
(s, t) is a sequence of distinct pixels with coordinates
(x0, y0), (x1,y1), ……., (xn, yn)
 where (x0, y0) = (x, y), (xn, yn) = (s, t),
 and pixels (xi, yi) and (xi-1, yi-1) are adjacent for 1≤ i ≤ n.
 In this case, n is the length of the path.
 If (x0, y0) = (xn, yn) the path is a closed path.
 The path can be defined 4-,8-m-paths depending on adjacency type.
 Let S be a subset of pixels in an image. Two pixels’ p and q are said to be
connected in S if there exists a path between them consisting entirely of pixels
in S
 For any pixel p in S, the set of pixels that are connected to it in S is called
a connected component of S.
 If it only has one connected component, then set S is called a connected
set.
Q- 18 Consider the image segment show in the figure that follows
a- As in section 2.5, let V= {0,1} be the set of intensity values to defined adjacency.
Compute the lengths of the shortest 4-, 8- and m-path between p and q in the following
image. If a particular path does not exist between these points, explain why?
Answer- (a) When V = {0,1}, 4-path does not exist between p and q because it is impossible to get
from p to q by traveling along points that are both 4-adjacent and also have values from V. Figure
P2.15(a) shows this condition; it is not possible to get to q. The shortest 8-path is shown in Fig.
P2.15(b); its length is 4. The length of the shortest m- path (shown dashed) is 5. Both of these
shortest paths are unique in this case.
b- Repeat (a) by using V= {1,2}
Answer- (b) One possibility for the shortest 4-path when V = {1, 2}is shown in Fig.
P2.15(c); its length is 6. It is easily verified that another 4-path of the same length exists
between p and q. One possibility for the shortest 8-path (it is not unique) is shown in Fig.
P2.15(d); its length is 4. The length of a shortest m-path (shown dashed) is 6. This path is
not unique.
Q- 30 Give Venn diagram for the following expression?
a- *(𝑨 ∩ 𝑪) - (A ∩ B ∩ 𝑪 )
b- (𝑨 ∩ 𝑪) ∪ (𝑩 ∩ 𝑪)
c- B - [(𝑨 ∩ 𝑩)- (A ∩ B ∩ 𝑪 )]
d- B-B ∩ ( A ∪ C); Give that ( 𝑨 ∩ 𝑪)= ∅
Q- 37 We know from the E.q (2-45) that an offline transformation of coordinators given by
Where (x’,y’) are the transformed coordinators (x,y) are the original coordinator, and the
element of A are given in the table 2.3. for the various type of transformation. The inverse
transformation, A-1, to go from transformed back to the original coordinators in just as
important for performing inverse mappings.
a- Find the inverse scaling transformation?
b- Find the inverse translation transformation?
c- Find the inverse vertical and horizontal shearing transformation?
d- Find the inverse rotation transformation?
e- Show a composite inverse translate/rotation transformation?
Answer for the former of matrix
1 0 0
0 1 0
0 0 1
x = v and y = w
𝑐 𝑥 0 0
0 𝑐 𝑦 0
0 0 1
x’ = cx v and y’ = cy w
For the inverse translation transformation
1 0 𝑡 𝑥
0 1 𝑡 𝑦
𝑡 𝑥 𝑡 𝑦 1
x’ = v + tx and y’ = w + ty
For the inverse vertical and horizontal shearing transformation
1 𝑠 𝑥 0
0 1 0
0 0 1
x’ = v +sx w and y’ = w
1 0 0
𝑠 𝑘 1 0
0 0 1
x’ = v and y’ = sk x + w
For the inverse rotation transformation
−
𝑐𝑜𝑠 𝜃 𝑠𝑖𝑛 𝜃 0
𝑠𝑖𝑛 𝜃 𝑐𝑜𝑠 𝜃 0
0 0 1
x’ = v cos 𝜃 - w sin 𝜃 and y’ = v sin 𝜃 + w cos 𝜃
Note:
The above diagram used of OpenCV3 operates on images. Image operations are mainly based on
various coordinate transformations of images, such as scale transformation, rotation
transformation, translation transformation and offset transformation (horizontal or vertical). These
transformations are all directed at the coordinates of images, not the pixels of images. They can be
collectively called affine transformation. The above description is for several transformations in
Gonzalez's Digital Image Processing.

More Related Content

What's hot

Image Filtering in the Frequency Domain
Image Filtering in the Frequency DomainImage Filtering in the Frequency Domain
Image Filtering in the Frequency DomainAmnaakhaan
 
DIGITAL IMAGE PROCESSING - Day 4 Image Transform
DIGITAL IMAGE PROCESSING - Day 4 Image TransformDIGITAL IMAGE PROCESSING - Day 4 Image Transform
DIGITAL IMAGE PROCESSING - Day 4 Image Transformvijayanand Kandaswamy
 
Frequency Domain Image Enhancement Techniques
Frequency Domain Image Enhancement TechniquesFrequency Domain Image Enhancement Techniques
Frequency Domain Image Enhancement TechniquesDiwaker Pant
 
Image Enhancement in Spatial Domain
Image Enhancement in Spatial DomainImage Enhancement in Spatial Domain
Image Enhancement in Spatial DomainDEEPASHRI HK
 
Image Enhancement in Spatial Domain
Image Enhancement in Spatial DomainImage Enhancement in Spatial Domain
Image Enhancement in Spatial DomainA B Shinde
 
Image Enhancement using Frequency Domain Filters
Image Enhancement using Frequency Domain FiltersImage Enhancement using Frequency Domain Filters
Image Enhancement using Frequency Domain FiltersKarthika Ramachandran
 
Digital Image Processing: Image Segmentation
Digital Image Processing: Image SegmentationDigital Image Processing: Image Segmentation
Digital Image Processing: Image SegmentationMostafa G. M. Mostafa
 
Arithmetic coding
Arithmetic codingArithmetic coding
Arithmetic codingVikas Goyal
 
Smoothing in Digital Image Processing
Smoothing in Digital Image ProcessingSmoothing in Digital Image Processing
Smoothing in Digital Image ProcessingPallavi Agarwal
 
Homomorphic filtering
Homomorphic filteringHomomorphic filtering
Homomorphic filteringGautam Saxena
 
Image Restoration (Order Statistics Filters)
Image Restoration (Order Statistics Filters)Image Restoration (Order Statistics Filters)
Image Restoration (Order Statistics Filters)Kalyan Acharjya
 
Discrete cosine transform
Discrete cosine transform   Discrete cosine transform
Discrete cosine transform Rashmi Karkra
 
Sharpening using frequency Domain Filter
Sharpening using frequency Domain FilterSharpening using frequency Domain Filter
Sharpening using frequency Domain Filterarulraj121
 

What's hot (20)

Image Filtering in the Frequency Domain
Image Filtering in the Frequency DomainImage Filtering in the Frequency Domain
Image Filtering in the Frequency Domain
 
Wiener Filter
Wiener FilterWiener Filter
Wiener Filter
 
image compression ppt
image compression pptimage compression ppt
image compression ppt
 
DIGITAL IMAGE PROCESSING - Day 4 Image Transform
DIGITAL IMAGE PROCESSING - Day 4 Image TransformDIGITAL IMAGE PROCESSING - Day 4 Image Transform
DIGITAL IMAGE PROCESSING - Day 4 Image Transform
 
Frequency Domain Image Enhancement Techniques
Frequency Domain Image Enhancement TechniquesFrequency Domain Image Enhancement Techniques
Frequency Domain Image Enhancement Techniques
 
Image Enhancement in Spatial Domain
Image Enhancement in Spatial DomainImage Enhancement in Spatial Domain
Image Enhancement in Spatial Domain
 
Image Enhancement in Spatial Domain
Image Enhancement in Spatial DomainImage Enhancement in Spatial Domain
Image Enhancement in Spatial Domain
 
Image Enhancement using Frequency Domain Filters
Image Enhancement using Frequency Domain FiltersImage Enhancement using Frequency Domain Filters
Image Enhancement using Frequency Domain Filters
 
Digital Image Processing: Image Segmentation
Digital Image Processing: Image SegmentationDigital Image Processing: Image Segmentation
Digital Image Processing: Image Segmentation
 
Arithmetic coding
Arithmetic codingArithmetic coding
Arithmetic coding
 
Smoothing in Digital Image Processing
Smoothing in Digital Image ProcessingSmoothing in Digital Image Processing
Smoothing in Digital Image Processing
 
Walsh transform
Walsh transformWalsh transform
Walsh transform
 
Pixel relationships
Pixel relationshipsPixel relationships
Pixel relationships
 
Homomorphic filtering
Homomorphic filteringHomomorphic filtering
Homomorphic filtering
 
Unit ii
Unit iiUnit ii
Unit ii
 
Image Restoration (Order Statistics Filters)
Image Restoration (Order Statistics Filters)Image Restoration (Order Statistics Filters)
Image Restoration (Order Statistics Filters)
 
Discrete cosine transform
Discrete cosine transform   Discrete cosine transform
Discrete cosine transform
 
Sharpening using frequency Domain Filter
Sharpening using frequency Domain FilterSharpening using frequency Domain Filter
Sharpening using frequency Domain Filter
 
Bit plane coding
Bit plane codingBit plane coding
Bit plane coding
 
Spread spectrum
Spread spectrumSpread spectrum
Spread spectrum
 

Similar to DIP Homework: Image Resolution and Linear Indexing

pixelrelationships-m-1.pptx.ppt
pixelrelationships-m-1.pptx.pptpixelrelationships-m-1.pptx.ppt
pixelrelationships-m-1.pptx.pptJayanthHN1
 
DIP7_Relationships_between_pixels.ppt
DIP7_Relationships_between_pixels.pptDIP7_Relationships_between_pixels.ppt
DIP7_Relationships_between_pixels.pptakshaya870130
 
student-problem-solutions.pdf
student-problem-solutions.pdfstudent-problem-solutions.pdf
student-problem-solutions.pdfssuser4d4e5a
 
student-problem-solutions.PDF
student-problem-solutions.PDFstudent-problem-solutions.PDF
student-problem-solutions.PDFKarminderSingh7
 
Gmat quant topic 6 co ordinate geometry solutions
Gmat quant topic 6 co ordinate geometry solutionsGmat quant topic 6 co ordinate geometry solutions
Gmat quant topic 6 co ordinate geometry solutionsRushabh Vora
 
Chapter 2 Image Processing: Pixel Relation
Chapter 2 Image Processing: Pixel RelationChapter 2 Image Processing: Pixel Relation
Chapter 2 Image Processing: Pixel RelationVarun Ojha
 
GMAT Coordinate Geometry.pptx
GMAT Coordinate Geometry.pptxGMAT Coordinate Geometry.pptx
GMAT Coordinate Geometry.pptxRavindra gudapati
 
7.5 lines and_planes_in_space
7.5 lines and_planes_in_space7.5 lines and_planes_in_space
7.5 lines and_planes_in_spaceMahbub Alwathoni
 
E field dipole
E field dipoleE field dipole
E field dipoleFFMdeMul
 
Image Acquisition and Representation
Image Acquisition and RepresentationImage Acquisition and Representation
Image Acquisition and RepresentationAmnaakhaan
 
Fourier-transform analysis of a unilateral fin line and its derivatives
Fourier-transform analysis of a unilateral fin line and its derivativesFourier-transform analysis of a unilateral fin line and its derivatives
Fourier-transform analysis of a unilateral fin line and its derivativesYong Heui Cho
 
UNIT III Geometric curves unit 3 geometric modeling
UNIT III Geometric curves unit 3 geometric modelingUNIT III Geometric curves unit 3 geometric modeling
UNIT III Geometric curves unit 3 geometric modelingGunjanKolhe5
 

Similar to DIP Homework: Image Resolution and Linear Indexing (20)

pixelrelationships-m-1.pptx.ppt
pixelrelationships-m-1.pptx.pptpixelrelationships-m-1.pptx.ppt
pixelrelationships-m-1.pptx.ppt
 
Pixelrelationships
PixelrelationshipsPixelrelationships
Pixelrelationships
 
DIP7_Relationships_between_pixels.ppt
DIP7_Relationships_between_pixels.pptDIP7_Relationships_between_pixels.ppt
DIP7_Relationships_between_pixels.ppt
 
3.ppt
3.ppt3.ppt
3.ppt
 
student-problem-solutions.pdf
student-problem-solutions.pdfstudent-problem-solutions.pdf
student-problem-solutions.pdf
 
student-problem-solutions.PDF
student-problem-solutions.PDFstudent-problem-solutions.PDF
student-problem-solutions.PDF
 
3D-PPt MODULE 1.pptx
3D-PPt MODULE 1.pptx3D-PPt MODULE 1.pptx
3D-PPt MODULE 1.pptx
 
Ip unit 1
Ip unit 1Ip unit 1
Ip unit 1
 
Gmat quant topic 6 co ordinate geometry solutions
Gmat quant topic 6 co ordinate geometry solutionsGmat quant topic 6 co ordinate geometry solutions
Gmat quant topic 6 co ordinate geometry solutions
 
Signals and Systems Assignment Help
Signals and Systems Assignment HelpSignals and Systems Assignment Help
Signals and Systems Assignment Help
 
1525 equations of lines in space
1525 equations of lines in space1525 equations of lines in space
1525 equations of lines in space
 
Representation
RepresentationRepresentation
Representation
 
Chapter 2 Image Processing: Pixel Relation
Chapter 2 Image Processing: Pixel RelationChapter 2 Image Processing: Pixel Relation
Chapter 2 Image Processing: Pixel Relation
 
Digital Image Processing
Digital Image ProcessingDigital Image Processing
Digital Image Processing
 
GMAT Coordinate Geometry.pptx
GMAT Coordinate Geometry.pptxGMAT Coordinate Geometry.pptx
GMAT Coordinate Geometry.pptx
 
7.5 lines and_planes_in_space
7.5 lines and_planes_in_space7.5 lines and_planes_in_space
7.5 lines and_planes_in_space
 
E field dipole
E field dipoleE field dipole
E field dipole
 
Image Acquisition and Representation
Image Acquisition and RepresentationImage Acquisition and Representation
Image Acquisition and Representation
 
Fourier-transform analysis of a unilateral fin line and its derivatives
Fourier-transform analysis of a unilateral fin line and its derivativesFourier-transform analysis of a unilateral fin line and its derivatives
Fourier-transform analysis of a unilateral fin line and its derivatives
 
UNIT III Geometric curves unit 3 geometric modeling
UNIT III Geometric curves unit 3 geometric modelingUNIT III Geometric curves unit 3 geometric modeling
UNIT III Geometric curves unit 3 geometric modeling
 

Recently uploaded

Hybridoma Technology ( Production , Purification , and Application )
Hybridoma Technology  ( Production , Purification , and Application  ) Hybridoma Technology  ( Production , Purification , and Application  )
Hybridoma Technology ( Production , Purification , and Application ) Sakshi Ghasle
 
“Oh GOSH! Reflecting on Hackteria's Collaborative Practices in a Global Do-It...
“Oh GOSH! Reflecting on Hackteria's Collaborative Practices in a Global Do-It...“Oh GOSH! Reflecting on Hackteria's Collaborative Practices in a Global Do-It...
“Oh GOSH! Reflecting on Hackteria's Collaborative Practices in a Global Do-It...Marc Dusseiller Dusjagr
 
Kisan Call Centre - To harness potential of ICT in Agriculture by answer farm...
Kisan Call Centre - To harness potential of ICT in Agriculture by answer farm...Kisan Call Centre - To harness potential of ICT in Agriculture by answer farm...
Kisan Call Centre - To harness potential of ICT in Agriculture by answer farm...Krashi Coaching
 
mini mental status format.docx
mini    mental       status     format.docxmini    mental       status     format.docx
mini mental status format.docxPoojaSen20
 
Concept of Vouching. B.Com(Hons) /B.Compdf
Concept of Vouching. B.Com(Hons) /B.CompdfConcept of Vouching. B.Com(Hons) /B.Compdf
Concept of Vouching. B.Com(Hons) /B.CompdfUmakantAnnand
 
BASLIQ CURRENT LOOKBOOK LOOKBOOK(1) (1).pdf
BASLIQ CURRENT LOOKBOOK  LOOKBOOK(1) (1).pdfBASLIQ CURRENT LOOKBOOK  LOOKBOOK(1) (1).pdf
BASLIQ CURRENT LOOKBOOK LOOKBOOK(1) (1).pdfSoniaTolstoy
 
MENTAL STATUS EXAMINATION format.docx
MENTAL     STATUS EXAMINATION format.docxMENTAL     STATUS EXAMINATION format.docx
MENTAL STATUS EXAMINATION format.docxPoojaSen20
 
SOCIAL AND HISTORICAL CONTEXT - LFTVD.pptx
SOCIAL AND HISTORICAL CONTEXT - LFTVD.pptxSOCIAL AND HISTORICAL CONTEXT - LFTVD.pptx
SOCIAL AND HISTORICAL CONTEXT - LFTVD.pptxiammrhaywood
 
Presiding Officer Training module 2024 lok sabha elections
Presiding Officer Training module 2024 lok sabha electionsPresiding Officer Training module 2024 lok sabha elections
Presiding Officer Training module 2024 lok sabha electionsanshu789521
 
Organic Name Reactions for the students and aspirants of Chemistry12th.pptx
Organic Name Reactions  for the students and aspirants of Chemistry12th.pptxOrganic Name Reactions  for the students and aspirants of Chemistry12th.pptx
Organic Name Reactions for the students and aspirants of Chemistry12th.pptxVS Mahajan Coaching Centre
 
KSHARA STURA .pptx---KSHARA KARMA THERAPY (CAUSTIC THERAPY)————IMP.OF KSHARA ...
KSHARA STURA .pptx---KSHARA KARMA THERAPY (CAUSTIC THERAPY)————IMP.OF KSHARA ...KSHARA STURA .pptx---KSHARA KARMA THERAPY (CAUSTIC THERAPY)————IMP.OF KSHARA ...
KSHARA STURA .pptx---KSHARA KARMA THERAPY (CAUSTIC THERAPY)————IMP.OF KSHARA ...M56BOOKSTORE PRODUCT/SERVICE
 
Software Engineering Methodologies (overview)
Software Engineering Methodologies (overview)Software Engineering Methodologies (overview)
Software Engineering Methodologies (overview)eniolaolutunde
 
18-04-UA_REPORT_MEDIALITERAСY_INDEX-DM_23-1-final-eng.pdf
18-04-UA_REPORT_MEDIALITERAСY_INDEX-DM_23-1-final-eng.pdf18-04-UA_REPORT_MEDIALITERAСY_INDEX-DM_23-1-final-eng.pdf
18-04-UA_REPORT_MEDIALITERAСY_INDEX-DM_23-1-final-eng.pdfssuser54595a
 
Contemporary philippine arts from the regions_PPT_Module_12 [Autosaved] (1).pptx
Contemporary philippine arts from the regions_PPT_Module_12 [Autosaved] (1).pptxContemporary philippine arts from the regions_PPT_Module_12 [Autosaved] (1).pptx
Contemporary philippine arts from the regions_PPT_Module_12 [Autosaved] (1).pptxRoyAbrique
 
call girls in Kamla Market (DELHI) 🔝 >༒9953330565🔝 genuine Escort Service 🔝✔️✔️
call girls in Kamla Market (DELHI) 🔝 >༒9953330565🔝 genuine Escort Service 🔝✔️✔️call girls in Kamla Market (DELHI) 🔝 >༒9953330565🔝 genuine Escort Service 🔝✔️✔️
call girls in Kamla Market (DELHI) 🔝 >༒9953330565🔝 genuine Escort Service 🔝✔️✔️9953056974 Low Rate Call Girls In Saket, Delhi NCR
 
Alper Gobel In Media Res Media Component
Alper Gobel In Media Res Media ComponentAlper Gobel In Media Res Media Component
Alper Gobel In Media Res Media ComponentInMediaRes1
 
Interactive Powerpoint_How to Master effective communication
Interactive Powerpoint_How to Master effective communicationInteractive Powerpoint_How to Master effective communication
Interactive Powerpoint_How to Master effective communicationnomboosow
 

Recently uploaded (20)

Hybridoma Technology ( Production , Purification , and Application )
Hybridoma Technology  ( Production , Purification , and Application  ) Hybridoma Technology  ( Production , Purification , and Application  )
Hybridoma Technology ( Production , Purification , and Application )
 
“Oh GOSH! Reflecting on Hackteria's Collaborative Practices in a Global Do-It...
“Oh GOSH! Reflecting on Hackteria's Collaborative Practices in a Global Do-It...“Oh GOSH! Reflecting on Hackteria's Collaborative Practices in a Global Do-It...
“Oh GOSH! Reflecting on Hackteria's Collaborative Practices in a Global Do-It...
 
TataKelola dan KamSiber Kecerdasan Buatan v022.pdf
TataKelola dan KamSiber Kecerdasan Buatan v022.pdfTataKelola dan KamSiber Kecerdasan Buatan v022.pdf
TataKelola dan KamSiber Kecerdasan Buatan v022.pdf
 
Kisan Call Centre - To harness potential of ICT in Agriculture by answer farm...
Kisan Call Centre - To harness potential of ICT in Agriculture by answer farm...Kisan Call Centre - To harness potential of ICT in Agriculture by answer farm...
Kisan Call Centre - To harness potential of ICT in Agriculture by answer farm...
 
Código Creativo y Arte de Software | Unidad 1
Código Creativo y Arte de Software | Unidad 1Código Creativo y Arte de Software | Unidad 1
Código Creativo y Arte de Software | Unidad 1
 
mini mental status format.docx
mini    mental       status     format.docxmini    mental       status     format.docx
mini mental status format.docx
 
Concept of Vouching. B.Com(Hons) /B.Compdf
Concept of Vouching. B.Com(Hons) /B.CompdfConcept of Vouching. B.Com(Hons) /B.Compdf
Concept of Vouching. B.Com(Hons) /B.Compdf
 
BASLIQ CURRENT LOOKBOOK LOOKBOOK(1) (1).pdf
BASLIQ CURRENT LOOKBOOK  LOOKBOOK(1) (1).pdfBASLIQ CURRENT LOOKBOOK  LOOKBOOK(1) (1).pdf
BASLIQ CURRENT LOOKBOOK LOOKBOOK(1) (1).pdf
 
MENTAL STATUS EXAMINATION format.docx
MENTAL     STATUS EXAMINATION format.docxMENTAL     STATUS EXAMINATION format.docx
MENTAL STATUS EXAMINATION format.docx
 
SOCIAL AND HISTORICAL CONTEXT - LFTVD.pptx
SOCIAL AND HISTORICAL CONTEXT - LFTVD.pptxSOCIAL AND HISTORICAL CONTEXT - LFTVD.pptx
SOCIAL AND HISTORICAL CONTEXT - LFTVD.pptx
 
Presiding Officer Training module 2024 lok sabha elections
Presiding Officer Training module 2024 lok sabha electionsPresiding Officer Training module 2024 lok sabha elections
Presiding Officer Training module 2024 lok sabha elections
 
Organic Name Reactions for the students and aspirants of Chemistry12th.pptx
Organic Name Reactions  for the students and aspirants of Chemistry12th.pptxOrganic Name Reactions  for the students and aspirants of Chemistry12th.pptx
Organic Name Reactions for the students and aspirants of Chemistry12th.pptx
 
KSHARA STURA .pptx---KSHARA KARMA THERAPY (CAUSTIC THERAPY)————IMP.OF KSHARA ...
KSHARA STURA .pptx---KSHARA KARMA THERAPY (CAUSTIC THERAPY)————IMP.OF KSHARA ...KSHARA STURA .pptx---KSHARA KARMA THERAPY (CAUSTIC THERAPY)————IMP.OF KSHARA ...
KSHARA STURA .pptx---KSHARA KARMA THERAPY (CAUSTIC THERAPY)————IMP.OF KSHARA ...
 
Software Engineering Methodologies (overview)
Software Engineering Methodologies (overview)Software Engineering Methodologies (overview)
Software Engineering Methodologies (overview)
 
18-04-UA_REPORT_MEDIALITERAСY_INDEX-DM_23-1-final-eng.pdf
18-04-UA_REPORT_MEDIALITERAСY_INDEX-DM_23-1-final-eng.pdf18-04-UA_REPORT_MEDIALITERAСY_INDEX-DM_23-1-final-eng.pdf
18-04-UA_REPORT_MEDIALITERAСY_INDEX-DM_23-1-final-eng.pdf
 
Contemporary philippine arts from the regions_PPT_Module_12 [Autosaved] (1).pptx
Contemporary philippine arts from the regions_PPT_Module_12 [Autosaved] (1).pptxContemporary philippine arts from the regions_PPT_Module_12 [Autosaved] (1).pptx
Contemporary philippine arts from the regions_PPT_Module_12 [Autosaved] (1).pptx
 
call girls in Kamla Market (DELHI) 🔝 >༒9953330565🔝 genuine Escort Service 🔝✔️✔️
call girls in Kamla Market (DELHI) 🔝 >༒9953330565🔝 genuine Escort Service 🔝✔️✔️call girls in Kamla Market (DELHI) 🔝 >༒9953330565🔝 genuine Escort Service 🔝✔️✔️
call girls in Kamla Market (DELHI) 🔝 >༒9953330565🔝 genuine Escort Service 🔝✔️✔️
 
Alper Gobel In Media Res Media Component
Alper Gobel In Media Res Media ComponentAlper Gobel In Media Res Media Component
Alper Gobel In Media Res Media Component
 
Staff of Color (SOC) Retention Efforts DDSD
Staff of Color (SOC) Retention Efforts DDSDStaff of Color (SOC) Retention Efforts DDSD
Staff of Color (SOC) Retention Efforts DDSD
 
Interactive Powerpoint_How to Master effective communication
Interactive Powerpoint_How to Master effective communicationInteractive Powerpoint_How to Master effective communication
Interactive Powerpoint_How to Master effective communication
 

DIP Homework: Image Resolution and Linear Indexing

  • 1. DIP Homework: 3 Q- 5 You are preparing a report and have to install in it an image of size 2048 * 2048 pixels? a- Assuming on limitations on the printer, what would the resolution in line pairs mm have to be for the image to fit in a space of size 5*5cm? Answer: the resolution of the fitting in the space size of 5*5 can be calculated 2048 𝐿𝑖𝑛𝑒𝑠 50 𝑚𝑚 ≅ 41 lines / min ≅ 20 lines / min b- What would the resolution have to be in dpi for the image to fit in 2*2 inches? Answer: the image resolution for fitting 2*2 inch will be calculated as 2048 𝑑𝑜𝑡𝑠 2 𝑖𝑛𝑐ℎ = 1024 dots per inch Q- 11 When discussing linear indexing in section 2.4, we arrived at the linear index in Eq. (2.14) by inspection. The same argument used there can be extended to a 3-D array with coordinates x,y and z, and corresponding dimensions M, N and P. The linear index for any (x,y,z) is S = x + M (y + Nz) = x + Mg + Myz Start with expression and a- *Drive Eq. (2.15) b- Drive Eq. (2.16) Answer: For 2D array to 1D array (leaner) ∝ = 𝑀𝑦 + 𝑥 𝑥 = ∝ +𝑥 ⟹ 𝑦 = 𝑎−𝑥 𝑀 For 3D case we have ( 𝑥, 𝑦, 𝑧) ⟶ 𝑠 M N y x m-1 0
  • 2. 𝑠 = 𝑥 + 𝑚 ( 𝑦 + 𝑁𝑧) ⟹ 𝑥 = 𝑠 𝑚𝑜𝑑 𝑚 𝑠 − 𝑥 = 𝑚 (𝑦 + 𝑁𝑧) 𝑦 + 𝑁𝑧 = 𝑠−𝑥 𝑀 ⟹ 𝑦 = ( 𝑠−𝑥 𝑀 ) 𝑚𝑜𝑑 𝑀 Since the ( 𝑠−𝑥 𝑀 ) < 𝑀 , ( 𝑠−𝑥 𝑀 ) 𝑚𝑜𝑑 𝑁 = 𝑠−𝑥 𝑀 . The maximum value of S is MN - 1 and, the maximum of x is 0. Q- 16 Develop an algorithm for converting a one-pixel-thick m-path to a 4-paths? Answer: Any pixel p (x, y) has two vertical and two horizontal neighbors, given by (x+1, y), (x-1, y), (x, y+1), (x, y-1) and This set of pixels are called the 4-neighbors of P, and is denoted by N4 (P) and each of them are at a unit distance from P. We assume that (x,y) is spatial location of the starting of 4-path. and in image path is represented by 1's and remaining values are 0's. 1- we assign (p,q) is the m-connected neighborhood of (x,y) which is not processed yet 2- For each pixel is unit distance from (x,y) 3- Check whether the common 4-neighborhood pixel position of (x,y) and (p,q) is part of existing path, if not make any one of the common 4-neighborhood to be 1, else no need to do anything(because it is already 4-connected). 4- We assign (x,y )= (p,q) 5- 4-neighbors of p, denoted by N4(p): (x-1, y), (x+1, y), (x, y-1), and (x, y+1). The solution to this problem consists of defining all possible neighborhood shapes to go from a diagonal segment to a corresponding 4-connected segment, as shown in fig bellow. The algorithm then simply looks for the appropriate match every time a diagonal segment is encountered in the
  • 3. boundary for converting from an m-connected path to a 4-connected path simply involves detecting diagonal segments and converting them to the appropriate 4-connected segment. Q- 14 Consider the two image subsets, S1 and S2, shown in the following figure. For V = {1}, determine whether these two subsets are (a) 4-adjacent, (b) 8-adjacent, or (c) m-adjacent. A- Let p and q be as shown in Fig. Then: (a) S1 and S2 are not 4-connected because q is not in the set N4(p); (b) S1 and S2 are 8-connected because q is in the set N8(p); (c) S1 and S2 are m-connected because (i) q is in ND(p), and (ii) the set N4(p) ∩ N4(q) is empty B- Paths A (digital) path (or curve) from pixel p with coordinates (x, y) to pixel q with coordinates (s, t) is a sequence of distinct pixels with coordinates
  • 4. (x0, y0), (x1,y1), ……., (xn, yn)  where (x0, y0) = (x, y), (xn, yn) = (s, t),  and pixels (xi, yi) and (xi-1, yi-1) are adjacent for 1≤ i ≤ n.  In this case, n is the length of the path.  If (x0, y0) = (xn, yn) the path is a closed path.  The path can be defined 4-,8-m-paths depending on adjacency type.  Let S be a subset of pixels in an image. Two pixels’ p and q are said to be connected in S if there exists a path between them consisting entirely of pixels in S  For any pixel p in S, the set of pixels that are connected to it in S is called a connected component of S.  If it only has one connected component, then set S is called a connected set. Q- 18 Consider the image segment show in the figure that follows a- As in section 2.5, let V= {0,1} be the set of intensity values to defined adjacency. Compute the lengths of the shortest 4-, 8- and m-path between p and q in the following image. If a particular path does not exist between these points, explain why? Answer- (a) When V = {0,1}, 4-path does not exist between p and q because it is impossible to get from p to q by traveling along points that are both 4-adjacent and also have values from V. Figure P2.15(a) shows this condition; it is not possible to get to q. The shortest 8-path is shown in Fig. P2.15(b); its length is 4. The length of the shortest m- path (shown dashed) is 5. Both of these shortest paths are unique in this case. b- Repeat (a) by using V= {1,2} Answer- (b) One possibility for the shortest 4-path when V = {1, 2}is shown in Fig. P2.15(c); its length is 6. It is easily verified that another 4-path of the same length exists
  • 5. between p and q. One possibility for the shortest 8-path (it is not unique) is shown in Fig. P2.15(d); its length is 4. The length of a shortest m-path (shown dashed) is 6. This path is not unique. Q- 30 Give Venn diagram for the following expression? a- *(𝑨 ∩ 𝑪) - (A ∩ B ∩ 𝑪 ) b- (𝑨 ∩ 𝑪) ∪ (𝑩 ∩ 𝑪) c- B - [(𝑨 ∩ 𝑩)- (A ∩ B ∩ 𝑪 )] d- B-B ∩ ( A ∪ C); Give that ( 𝑨 ∩ 𝑪)= ∅ Q- 37 We know from the E.q (2-45) that an offline transformation of coordinators given by
  • 6. Where (x’,y’) are the transformed coordinators (x,y) are the original coordinator, and the element of A are given in the table 2.3. for the various type of transformation. The inverse transformation, A-1, to go from transformed back to the original coordinators in just as important for performing inverse mappings. a- Find the inverse scaling transformation? b- Find the inverse translation transformation? c- Find the inverse vertical and horizontal shearing transformation? d- Find the inverse rotation transformation? e- Show a composite inverse translate/rotation transformation? Answer for the former of matrix 1 0 0 0 1 0 0 0 1 x = v and y = w 𝑐 𝑥 0 0 0 𝑐 𝑦 0 0 0 1 x’ = cx v and y’ = cy w For the inverse translation transformation 1 0 𝑡 𝑥 0 1 𝑡 𝑦 𝑡 𝑥 𝑡 𝑦 1 x’ = v + tx and y’ = w + ty For the inverse vertical and horizontal shearing transformation 1 𝑠 𝑥 0 0 1 0 0 0 1 x’ = v +sx w and y’ = w 1 0 0 𝑠 𝑘 1 0 0 0 1 x’ = v and y’ = sk x + w
  • 7. For the inverse rotation transformation − 𝑐𝑜𝑠 𝜃 𝑠𝑖𝑛 𝜃 0 𝑠𝑖𝑛 𝜃 𝑐𝑜𝑠 𝜃 0 0 0 1 x’ = v cos 𝜃 - w sin 𝜃 and y’ = v sin 𝜃 + w cos 𝜃 Note: The above diagram used of OpenCV3 operates on images. Image operations are mainly based on various coordinate transformations of images, such as scale transformation, rotation transformation, translation transformation and offset transformation (horizontal or vertical). These transformations are all directed at the coordinates of images, not the pixels of images. They can be collectively called affine transformation. The above description is for several transformations in Gonzalez's Digital Image Processing.