• Which the release of FS2020 we see an explosition of activity on the forun and of course we are very happy to see this. But having all questions about FS2020 in one forum becomes a bit messy. So therefore we would like to ask you all to use the following guidelines when posting your questions:

    • Tag FS2020 specific questions with the MSFS2020 tag.
    • Questions about making 3D assets can be posted in the 3D asset design forum. Either post them in the subforum of the modelling tool you use or in the general forum if they are general.
    • Questions about aircraft design can be posted in the Aircraft design forum
    • Questions about airport design can be posted in the FS2020 airport design forum. Once airport development tools have been updated for FS2020 you can post tool speciifc questions in the subforums of those tools as well of course.
    • Questions about terrain design can be posted in the FS2020 terrain design forum.
    • Questions about SimConnect can be posted in the SimConnect forum.

    Any other question that is not specific to an aspect of development or tool can be posted in the General chat forum.

    By following these guidelines we make sure that the forums remain easy to read for everybody and also that the right people can find your post to answer it.

P3D v5 Water detection observations and UE's

Messages
1,518
Country
unitedstates
So I decided to jump into water detection with machine learning. There isn't any information on water machine learning in the users manual in particular so I am sort of looking at all examples, Chris's example, ext. I am starting small, just wanted to detect water. Maybe down the road I will combine all detections like Chris's script. Arno, do you have a sample script I could use or start with for water detection with machine learning/adding samples?

Here's my first attempt but not getting any preview results:

Water 1st script.jpg



My 2nd question is about the Merging Images steps. Is it important which step connects to the Merge Image inputs from top-to-bottom? Is that critical? To me, the manual reads like it is describing what will happen to each input but not what step/image should be connect to which input?

I like the maneuverability of the "steps/scripts" panel. Zooming, moving all the steps around at once. I did notice sometimes when I add a step It may dart off to the left while the script darts off out of view to the right or bottom. Not sure what I did to have that happen? I think I prevented it when I added a new step and clicked on an open part of the panel and then clicked back onto the step to move it into its proper place.

I did encounter my first UE1-water. All I did was add in-line the K-Means step to the script below.

UE1-water.jpg
 

arno

Administrator
Staff member
FSDevConf team
Resource contributor
Messages
32,859
Country
netherlands
So I decided to jump into water detection with machine learning. There isn't any information on water machine learning in the users manual in particular so I am sort of looking at all examples, Chris's example, ext. I am starting small, just wanted to detect water. Maybe down the road I will combine all detections like Chris's script. Arno, do you have a sample script I could use or start with for water detection with machine learning/adding samples?
I never did a lot of work on detecting water, so I don't have working samples for it. But I would start with the vegetation sample and just define the sample points differently (so green for water, red for anything else). And then try to improve it from there.
My 2nd question is about the Merging Images steps. Is it important which step connects to the Merge Image inputs from top-to-bottom? Is that critical? To me, the manual reads like it is describing what will happen to each input but not what step/image should be connect to which input?
The merge results checkbox applies to any step (except for the input step). When it is checked the output will be merging with the input.
I like the maneuverability of the "steps/scripts" panel. Zooming, moving all the steps around at once. I did notice sometimes when I add a step It may dart off to the left while the script darts off out of view to the right or bottom. Not sure what I did to have that happen? I think I prevented it when I added a new step and clicked on an open part of the panel and then clicked back onto the step to move it into its proper place.
Are you keeping your mouse button pressed at the moment? Only when the left mouse button is pressed the steps panel should pan around. I can't see how right clicking to add a step would trigger that, but I will see if I can reproduce it.
I did encounter my first UE1-water. All I did was add in-line the K-Means step to the script below.
I would have to try to reproduce it. But this filter makes no sense of course. With the threshold binary step you already have a black/white image of areas. What are you expecting that a K-means clustering object segmentation would still add in that case?
 
Messages
1,518
Country
unitedstates
Yea, I'm sure a lot of my filters will make no sense as I experiment to understand the effect or results that happen. I'll try your suggestion for water.
 
Messages
1,518
Country
unitedstates
As I start testing with water detection, I have come across this issue 3-4 times. Using my K-means script I was doing what you suggested Arno, simple selecting sample points to click positive on water bodies and negative to other areas. Seems to be promising. However, when I click on the Output Image step not only does the TFE close but scenProc closes as well? No UE or any message. Just closes.

I also noticed scenProc does not appear to be saving previous layout settings. I opened my previous script, saved it again and closed TFE. Reopened the same script and the layout was in the default mode. Then I closed TFE and scenProc. And re-opended the scenProc spc file I was just working on. Got an UE this time!? Closed it again and re-opened. This time no UE but I got one when I tried to re-open the previous TFE so it appears the tf2 has been corrupted. I will attach it if that helps to look at. I will create a new one, save and test to see if it retains the layout as I know you said if there is a UE or crash the layout will not be saved. FYI - your forums will not allow one to upload a .spc file. Thought that was a little funny,

