Borrar filtros
Borrar filtros

error in edge function line 213

3 visualizaciones (últimos 30 días)
Rengasri
Rengasri el 15 de Dic. de 2023
Editada: DGM el 27 de Dic. de 2023
error description:error in line 213 [a,method,thresh,sigma,thinning,H,kx,ky] = parse_inputs(args{:});
  1 comentario
DGM
DGM el 15 de Dic. de 2023
Nobody can know what your code is, how you called edge() or what the actual error message was unless you actually tell us.

Iniciar sesión para comentar.

Respuestas (1)

Maneet Kaur Bagga
Maneet Kaur Bagga el 26 de Dic. de 2023
Editada: Maneet Kaur Bagga el 26 de Dic. de 2023
Hi Rengasri,
As per my understanding the edge function admits only GrayScale Images. Therefore assuming that the image used here is in rgb format, convert the image to gray scale using the "rgb2gray" function, and then apply the edge function to obtain the desired result.
Please refer to the following MATLAB Answer that address comparable issues to achieve the intended outcome.
For better understanding, refer to the MATLAB documentation below:
Hope this helps!
  2 comentarios
Dyuman Joshi
Dyuman Joshi el 26 de Dic. de 2023
@Maneet Kaur Bagga, How exactly do you know that OP encountered that particular error only?
How are you sure that OP has supplied a rgb image?
DGM
DGM el 27 de Dic. de 2023
Editada: DGM el 27 de Dic. de 2023
The given lines will be in the error backtrace for any error in any of the input arguments.
  • It could be because the image has more than one channel, but not all multichannel images are RGB.
  • Or maybe it's not a strictly real-valued numeric array.
  • Maybe the method string is invalid.
  • Maybe the threshold parameters aren't valid.
Given that OP doesn't need an answer anymore, I think it's fair to presume the likely case that it's RGB. After all, that has a good chance of helping future readers.
That said, there are plenty of times where I need to do edge finding on multichannel images in whole, without converting them to grayscale. An answer to that variant of the question creates new problems.
Answering dead questions gives us the latitude to choose our assumptions about the intent and context, but that's also why I sometimes like to address multiple possible interpretations of things in an answer. This is especially the case when the question itself is ill-defined. After all, we're not answering it for the OP anymore; we're answering it for everyone in the present and future who might hope to find an answer to their own interpretation of the question.

Iniciar sesión para comentar.

Categorías

Más información sobre Image Processing Toolbox en Help Center y File Exchange.

Productos


Versión

R2023a

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by