How can I segment a colored line?

Davi Silva Romão :

I'm trying to segment the blue and black line of this image.

original image

but I was unable to segment them separately (using the OpenCV library in Java) and it resulted in this:

binarized image

I tried this function: mgproc.threshold(imgGray, imgThreshold, 0, 255, Imgproc.THRESH_BINARY + Imgproc.THRESH_OTSU);

How can I segment the blue and black lines separately using the OpenCV library?

user3842413 :

If the colors of the lines are a given, you can define a color range and filter the image.

Here is a sample code (not mine; taken from this website: https://pythonprogramming.net/color-filter-python-opencv-tutorial/)

lower_red = np.array([30,150,50])
upper_red = np.array([255,255,180])

mask = cv2.inRange(hsv, lower_red, upper_red)
res = cv2.bitwise_and(frame,frame, mask= mask)

cv2.imshow('frame',frame)
cv2.imshow('mask',mask)
cv2.imshow('res',res)

Este artigo é coletado da Internet.

Se houver alguma infração, entre em [email protected] Delete.

editar em
0

deixe-me dizer algumas palavras

0comentários
loginDepois de participar da revisão

Artigos relacionados

How can I represent a vector equation of a line segment in C++?

How can I change the background color of my MainActivity from a second activity using colored buttons as user choices?

How can I plot colored tip labels in ggtree without including it as part of the legend?

How app can find colored characters

How am i supposed to draw colored rectangles

How can I skip line with awk

How can I extract a substring in a line on linux

How can I add line break in userform?

How can I fit a nonlinear line in R?

How can I overlay a boxplot with a reference line

how can I draw a line with title in React?

How to add outliers as separate colored markers to a line plot

How can I do a line break (line continuation) in Elixir?

Colored Text Windows Command Line

How I can prevent line break after codeigniter error message?

How can I download a stanza's model via command line?

how can i make a sum in a line of numbers in python?

How can I build an Android apk without Gradle on the command line?

How can I create a new "file type" in the command line?

How can I use getopt with command line arguments in Swift 3?

How can I edit the command-line in LLDB?

How can i get the RGB value of specific straight line in the image?

How can I read userinput with the newline in python, that prints as a new line?

How can I accept multiple arguments in command line and process it correctly?

C# - How can I initilalize List<string[]> in the same line

How can I draw an area and plot a line from columns of df?

php How can I escape line break characters in a POST variable

how can i add points to geom_line plot in ggplot

How can i go to next line inside the th:text in Thymleaf?

TOP lista

  1. 1

    R Shiny: use HTML em funções (como textInput, checkboxGroupInput)

  2. 2

    O Chromium e o Firefox exibem as cores de maneira diferente e não sei qual deles está fazendo certo

  3. 3

    Como assinar digitalmente um documento PDF com assinatura e texto visíveis usando Java

  4. 4

    R Folheto. Dados de pontos de grupo em células para resumir muitos pontos de dados

  5. 5

    Gerenciar recurso shake de Windows Aero com barra de título personalizado

  6. 6

    Como obter dados API adequados para o aplicativo angular?

  7. 7

    UITextView não está exibindo texto longo

  8. 8

    Por que meus intervalos de confiança de 95% da minha regressão multivariada estão sendo plotados como uma linha de loess?

  9. 9

    Acessando relatório de campanhas na AdMob usando a API do Adsense

  10. 10

    Usando o plug-in Platform.js do Google

  11. 11

    Como posso modificar esse algoritmo de linha de visada para aceitar raios que passam pelos cantos?

  12. 12

    Dependência circular de diálogo personalizado

  13. 13

    Coloque uma caixa de texto HTML em uma imagem em uma posição fixa para site para desktop e celular

  14. 14

    iOS: como adicionar sombra projetada e sombra de traço no UIView?

  15. 15

    Como usar a caixa de diálogo de seleção de nomes com VBA para enviar e-mail para mais de um destinatário?

  16. 16

    Tabela CSS: barra de rolagem para a primeira coluna e largura automática para a coluna restante

  17. 17

    How to create dynamic navigation menu select from database using Codeigniter?

  18. 18

    Converter valores de linha SQL em colunas

  19. 19

    ChartJS, várias linhas no rótulo do gráfico de barras

  20. 20

    用@StyleableRes注释的getStyledAttributes。禁止警告

  21. 21

    não é possível adicionar dependência para com.google.android.gms.tasks.OnSuccessListener

quentelabel

Arquivo