|
Re: How can I find the central pixel? [message #47951 is a reply to message #47947] |
Fri, 10 March 2006 13:47  |
David Fanning
Messages: 11724 Registered: August 2001
|
Senior Member |
|
|
Julio writes:
> 'm studying a way to get some lat/longs from an image...
>
> I have a very large array (a binary-classified landsat image), where
> the pixels with the value '1' are soybean fields and the zero
> values represent no soybean.
>
> In this image there are large fields and small soybean fields. A
> 'large field' means a group of 50 or more soybean pixels. I have no
> interest on small fields. But I need to know the lat/long of the center
> of the larger soybean fields. In other words, I need a way to find the
> central pixel of the larger fields...
>
> Please, if you have an idea or a tip, comment this topic!
I'd use Label_Region to find the soybean fields. Be sure
you expand your image by a single pixel border if any of
the fields touch the edge, since Label_Region doesn't handle
edges well.
One by one, go through the fields. You can easily discard
any that are "too small" to be bothered with. If they
are of the proper size, you can use something like Find_Boundary
to located the boundary. At the same time it will calculate
the center, area, and the perimeter for you. Just set the
appropriate keywords. You can find Find_Boundary here:
http://www.dfanning.com/programs/find_boundary.pro
Cheers,
David
--
David Fanning, Ph.D.
Fanning Software Consulting, Inc.
Coyote's Guide to IDL Programming: http://www.dfanning.com/
|
|
|