New Post

Poplar Optimization Algorithm || Step-By-Step || ~xRay Pixy

Image
The Poplar Optimization Algorithm (POA) is a nature-inspired optimization method based on how poplar trees reproduce. It uses sexual propagation (seed dispersal by wind) for exploration and asexual reproduction (cutting and regrowth) for exploitation. Mutation and chaos factors help maintain diversity and prevent premature convergence, making POA efficient for solving complex optimization problems. Learn the Poplar Optimization Algorithm Step-By-Step using Examples. Video Chapters: Poplar Optimization Algorithm (POA) 00:00 Introduction 02:12 POA Applications 03:32 POA Steps 05:50 Execute Algorithm 1 13:45 Execute Algorithm 2 16:38 Execute Algorithm 3 18:15 Conclusion Main Points of the Poplar Optimization Algorithm (POA) Nature-Inspired Algorithm ā€“ Based on the reproductive mechanisms of poplar trees. Two Key Processes : Sexual Propagation (Seed Dispersal) ā€“ Uses wind to spread seeds, allowing broad exploration. Asexual Reproduction (Cuttings) ā€“ Strong branches grow ...

Local Directional Pattern (LDP)

 Local Directional Pattern


How to Calculate Local Directional Pattern (LDP) Code? With Example |Kirsch Compass Mask| ~xRay Pixy

Click here - > WATCH NOW

What are Local Directional Patterns?

LDP = Local Directional Pattern. Local Directional Pattern is a descriptor i.e., used for Face Recognition. 

What is Descriptor? 

Descriptors rely on Gradient-based or intensity variation approaches detect Local Features (e.g.,  Edges, Blobs and Regions).  BLOB = Binary Large Object (i.e., the region of the image). Descriptors such as HOG, SIFT, SURF (rely on local gradient computation).  Binary Descriptors such as BRISK, ORB or FREAK (rely on local intensity differences). Local Directional Pattern (LDP) Assign code for each pixel in the image. Local Directional Pattern (LDP) encoded image is divided into regions.

How LDP Calculate? 

For Each pixel in the image LDP computes an 8-bit binary code. 8-bit binary pattern is calculated by involving the local regions of the image of size 3x3 with Krisch Mask in 8 Directions. Local Directional Pattern (LDP) Local Regionā€™s Values: 


What is Kirsch Compass Mask? 

Local Directional Pattern (LDP) is Based on the known KIRSCH MASK. Kirsch Mask is non-linear Edge Detector. Using Kirsch mask we can find Edges in the following 8 direction: North, North West, West, South West, South, South East, East, North East.

How to Calculate Local Directional Pattern Value?


Calculation of Eight Directional Responses.

Calculate East Direction Mask i.e., š‘š_0

 E (East)

E = [ (5 * 30) + (5 * 25) + (5 * 10) + (-3 * 50) + (-3 * 40) + (-3 * 45) + (-3 * 55) + (-3 * 15) + (0 * 60) ]

E = [ 150 + 125 + 50 ā€“ 150 ā€“ 120 ā€“ 135 ā€“ 165  ā€“ 45 ā€“ 0 ] 

E = [ā€“ 290 ]

Calculate North Direction Mask i.e., š‘š_2

 N (North)

N = [ (5 * 55) + (5 * 15) + (5 * 30) + (-3 * 25) + (-3 * 10) + (-3 * 50) + (-3 * 40) + (-3 * 45) + (0 * 60) ]

N = [275 + 75 + 150 ā€“ 75 ā€“ 30 ā€“ 150 ā€“ 120 ā€“ 135 ā€“ 0  ] 

N = [ā€“ 10]

 Calculate South Direction Mask i.e., š‘š_6

 S (South)

S = [ (5 * 10) + (5 * 50) + (5 * 40) + (-3 * 45) + (-3 * 55) + (-3 * 15) + (-3 * 30) + (-3 * 25) + (0 * 60) ]

S = [50 + 250 + 200 ā€“ 135 ā€“ 165 ā€“ 45 ā€“ 90 ā€“ 75 ā€“ 0  ] 

S = [ā€“ 10]

 Calculate West Direction Mask i.e., š‘š_4

 W (West)

W = [ (5 * 55) + (5 * 45) + (5 * 40) + (-3 * 50) + (-3 * 10) + (-3 * 25) + (-3 * 30) + (-3 * 15) + (0 * 60) ]

W = [275 + 225 + 200 ā€“ 150 ā€“ 30 ā€“ 75 ā€“ 90 ā€“ 45 ā€“ 0  ] 

W = [ 310]