Update - tried a new TF2-> saved -> re-opened and it opened with correct layout. I saved with split view but that is not saved? Maybe intended that way?

Further update - New script, this time TFE and scenProc closed as I was selecting sample points. After selecting a couple of points I clicked on an open area of the panel to let it process those now sample points. THis time everything closed again with not message or UE.
:)
 

Attachments

  • UE2-water.txt
    8.9 KB · Views: 71
  • AZ_AR26_scenPROC_Stage-2-water-BAD FILE.txt
    869 bytes · Views: 69
Last edited:

arno

Administrator
Staff member
FSDevConf team
Resource contributor
Messages
32,859
Country
netherlands
As I start testing with water detection, I have come across this issue 3-4 times. Using my K-means script I was doing what you suggested Arno, simple selecting sample points to click positive on water bodies and negative to other areas. Seems to be promising. However, when I click on the Output Image step not only does the TFE close but scenProc closes as well? No UE or any message. Just closes.
I haven't seen that before, but I will try to reproduce it. This should never happen of course.
I also noticed scenProc does not appear to be saving previous layout settings. I opened my previous script, saved it again and closed TFE. Reopened the same script and the layout was in the default mode. Then I closed TFE and scenProc. And re-opended the scenProc spc file I was just working on. Got an UE this time!? Closed it again and re-opened. This time no UE but I got one when I tried to re-open the previous TFE so it appears the tf2 has been corrupted. I will attach it if that helps to look at. I will create a new one, save and test to see if it retains the layout as I know you said if there is a UE or crash the layout will not be saved. FYI - your forums will not allow one to upload a .spc file. Thought that was a little funny,
The panning and zooming of the steps is not saved when saving the filter. So when reopening it again zoom is always 100% and default panning.

Or do you mean the panel positions when you talk about layout?
Update - tried a new TF2-> saved -> re-opened and it opened with correct layout. I saved with split view but that is not saved? Maybe intended that way?
Split view is not saved indeed, so you will always start without split view when you open it again.
Further update - New script, this time TFE and scenProc closed as I was selecting sample points. After selecting a couple of points I clicked on an open area of the panel to let it process those now sample points. THis time everything closed again with not message or UE.
On which step did you click for the update?
 
Messages
1,518
Country
unitedstates
What I have been doing is not click on another step to update but click on an open area in the bottom panel, where all the steps are. That way, I can see the results on my current step and make more edits if need be. I will say, first results look promising for water. :p
 

arno

Administrator
Staff member
FSDevConf team
Resource contributor
Messages
32,859
Country
netherlands
If you click on an open area it would select no step and you would see the input image.
 
Messages
1,518
Country
unitedstates
Correct, that was the purpose of clicking on open area. It does not advance the preview to another step as I am wanting to see the immediate results on the step I am working on. If I remember, its when I clicked on the output image step is when app completely closed. I guess I felt I was walking on eggshells as the app closed 3-4 times and I had to start a new script from scratch as the script became corrupted. It's all good. I just started new... worked slowly as I updated sample points, giving it time to refresh (10-15 seconds), before moving to another step or remaining on the same step.

I keep noting the situation which causes the app to close as there is no log I can submit. But when I did get a result, the water detection/machine leaning looks very promising. ANd that was using my veg detection script. Next will be implementing water detection steps.
 

arno

Administrator
Staff member
FSDevConf team
Resource contributor
Messages
32,859
Country
netherlands
Hi,

I did some testing to see if I can reproduce the crash, but I can't. Maybe you can show a screenshot of the texture filter you are using?

Are you using the split screen? Because if you have the output set on the second screen than clicking in the empty space will indeed trigger an update. But without split view it would result in selecting nothing and showing the input image.
 
Messages
1,518
Country
unitedstates
Working more with water detection, so I have a question. In the screenshot below, this is my basic "go to" script to start with. I have made no value changes to any steps and have added no sample points. As you can see, the NDWI (water) step detects the water quite nicely on the left preview panel. Yet, looking at the right preview panel at the output stage the same is not detected? Why would that be? Shouldn't what is already detected pass thru all the steps?

Also as a quick test, if I click on a few sample points on the water there is still no change on the output. Yet, if I swap out the NDWI (water) step for the NDVI (Veg), there is immediate results on the rightside preview panel. Seems as if the water step is not even working?

WA 47 default water det.jpg



Let me add one more question; can I add sample points regardless of what step I have currently "clicked" on? Or must I click on the SVM step and have the sample points tab selected as well?
 
Last edited:

arno

