92 lines
2.3 KiB
Markdown
92 lines
2.3 KiB
Markdown
---
|
||
title: "Local ternary patterns"
|
||
chunk: 1/1
|
||
source: "https://en.wikipedia.org/wiki/Local_ternary_patterns"
|
||
category: "reference"
|
||
tags: "science, encyclopedia"
|
||
date_saved: "2026-05-05T11:35:53.332732+00:00"
|
||
instance: "kb-cron"
|
||
---
|
||
|
||
Local ternary patterns (LTP) are an extension of local binary patterns (LBP). Unlike LBP, it does not threshold the pixels into 0 and 1, rather it uses a threshold constant to threshold pixels into three values. Considering k as the threshold constant, c as the value of the center pixel, a neighboring pixel p, the result of threshold is:
|
||
|
||
|
||
|
||
|
||
|
||
|
||
{
|
||
|
||
|
||
|
||
1
|
||
,
|
||
|
||
|
||
|
||
if
|
||
|
||
p
|
||
>
|
||
c
|
||
+
|
||
k
|
||
|
||
|
||
|
||
|
||
0
|
||
,
|
||
|
||
|
||
|
||
if
|
||
|
||
p
|
||
>
|
||
c
|
||
−
|
||
k
|
||
|
||
and
|
||
|
||
p
|
||
<
|
||
c
|
||
+
|
||
k
|
||
|
||
|
||
|
||
|
||
−
|
||
1
|
||
|
||
|
||
|
||
if
|
||
|
||
p
|
||
<
|
||
c
|
||
−
|
||
k
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
{\displaystyle {\begin{cases}1,&{\text{if }}p>c+k\\0,&{\text{if }}p>c-k{\text{ and }}p<c+k\\-1&{\text{if }}p<c-k\\\end{cases}}}
|
||
|
||
|
||
In this way, each thresholded pixel has one of the three values. Neighboring pixels are combined after thresholding into a ternary pattern. Computing a histogram of these ternary values will result in a large range, so the ternary pattern is split into two binary patterns. Histograms are concatenated to generate a descriptor double the size of LBP.
|
||
|
||
|
||
== See also ==
|
||
Local binary patterns
|
||
|
||
|
||
== References == |