Rank Calculated Values in Ascending Order [Ranking of Directional Response]

(MSB, also called the high-order bit). the high-order bit or left-most bit


LDP is formed Considering only first 3 values of sorted Edge Response in descending order (i.e., largest to smallest).

LDP code for K = 3 is computed as:

š‘š_5 = 270   (3rd most significant directional response).

Calculate LDP Code of the pixel (x , y) : 

怖 š‘³š‘«š‘·ć€—_(š’™,š’š)  (š’Ž_šŸŽā€¦š’Ž_šŸ• )= āˆ‘_šŸŽ^šŸ•ā–’怖š’” (š’Ž_š’Šāˆ’š’Ž_šŸ“ )āˆ—šŸ^š’Š 怗

 Calculate LDP Binary Code of the pixel (x , y) 

怖 šæš·š‘ƒć€—_(š‘„,š‘¦)  (š‘š_0ā€¦š‘š_7 )= āˆ‘_0^7ā–’怖š‘  (š‘š_š‘–āˆ’š‘š_5 )āˆ—2^š‘– 怗

For i =  0, 

怖šæš·š‘ƒć€—_(š‘„,š‘¦)  (š‘š_0ā€¦š‘š_7 ) = āˆ‘_0^7ā–’怖š‘  (š‘š_0āˆ’š‘š_5 )āˆ—2^0 怗

怖šæš·š‘ƒć€—_(š‘„,š‘¦)  (š‘š_0ā€¦š‘š_7 ) = āˆ‘_0^7ā–’怖š‘  (āˆ’290āˆ’270)āˆ—1怗

怖šæš·š‘ƒć€—_(š‘„,š‘¦)  (š‘š_0ā€¦š‘š_7 ) = āˆ‘_0^7ā–’怖š‘  (āˆ’560) 怗 *  1

āˆ’ 560 < 0

 0 * 1

 0

For i = 1, 

怖šæš·š‘ƒć€—_(š‘„,š‘¦)  (š‘š_0ā€¦š‘š_7 ) = āˆ‘_0^7ā–’怖š‘  (š‘š_1āˆ’š‘š_5 )āˆ—2^1 怗

怖šæš·š‘ƒć€—_(š‘„,š‘¦)  (š‘š_0ā€¦š‘š_7 ) = āˆ‘_0^7ā–’怖š‘  (āˆ’250āˆ’270)āˆ—2怗

怖šæš·š‘ƒć€—_(š‘„,š‘¦)  (š‘š_0ā€¦š‘š_7 ) = āˆ‘_0^7ā–’怖š‘  (āˆ’520) 怗 * 2

āˆ’ 520 < 0

 0 * 2

 0

For i = 2, 

怖 šæš·š‘ƒć€—_(š‘„,š‘¦)  (š‘š_0ā€¦š‘š_7 ) = āˆ‘_0^7ā–’怖š‘  (š‘š_2āˆ’š‘š_5 )āˆ—2^2 怗

怖 šæš·š‘ƒć€—_(š‘„,š‘¦)  (š‘š_0ā€¦š‘š_7 ) = āˆ‘_0^7ā–’怖š‘  (āˆ’10āˆ’270)āˆ—4怗

怖 šæš·š‘ƒć€—_(š‘„,š‘¦)  (š‘š_0ā€¦š‘š_7 ) = āˆ‘_0^7ā–’怖š‘  (āˆ’280) 怗 * 4

āˆ’ 280 < 0

 0 * 4

0

For i = 3, 

怖šæš·š‘ƒć€—_(š‘„,š‘¦)  (š‘š_0ā€¦š‘š_7 ) = āˆ‘_0^7ā–’怖š‘  (š‘š_3āˆ’š‘š_5 )āˆ—2^3 怗

怖šæš·š‘ƒć€—_(š‘„,š‘¦)  (š‘š_0ā€¦š‘š_7 ) = āˆ‘_0^7ā–’怖š‘  (110āˆ’270)āˆ—8怗

怖šæš·š‘ƒć€—_(š‘„,š‘¦)  (š‘š_0ā€¦š‘š_7 ) = āˆ‘_0^7ā–’怖š‘  (āˆ’160) 怗 * 8

  - 160 < 0 

  0 * 8

0

For i = 4, 

怖šæš·š‘ƒć€—_(š‘„,š‘¦)  (š‘š_0ā€¦š‘š_7 ) = āˆ‘_0^7ā–’怖š‘  (š‘š_4āˆ’š‘š_5 )āˆ—2^4 怗

