dahtah/imager

<SOLVED> Output of "highlight" function

Closed this issue · 2 comments

Hi again,
Short version: I'm trying to get the output of the "highlight" function to be a list/vector/etc of coordinate pairs, but see that is instead a list of ... lists?? How can I reframe the output so that I can sort the pairs based on x or y values?

Long version:
I'm making progress calculating the circles and arcs that are in an image. What I would like to do is be able to pick off the coordinates of the points that make up the edge that I find. For example, this code:

library(imager)

test_url <- "http://www.considine.net/test5.jpg"

im <- load.image(test_url)
plot(im)

out <- cannyEdges(im)
#out <- threshold(im)#, "80%")
highlight(out, lwd=1)

draws a nice red line around the edge of the sun. What I want to be able to do is something like
temp <- highlight(out,lwd=1)
and then look at temp to pick off the coordinates of the ends of the arc (and the middle, incidentally).

But "temp" ends up being a structure that I don't quite understand. Can anyone suggest how it can be turned into a list of coordinate pairs?

TIA,
Matt

I think now that mapping the pixset "out" onto the output of pixset.grid may work. But it seems kludgy...
Matt

Solved using pixset...