Transcript for:
Generating Shapefiles from Drone Imagery Using Agisoft

Okay, good morning. My name is Randy Price. I work for the LSU AgCenter and I know some people had asked me how to get a shape type file from drone imagery that you can then use, hopefully get into either your precision farming software or straight into your console to actually make spray applications. different types of applications, variable rate stuff. So I'm going to show you that real quick because Agisoft has a pretty nice feature for that.

So we're going to go over here. We're going to open a previous orthomosaic that I made. This is one of Wheatfield where we took, you can see the blue is all the different images.

We took a red, green, and blue drone, which was a DJI Mavic Mini, and we just pointed the camera down and we flew strips. you know noting the rows and getting overlap recording like about 60 images over this wheat field to where we had enough images that we could then go and make an orthomosaic with it so we downloaded those photos we did a line we did build dense or build mesh we then saved it and then we said build orthomosaic and after we did that we had a file like this. And so this is the wheat field here.

You can see there's some high spots and some low spots. So this back here is just a background that Agisoft can put in. If you click on the background feature, so you have map. Or you can have satellite photo or probably zero. So this is the actual field we did.

Notice that we go out a little bit further than the border on this field. Okay, so if you want to make a shapefile, because if I save this right now it's in some type of JPEG or TIFF file or some type of world type GIS file that probably isn't very useful to you in trying to get it into your precision farming software. to make a map. You can go down here and you can say generate prescription map. So, oh let me do one thing before we talk about this.

In order to make a shapefile or a prescription map, you know, you're going to only want like three or four different levels. You know, I might want to put fertilizer at 20, 40, 60, and 80 or something like that. This map here has RGB data, which every value, there's a pixel that has red, green, and blue, and each red, green, and blue, and blue have a value from 0 to 255. So before you make a shapefile, you need to get this into some single number map where each pixel is related to one number.

And then that way you can then transfer that to some different... some different boundary or legend areas that all relate to the same aspect. So this is where indices come in. So usually go over here and on this on Agisoft you can go to this raster calculator It'll probably start out right here.

Go over the transform. And you can put in different equations. So I can put in the very equation, which is green minus red, divided by green plus red minus blue.

That's kind of an NDVI type intake. index for red, green, and blue or visual data. Or if this was some other NIR camera where one of these bands was NIR, you could put NDVI, which is NIR minus one of the colors, usually red, could be green in some cases, divided by NIR plus red.

And this will give you one single number on the map. So I'm just going to use GR on this one. So we're going to hit green. minus red.

And you can put whatever equation you want in here. There's parentheses, all kinds of things. You know, if you come up with some fancy equation that has like the soil type and all kinds of things, you can add that in and do square rooting and whatever. So I'm just going to use this one. This is one we use a lot, green minus red.

We have good luck with it. It seems to show the highs and lows fairly well in a field. And you can see where this is high, it's more green here, less green here. So this is where it's not growing as good.

So I'm going to hit Apply. and if it doesn't come up you may have to go down here and hit this enable transform hit apply again and there we go now we've got a map that is a single color a single value map for each pixel that ranges from 0 to 1 now on here I picked heat scale lets go over here to palette sometimes you need to recirculate this hit auto I've got heat scale if I'd done NDVI it would look something like this so that works too So where it's darker green, it's growing better. where it's less green like white or brown, it's near zero, not growing as well.

Sometimes I use heat scale because it really brings out the colors. I can see the red is where it's really growing and then I can see the green and the blue down here. So we'll leave it in NDVI because a lot of people are used to that type of scaling.

So once you get this single value map Then you're ready to try and make a shape file that you can use to generate a prescription map. So in Agisoft, it's pretty easy. Once you get this in indices type map, you go here and these are the...

the different areas where it will make all of these the same values. Right now we've got five areas. So let's do four areas.

Let's say we're going to spray four. Well, maybe five is good. We'll do five.

So these could be things like your grass could be right here and your soil could be here, you know, something like that. So sometimes you want to do different cell sizes. Let's do 10. One's awfully small. 100 is probably too big. 10 meters is probably a good size.

When this starts out, if you haven't done anything, it could be at 1, and that's really high definition stuff, so you probably don't want it set there. If you have a boundary file, you can import that to help chop the edges. So, so then you go down here and you, and this is where you'll have to decide what rate you want. Either talk to somebody and say, we need more fertilizer here, or this is really growing well, so we need less. So let's say here in Louisiana, you know, this could be, let's say we've already applied like 40 over the whole thing.

We know we're going to do a second of 40 to get 80 because we think 80 will bring us the full maturity of full population. So let's say this is growing well. We think well the soil is good enough we don't need anything there.

We're just gonna put 20. So in that zone we're going to add 20. Now make sure you look at these numbers to get it right. This is the better growing area up here according to green minus red. Anything more negative is not growing as good and anything more positive is growing better.

So I'm going to put 20. So we're going to put 40 here and sorry this is in kilograms per hectare you'd have to convert it. I usually do pounds per acre but this is just an example. You can get the right rates when you do this for real. Let's say we need 60 here and let's say we kind of think this might grow something but we're not sure so we're going to put 80. And then let's say we don't think we're going to grow anything there so let's put zero there. Wouldn't help if we even did put fertilizer on it.

Hit OK. Boom, there we have a shapefile. So you can take this shapefile and if you go up here, here's a prescription map. You can save this.

Let's say prescription map properties, export shapes. And we can write this and let's give it a shapefile. shape file, well let's call it prescription map, how about that.

Prescription not a very good spelling, let's say 5 layer or 5 rates. Ok remember where you sold it I mean sold it, excuse me, remember where you saved it saving it under this file here under desktop and hit save. Okay, you can do some different things like here, like what I want to save, and you know, this and that.

We're going to save it under this WGS coordinate system, because that's kind of a standard one here in America. Okay, once we get that, you may want to save this for future work. You can kill this, and let's go see what we got.

So a good way to check... To see kind of what you're getting stuff we need to load it into something. And let's go to Google Earth Pro. There are GIS systems, Quick GIS, other things where you can load this into.

So, I don't care about startup right now. So let's go File, Import. I'm going to try to import a file that I can see.

We've been doing some other stuff. So that was under Lucas. See if we can find that file. Here it is.

Lucas Bubanza Fields. Let's go to Shapefiles. Okay, here we are.

Five prescription rates, Shapefile. Hit Open. I guess so.

Okay. So when this comes up, let's go. Take us to it, and if you look right here, oops, let me go turn it on. Okay, oh, might have messed up a little there. Let's redo this.

Okay, hang on we might have imported it wrong Let's delete that one Let's reload it again. I may reloaded it wrong import Let's do this again. Let's hit no this time. There we go. Okay, so there you can see all the different rates and the different colors.

And this should be a file, a shape file that you should be able to get into either different precision farming software to make a sprayer file for your sprayer. or some console straight into that console to do rate control on a sprayer. Alright, so if you got any questions, my name is Randy Price. I work for the LSU AgCenter.

We can help you out with this to try and get you straight from imagery into some type of type of file. Remember there's hard to find equations about what you should actually put on but this is a way where you can at least find the different zones and do something to say this should be higher or lower than this and get into your spray truck. Alright thanks have a good day bye bye.