怖šæš·š‘ƒć€—_(š‘„,š‘¦)  (š‘š_0ā€¦š‘š_7 ) = āˆ‘_0^7ā–’怖š‘  (310āˆ’270)āˆ—16怗

怖šæš·š‘ƒć€—_(š‘„,š‘¦)  (š‘š_0ā€¦š‘š_7 ) = āˆ‘_0^7ā–’怖š‘  (40) 怗 * 16

 40 ā‰„0 

 1 * 16

16

For i = 5, 

怖šæš·š‘ƒć€—_(š‘„,š‘¦)  (š‘š_0ā€¦š‘š_7 ) = āˆ‘_0^7ā–’怖š‘  (š‘š_5āˆ’š‘š_5 )āˆ—2^5 怗

怖šæš·š‘ƒć€—_(š‘„,š‘¦)  (š‘š_0ā€¦š‘š_7 ) = āˆ‘_0^7ā–’怖š‘  (270āˆ’270)āˆ—32怗

怖šæš·š‘ƒć€—_(š‘„,š‘¦)  (š‘š_0ā€¦š‘š_7 ) = āˆ‘_0^7ā–’怖š‘  (0) 怗 * 32

 0 ā‰„0 

 1 * 32

32

For i = 6, 

怖šæš·š‘ƒć€—_(š‘„,š‘¦)  (š‘š_0ā€¦š‘š_7 ) = āˆ‘_0^7ā–’怖š‘  (š‘š_6āˆ’š‘š_5 )āˆ—2^6 怗

怖šæš·š‘ƒć€—_(š‘„,š‘¦)  (š‘š_0ā€¦š‘š_7 ) = āˆ‘_0^7ā–’怖š‘  (āˆ’10āˆ’270)āˆ—64怗

怖šæš·š‘ƒć€—_(š‘„,š‘¦)  (š‘š_0ā€¦š‘š_7 ) = āˆ‘_0^7ā–’怖š‘  (āˆ’280) 怗 * 64

 -280 <0 

 0 * 64

 0

For i = 7, 

怖šæš·š‘ƒć€—_(š‘„,š‘¦)  (š‘š_0ā€¦š‘š_7 ) = āˆ‘_0^7ā–’怖š‘  (š‘š_7āˆ’š‘š_5 )āˆ—2^7 怗

怖šæš·š‘ƒć€—_(š‘„,š‘¦)  (š‘š_0ā€¦š‘š_7 ) = āˆ‘_0^7ā–’怖š‘  (āˆ’130āˆ’270)āˆ—128怗

怖šæš·š‘ƒć€—_(š‘„,š‘¦)  (š‘š_0ā€¦š‘š_7 ) = āˆ‘_0^7ā–’怖š‘  (āˆ’400) 怗

 -400<0 

  0 * 128

 0

Calculated LDP Code = 0 * šŸ^šŸŽ+"0 āˆ— " šŸ^šŸ+"0 āˆ— " šŸ^šŸ+"0 āˆ— " šŸ^šŸ‘+"1 āˆ— " šŸ^šŸ’+"1 āˆ— " šŸ^šŸ“ " +0 āˆ— " šŸ^šŸ”+"0 āˆ— " šŸ^šŸ•

怖 š‘³š‘«š‘·ć€—_(š’™,š’š)  (š’Ž_šŸŽā€¦š’Ž_šŸ• ) = (0 * 1) + (0 * 2) +  (0 * 4) + (0 * 8) + (1 * 16) + (1 * 32) + (0 * 64) + (0 * 128)

怖 š‘³š‘«š‘·ć€—_(š’™,š’š)  (š’Ž_šŸŽā€¦š’Ž_šŸ• ) =  16 + 32 = 48

LDP CODE = 48

Local Directional Pattern Video for more Details 

How to Calculate Local Directional Pattern (LDP) Code? With Example |Kirsch Compass Mask| ~xRay Pixy

Click here - > WATCH NOW


Comments

Popular Post

PARTICLE SWARM OPTIMIZATION ALGORITHM NUMERICAL EXAMPLE

Cuckoo Search Algorithm for Optimization Problems

Particle Swarm Optimization (PSO)

PSO (Particle Swarm Optimization) Example Step-by-Step

PSO Python Code || Particle Swarm Optimization in Python || ~xRay Pixy

how is the LBP |Local Binary Pattern| values calculated? Step-by-Step with Example

Whale Optimization Algorithm Code Implementation || WOA CODE || ~xRay Pixy

Grey Wolf Optimization Algorithm

Grey Wolf Optimization Algorithm Numerical Example

Bat algorithm Explanation Step by Step with example