Detect buildings through photo scenery?

  • While listening to audio books, I outline squares and rectangles around houses and buildings. Hours upon hours it occurs to me, can we detect buildings through photo scenery just like we can detect trees? In some areas the OSM data is few. I read through some forums that Arno was working on it but I could not find a forum to confirm that it is possible yet? Thanks :thumbup:-The guy who asks alot of questions

  • Bing did that with satellite images, but I think they have multiple images from different views so they can use the parallax shift to see if that is just a flat parking lot with light gray concrete or a house roof with light gray material. Edge detection is nothing new in the area of photo content recognition and finding squares and boxes should be "easy". But not all houses are square or rectangular, some have very bizarre shapes and any code should also detect those.

    So yes its possible but developing a code for this takes way too long. Maybe there are existing implementations out there, that's a task for geographers.

    Regards,

    Jan

  • That makes sense. After I posted this I started thinking that some of these houses are not so basic and some areas i'm working on do not have the best satellite photo resolution for detection. ^^ Thanks for the reply Jan! Until then

    This is how I spent my Sunday, creating the town of Leadville Colorado

  • This has been done in the past, back in the times of FS2004 and the eraly years of FSX, but with extremely poor results.

    It's extremely difficult to setup automated algorithms to successfully detect houses from roof image only, especially in dense places with a lot of intricate roofs and concrete around, and determine an average rectangle building for it.

    Vegetation is much easier even if not flawless either.

    Cheers

    Antoine

    While listening to audio books, I outline squares and rectangles around houses and buildings.

    Are you doing this in OSM ?

    Cheers

    Antoine

    Config : i7 6900K - 20MB currently set at 3.20GHz, Cooling Noctua NH-U14S, Motherboard ASUS Rampage V Extreme U3.1, RAM HyperX Savage Black Edition 16GB DDR4 3000 MHz, Graphic Card Gigabyte GeForce GTX 1080 8GB, Power supply Corsair RM Series 850W, Windows 10 64 bit.

  • Are you doing this in OSM ?

    Cheers

    Antoine

    I use JOSM with the "Draw Buildings" plugin which automatically sets rectangles and squares to "Key=Building." Currently making my way up the mountains town by town west of Denver Colorado. I question my sanity on cultivating so many towns that don't have OSM data. :D

  • I question my sanity on cultivating so many towns that don't have OSM data. :D

    ^^ that's how the OSM database grows, allowing users (including you) to later use in ScenProc the building shapes you patiently draw and uploaded to the server while loosing your mind... :D

    Cheers and thanks for your precious contribution!

    Antoine

    Config : i7 6900K - 20MB currently set at 3.20GHz, Cooling Noctua NH-U14S, Motherboard ASUS Rampage V Extreme U3.1, RAM HyperX Savage Black Edition 16GB DDR4 3000 MHz, Graphic Card Gigabyte GeForce GTX 1080 8GB, Power supply Corsair RM Series 850W, Windows 10 64 bit.

  • How google maps or Maps (Apple) are able to represent the buildings in 3D?

    Google plane now also takes series of 45° aerial pictures allowing to reconstruct static 3D items - not only buildings...

    Cheers

    Antoine

    Config : i7 6900K - 20MB currently set at 3.20GHz, Cooling Noctua NH-U14S, Motherboard ASUS Rampage V Extreme U3.1, RAM HyperX Savage Black Edition 16GB DDR4 3000 MHz, Graphic Card Gigabyte GeForce GTX 1080 8GB, Power supply Corsair RM Series 850W, Windows 10 64 bit.

  • https://blogs.bing.com/maps/2018-06/m…us-as-open-data

    Devons rig

    Intel Core i5-13600K - Core i5 13th Gen 14-Core (6P+8E) @ 5.5Ghz / G.SKILL Trident Z5 RGB Series 32GB RAM DDR5 6000 / GIGABYTE GeForce RTX 4070Ti GAMING OC 12G / Sound Blaster Z / Oculus Quest 2 VR Headset / Klipsch® Promedia 2.1 Computer Speakers / ASUS ROG SWIFT PG279Q ‑ 27" IPS LED Monitor ‑ QHD / 6x Samsung SSD/NVME's various sizes / Windows 11 Pro 64-bit / GIGABYTE Z790 AORUS ELITE AX LGA 1700 ATX Motherboard DDR5

  • that's how the OSM database grows, allowing users (including you) to later use in ScenProc the building shapes you patiently draw and uploaded to the server while loosing your mind...

    Antoine you bring up a valid point, however with this comes a problem. I'm not truly doing OSM work, i'm more or less improvising my outlines of buildings for the sake of time and map making. Certain building shapes need to be edited so that scenProc can come in and detect them. I do not dare upload the work I do for most of it isn't fully accurate. Now if we had a Cultivation TOC file sharing database, I would gladly share everything i've done! Here's an example below.

  • This topic arises again in "Cultivation template file for scenProc." kenventions showed his scenProc indeed had no trouble detecting rooftops. Could it be achieved by swapping a few words from the script below?



    Before hand in the detection process I assume houses would be "Polygon" however what would be an appropriate Histogram Filter setting for houses? A setting that would only place one building point inside Polygon rather than multiple points.

    Replace these boxes with?

    Of course in second part of process this script would be replaced with "CreateAF2Building" etc.

    Perhaps I didn't hear correctly the first time but I feel so hopeful that this could in fact be achieved. Thanks guys.

  • I've used this process to generate 'ground' clutter in some areas. If you are intimately familiar with the area, you might not get the results you are hoping for.

    The trick is to try and get scenProc's texture filter editor to give you discrete buildings. The screenshot posted has many of the buildings smeared together in blobs. The blobs will detect as a one structure. It's helpful to work in smaller areas.. like 1/4 the size yet filling the screen. Pixels between structures are your friend.

    here's some code to get you started using 'polygons' not a single point as you mentioned. I haven't tried single centroid point methods.

    <--
    # Run this after you have generated your .tfc filter

    #-----------------------

    # Import the inf that points to your target bitmap

    ImportINF|C:\AERO FS tools\EarthWork\AreaFSInfo_Lp0_SnapOff_N040354610_N040342831_W074404549_W074383633.inf

    SplitGrid|0.25|*|building="*"

    # Load the tfc and detect the polys. Add 'building:yes' tag to each poly

    DetectFeatures|FTYPE="RASTER"|C:\AERO FS tools\EarthWork\structure_detect.tfc|String;building|yes|NONE

    #

    MergeGrid

    # Generate shape file

    ExportOGR|FTYPE="POLYGON"|ESRI Shapefile|C:\AERO FS tools\EarthWork\structure_detect_TEST.shp|building

    #-----------------------

    -->

    <--

    # Run this on the shapefile you created above

    #-----------------------

    #Load shape and Filter to buildings.

    ImportOGR|C:\AERO FS tools\EarthWork\structure_detect_TEST.shp|*|building|NOREPROJ

    SplitGrid|0.25|*|building="*"

    # Generate some structures (replace the create block below with something that makes sense for your area)

    # RESIDENTIAL only just some filters for variety so you can see 'something'

    CreateAF2Building|building="*" And FAREARAT>0.7 And FLENGTH < 14|1|1|gable|residential|0

    CreateAF2Building|building="*" And FAREARAT>0.7 And FLENGTH >= 14 And FLENGTH < 20|1|1|gable|residential|0

    CreateAF2Building|building="*" And FAREARAT>0.7 And FLENGTH >= 20 And FLENGTH < 28|2|1|gable|residential|0

    CreateAF2Building|building="*" And FAREARAT>0.7 And FLENGTH >= 28 And FLENGTH < 30|2|1|gable|residential|0

    CreateAF2Building|building="*" And FAREARAT>0.7 And FLENGTH >= 30 And FLENGTH < 32|2|1|gable|residential|0

    CreateAF2Building|building="*" And FAREARAT>0.7 And FLENGTH >= 32 And FLENGTH < 34|1|1|gable|residential|0

    CreateAF2Building|building="*" And FAREARAT>0.7 And FLENGTH > 34|2|1|gable|residential|0

    #

    MergeGrid

    # Export the TOC file

    ExportTOC|C:\AERO FS tools\EarthWork|structure_detect-Residential_TEST

    -->

    My true feelings: trying to get the filter to work correctly by fiddling with settings and samples is a huge time sink IMHO. For mass fill on areas you don't care about Crispy's road tracking method is probably better.

    Lately, in areas I care about.. I go to JOSM and generate my own buildings similar to the methods you outlined in your earlier post.

    Have Fun (that's what it's supposed to be all about)



    PS: You can also import the shapefile into JOSM and clean it up. Then export the layer as a .OSM file and run scenProc on that.
    --Rich

    Edited once, last by RjG (October 26, 2018 at 3:18 AM).

  • Yes! This was exactly what I was looking for! The script in fact did work. Everything you say is pretty accurate. I did get alot of houses to show up but clearly the filter settings need to be dialed in for fine tuning. This process is most definitely for areas you are not familiar with ^^. Thank you very much for all your insight on the topic!