Administrator
Staff member
FSDevConf team
Resource contributor
Messages
32,859
Country
netherlands
Working more with water detection, so I have a question. In the screenshot below, this is my basic "go to" script to start with. I have made no value changes to any steps and have added no sample points. As you can see, the NDWI (water) step detects the water quite nicely on the left preview panel. Yet, looking at the right preview panel at the output stage the same is not detected? Why would that be? Shouldn't what is already detected pass thru all the steps?
No. If you run a SVM step without any sample points it will detect nothing and you get a empty output. You are providing the NDWI as one of the inputs to the SVM, but since you don't tell it what you want to detect it does not know on which objects it should train.
Also as a quick test, if I click on a few sample points on the water there is still no change on the output. Yet, if I swap out the NDWI (water) step for the NDVI (Veg), there is immediate results on the rightside preview panel. Seems as if the water step is not even working?
It should work with both NDWI and NDVI. Did you enough sample points and both negative and positive ones?
Let me add one more question; can I add sample points regardless of what step I have currently "clicked" on? Or must I click on the SVM step and have the sample points tab selected as well?
If the filter has a SVM step included you can add sample points as long as the sample points tab is shown. It does not matter which step is selected.
 

arno

Administrator
Staff member
FSDevConf team
Resource contributor
Messages
32,859
Country
netherlands
So I switch out the NDWI water step back to NDVI veg and I am getting a crash every time:
I haven't seen that error before. It seems you have a value that is so big it doesn't fit in the range of an integer. Do you get a more detailed stack trace? And does the error also happen in the editor?
 
Messages
1,518
Country
unitedstates
Do you get a more detailed stack trace?

Sorry, I do not understand what you are asking, what I should be looking for?

And does the error also happen in the editor?
No,the error only happens during processing, not in the TFE. Yea, that was a new error for me as well. I'll be performing many water detection tests over the next couple of weeks so I will watch closely for any mishaps or errors.

You said in a post above, "I never did a lot of work on detecting water". Does that mean you have stopped development of water detection? If yes, is that because you feel it is as far as you can take it or you have gotten bored with that side of development?
 

arno

Administrator
Staff member
FSDevConf team
Resource contributor
Messages
32,859
Country
netherlands
Sorry, I do not understand what you are asking, what I should be looking for?
The error is now shown as one line in the event log. There are more details on where the error comes from at the end of the line. did you get an error popup with the complete error message or can you save the log to TXT so that I can read all text?
You said in a post above, "I never did a lot of work on detecting water". Does that mean you have stopped development of water detection? If yes, is that because you feel it is as far as you can take it or you have gotten bored with that side of development?
No, it just means that in my projects there was never a need for water detection. And from my point of view vegetation and water detection are the same. It's all a matter of selecting certain pixels that represent a type of object. So from the code point of view there is no difference or specific development needed for it.
 
Messages
1,518
Country
unitedstates
I did get an error pop-up window that I sent to you. Hopefully you received it. If I remember correctly, the only thing I changed was the NDVI Veg step to the NDWI water step. I will be testing more on this tomorrow so I will watch closely,

"And from my point of view vegetation and water detection are the same"

That may be very true, with regards to coding, yet I am seeing very different results between the two. I may be very naive yet I would think the clustering is very different where vegetation deals more in shades of green but waters can vary in browns, greens, blues and even whites (rapids) and blacks (water in shade).

Would you be willing to take a look at a sample on water? I have the image, samples, simple script, tf2, everything ready to make it easy for you. I would luv for you to run and see if you get the same/different results.
 

arno

Administrator
Staff member
FSDevConf team
Resource contributor
Messages
32,859
Country
netherlands
I did get an error pop-up window that I sent to you. Hopefully you received it. If I remember correctly, the only thing I changed was the NDVI Veg step to the NDWI water step. I will be testing more on this tomorrow so I will watch closely,
I don't see the bug report in my bug tracker. If you get the error again, please try to submit it again.
That may be very true, with regards to coding, yet I am seeing very different results between the two. I may be very naive yet I would think the clustering is very different where vegetation deals more in shades of green but waters can vary in browns, greens, blues and even whites (rapids) and blacks (water in shade).
True, but that is the nice bit of the machine learning. It will by itself figure out what the right characteristics are. As long as you give it correct input data to work on.
Would you be willing to take a look at a sample on water? I have the image, samples, simple script, tf2, everything ready to make it easy for you. I would luv for you to run and see if you get the same/different results.
Sure, I can always have a look. Just send me the files in the usual way (I assume they will be big again :))
 
Messages
1,518
Country
unitedstates
This morning I got a new Unhandled Exception. Clicked to create a sample point and this was my setup:

UE4-water.jpg



Also, I received a crash with this setup where the TFE closes and scenProc closes with no error message. I then swapped the NDWI water step for the NDVI Veg step as I seem to have less issues. However, scenProc also disapeared with this step too. Nothing I can post on those.
 

Attachments

  • UE4-water.txt
    10.9 KB · Views: 72
Top