Subscribe to this thread
Home - General / All posts - Detect blue swimming pool area with manifold
lionel

987 post(s)
#15-Apr-22 12:07

Does the detection of blue area of outdoor of private home swimming pool has been already done using manifold gis ?

Is there a way to select a range of color ( blue ?) where search must apply

Does elevation data ( which précision ?) can be use to limit the surface to study

I am interest of any comments, issues success. Feedback...


Book about Science , cosmological model , Interstellar travels

Boyle surface fr ,en

danb


1,946 post(s)
#16-Apr-22 20:32

I am guessing for tasks like this and the tree crowns in the other thread, Manifold really needs to gain some of the segmentation and classification tools of the sort Nick Verge was advocating back in the day.

Hopefully such things will arrive one day as the infrastructure seems perfect for achieving this with expedience. Mean time, QGIS has a host of add-ons for image classification and feature extraction as do things like R and of course GEE.


Landsystems Ltd ... Know your land | www.landsystems.co.nz

lionel

987 post(s)
#17-Apr-22 03:36

who is/was Nick Verge ? Does all his post was remove from manifold forum ? It is the man that have in a past a blog more about ESRI than manifold ?

Apart from the fact that he was banned from the forum (like me) and that his posts seem to have been the subject of heated passionate discussions ... I can't find any information about him using the google search engine! has he retired? what was his real name? is he still active on this forum ?

regard's


Book about Science , cosmological model , Interstellar travels

Boyle surface fr ,en

jsperr
134 post(s)
#17-Apr-22 14:10

I googled "nick verge manifold.net" and found Nicholas Verge has a LinkedIn profile --

Geologist at Earthscience Technologies -- Reading UK

artlembo


3,269 post(s)
#17-Apr-22 20:23

He was likely placed in a sort of purgatory of sorts, the forum blacklist. This is usually imposed when enough people on the forum vote to place someone there. If you go to your settings and click off

Hide posts from users in system blacklist

you will be able to look up his posts. Just be aware, you will also see lots of spam posts, as well.

danb


1,946 post(s)
#17-Apr-22 22:39

Nick Verge was a regular here 10 years plus ago while M9 was still in its gestation.

It doesn't really matter who he is, but amongst other things, he was a strong advocate for the inclusion of remote sensing tools tools in 9 when it appeared. To this end I believe that he put together and submitted some fairly extensive feature requests for this family of functionality.

If I remember correctly, one or more was posted publicly and it amounted to 100 or more pages.


Landsystems Ltd ... Know your land | www.landsystems.co.nz

oeaulong

419 post(s)
#18-Apr-22 05:14
lionel

987 post(s)
#18-Apr-22 18:36

In the past I didn't pay much attention to the content of his posts on the forum and I stayed away from manifold for several years. And from what I have read recently about his past posts ..I feel that his remarks were of a high standard.

I remember a second person who was not on the forum for long and was very critical of the manifold API and felt that his comments were well founded. Having now a better understanding of C# development, I could if his posts are still there and if the motivation is there make up my own mind!

Not being a developer myself, I have a real respect and admiration for innovative ergonomic software! Manifold is part of it with Lens of microsoft , mediachance ( oscar ) , geoclip , Fruity Loop aka FL studio ( Didier Dambrin belgium ) ,guitar pro from France , Miguel de icaza ( he was the surprise guest at a Microsoft conference held at the Bouglione winter circus in Paris..i was there !! ) andl Linus torvald because my first gis work has been done on postgis/postgresql on linux before discover manifold 6 and also now because linux wsl2 run on Microsoft OS and linus create github ( LinqPad use nuget ) .

Lidar let us do a lot of things .... I hope of 3D mapping ll appear soon (maplot better than C+ VTK)

LiDAR Tutorial using QGIS (datasciencescotland.github.io)

Remote Sensing with QGIS: Calculate NDVI – OpenSourceOptions

LiDAR Data Processing with LAStools and QGIS 3 (geodose.com)

How to Make A Beautiful Hillshading Map in QGIS (geodose.com)

I hope that detecting the blue area of the pool with manifold will be easy in the futur


Book about Science , cosmological model , Interstellar travels

Boyle surface fr ,en

Dimitri

7,066 post(s)
#19-Apr-22 05:17

I hope that detecting the blue area of the pool with manifold will be easy in the futur

Why? Is that something you need to do in Manifold? As a priority, where does that fit compared to other new features?

Those are important questions, because a GIS package should prioritize adding capabilities that most users require for real life work.

If a particular task is not a priority, then it is better to use other tools that already exist. For example, if you want to select all pixels that are a particular blue, within a range of tolerance, use Release 8.

You can also do that in 9 with SQL. RGB values for pixels are exposed by SQL functions, so using techniques similar to those described in topics like this one you can use well known methods of picking out tiles where the desired range of blue color exists based on the RGB values of pixels within those tiles. A 128 x 128 tile location is plenty accurate to locate a swimming pool given the resolution of aerial photos normally used for such tasks.

It also matters if what you want to do is to detect a particular range of colors or to find swimming pools. Finding swimming pools by detecting a distinctive range of blue colors is a limited approach, since many pools look gray, white, black, or other colors depending on the color balance of the photograph and depending on whether they have covers, are empty, etc.

Note also that there is an extensive literature online on detecting swimming pools in aerial photos using various techniques, which a few minutes with a search engine will reveal. Doing it on the basis of color is one approach for which you can use Release 8 or Release 9. Another approach is to use machine learning to detect swimming pools.

Machine learning is great, but it has the tremendous disadvantage of requiring a big capital investment to acquire the very large, curated collection of example "this is a swimming pool" photos. As a result, the detection of swimming pools, like many other machine learning applications, tends to be a market niche where a small number of expensive applications are sold.

For example, property tax assessors use such applications to detect swimming pools that have been built but not declared to tax authorities. They're willing to spend a lot of money for a specialty application that nobody else uses.

If you think that's a market worth going after, you don't really need a GIS to go after that market, since all the machine learning stuff is based on generic NVIDIA modules that can process images using command line interfaces. But if you wanted to use Manifold as an accessory, you could use the Manifold API to wire up a connection to the generic modules you choose to use.

artlembo


3,269 post(s)
#19-Apr-22 13:28

this is a very interesting take on machine learning. I apologize for this lengthy post, but I think the discussion is worth having. While I am in favor of doing really cool technological things, sometimes brute force is a better option. The basis for my thinking is a recent project we had on the eastern shore of Maryland (and Delaware) where we had to identify chicken houses: we are the home of Perdue Chicken, chicken houses are a big thing. We determined that using low cost labor was going to be more effective - an intern can process around 900 - 1000 parcels a day to determine if there is a chicken house on it. So, doing the math, we went in that direction. So, on to my thinking about this hypothetical situation for the pools:

As Dimitri points out, what is it we want to identify blue pools for? If it is to identify all the pools the the state, then yeah, we need some automated way to determine that. But, let's assume it is to identify pools that are in the county, and there is no pool permit for it. So, some back of the napkin thinking:

  • A large county in the US has about 80,000 - 100,000 property parcels.
  • Let's assume that 70% of the properties are residential - that makes 70,000 property candidates.
  • Also, assume that 15% have pool permits. So, that leaves 60,000 candidates that are residential properties without a pool permit.
  • Now, intersect building footprints with the properties to identify those residential properties that don't have enough room for a pool - probably whittles us down to 50,000 candidates.

With 50,000 properties to check, and if an intern can check 1,000 properties a day (just bounce from one property to the next on an aerial photo), then with 4 interns, you can complete the job in 12 days. If you pay each of the 4 interns $13/hr., then it would cost under $5,000 to identify the properties by hand.

Another option, is to determine the cost benefit (we did something like this for the chicken houses, as well). You could select 800 random residential properties without a pool permit. Then, have an intern check each one to determine which properties have a pool on them. Let's say we found 12. That means from our random sample of 800 properties, 1.5% of the properties have a pool on them without a permit. If we have 50,000 candidate properties, we can assume that around 750 properties in the county have illegal pools. Is finding, and fining 750 properties with illegal pools (once you determine that they are indeed in violation) worth the investment of $5,000? If so, then you can proceed with the process above. If not, you've saved yourself some money by not taking on the project. When we did this with the chicken houses, we were able to tell each county how many chicken houses they likely had, and they determined if the cost was worth it to identify them. But honestly, if I can find all the properties with an inground pool for under $5,000, it might be worth it (fire departments like to know where these are in a community so they can use them for firefighting, especially when there aren't hydrants nearby).

Anyway, that was a lot to say, but something we as GIS managers might have to evaluate when faced with a problem like this. We could burn 2 weeks of a senior GIS analyst's time (probably more than $5K) just trying to figure out a sophisticated way to solve the problem, when a brute-force method might get the job done. But again, if I was going to create a business to find pools in a county, and market it to hundreds of counties, then an automated way might be better.

dchall8
951 post(s)
#19-Apr-22 23:32

My appraisal district (35,000 parcels or so) has a contract with a company who outsources most of their "analysis" to India. They find pools and buildings hiding under trees by looking at oblique photography. They also find changes to the buildings from year to year, which can be very subtle, but they are pretty good at it. They charged us $200,000 plus the first year and $100,000 per year after that along with the photography both low res and limited high res. In Texas the appraised value is the market value. Inasmuch as a pool increases the market value, knowing which parcels have pools is pretty important.

I'm not suggesting that automating this into a Manifold feature should take any precedence away from more basic features. Perhaps someone could create an add-on tool to scan aerial photography for pools or whatever. Oh, and pools are not always blue, filled with water, or uncovered.

Dimitri

7,066 post(s)
#21-Apr-22 06:16

That brings to mind a new business opportunity: selling pool covers that are printed to look like grass, rows of vegetables, or tiled patios. Keep your pool free of leaves and also hide it from the tax man. :-)

geozap
218 post(s)
#20-Apr-22 03:42

To add to what you say, sometimes semi-automatic methods work even better. In the swimming pool example, firstly small blue (or even better water if specific non-visible spectrum pics are available) areas could be detected automatically, and then a human would iterate through detected areas to figure out actual pools.

It would be easier and more verslite for manifold to have generic and simple detection algorithms (for example blue areas with acreage between some limits), than pool of whatever specific tools.

lionel

987 post(s)
#20-Apr-22 02:01

In the south of France where it is good to live and where the well-to-do (rich) pensioners live, there are often few clouds and the pools are mostly light blue. I am told that some pools are declared as being water tanks for the fire brigade to avoid paying the tax. Below are two maps with a zoom on the France level and the city level from geoportail.

In the French news, an article informs French citizens that the French government is going to track undeclared swimming pools using the services of several private companies (google is named while we have engineers at the IGN).

Here i choose the town St Maxime that is place in front of St Tropez !!

Attachments:
piscine5.png
sainteMaxime_golfe-de_StTropez.png


Book about Science , cosmological model , Interstellar travels

Boyle surface fr ,en

lionel

987 post(s)
#20-Apr-22 02:33

Fraude fiscale en France: le logiciel de traque des piscines non déclarées coûte cher mais fonctionne mal

to summarise : 20 millions d'euros ... Google et Cap Gemini with 30 % errors on 9 departments !


Book about Science , cosmological model , Interstellar travels

Boyle surface fr ,en

lionel

987 post(s)
#20-Apr-22 16:24

Here , i use coloschemer Studio ( deprecated tool but photoshop can do this ) and extract 255 colors for Each photo . The first photo is the whole photo , the second photo is focus only on all selected areas of swimming pool by using paintnet and for each swimming pool : use magicwand and choose by eye the best tolerance value / cursor to be able to view only the swimming pool area selected.

In coloschemerStudio , the 2D view is HSL and if all the values inRGB are define ( 255x255x255) is not the same that HSL ( 100x100x360) ?

That mean that when compare color for each pixel in photo and range ( 2d 3D) of color we search , we must use the same unit ( rgb or hsl) and "tolerance" ( i mean increment value for % , increment value for hue . For rgb the increment value is always the same : 1 fom 0 to 255 )

Since there is no magic , if i have 255 point of blue the SQL work ll be done using only those 255 points so i think people need to use a way to create a surface that links thoses 255 points to define then a volume where all the points are inside !

using SQL we should be able to select a volume ( clound minimum 4 points) of colors points . If we have Rgb that use 3D axes XYZ then with oculus headset/glove-controler , We should sculpt ( substractive/ additive ) a sub volume from the initial cube ( 3D Color Picker) that contain all the colors from 0 to 255 from each RGB colors/coordinates.

Attachments:
colorSchemerStudio_blueOcean.png
hsl_rgb.png
selectOnly-swimmingPool_forhave_listofColor.png


Book about Science , cosmological model , Interstellar travels

Boyle surface fr ,en

ColinD

2,043 post(s)
#21-Apr-22 02:02

Here is a tool used in agriculture that might be adapted for pools

https://www.quantitative-plant.org/software/easypcc


Aussie Nature Shots

Dimitri

7,066 post(s)
#21-Apr-22 05:59

extract 255 colors for Each photo

If an image with only 255 indexed color values instead of a full RGB range of over 16 million colors will produce the results you want, then the job is trivially easy in Release 9: use the Trace transform to create vector areas for each color value (use a tolerance of 1) and select those which have Values that are the colors you want.

Starting indexed color image with a palette of 255 colors:

Trace applied with a tolerance of 1, and areas with Values of 45, 49, 50, and 51 selected:

It's easy to know what colors to select by making the vector layer partially opaque so you can see the image underneath, and then alt-clicking on areas of interest to see what color value they have.

Just those areas shown in brighter blue for visibility:

Not bad despite a very poor initial image with low contrast. Note that one of the pools, a rectangular pool towards the left edge of the image, is not picked up, because the indexed color for it is more gray than blue. Choosing that gray color for selection would add much noise because that gray color is used elsewhere.

But you could deal with that by adding a spatial size qualifier. One nice thing about using SQL is that you can pick areas which are both a particular color and also at least a minimum size, to eliminate noise from small areas.

Note also that one other pool, in the lower right corner, is not picked up because it is empty of water and appears to have used a white or gray color for the internal surface of the pool. Another possible pool in the upper right may have a white cover. Not much you can do about that when using colors to find pools.

You can also use Trace with RGB images, with a greater tolerance, which effectively picks out a range of "similar" colors, and then use elementary arithmetic on the Value vector that results to pick out what's closer to the "blue" you want.

using SQL we should be able to select a volume ( clound minimum 4 points) of colors points

Yes. That's exactly what computations like in the "well known" link I provided in my earlier post do. Finding a desired "volume" in a color cube (3 channel images) or hypercube (4 channel images, like RGB+IR), is a simple matter of a few calculations on values in the channels.

However, I think it would be better to take advantage of the vast experience in work with imagery. One reason people use the HSV model (Hue, Saturation, Value) is precisely to be able to choose colors by Hue, without having to mess with computations on multiple channels.

The approach in 9 is simple: using the Transform - Expression template for tiles, add a one-channel tile field to the table that is a computed Hue value, rounding the value to whatever level of accuracy you want. Integers, for example, will create an image with 360 Hue values. Create a one-channel image from that tile field and apply Trace to create areas by Hue. Pick the range of Hue valued areas you want using SQL. Done. To learn the formula to get Hue from RGB, google "convert RGB to HSV formula". Here's a link showing how to do it in Java, for example.

That has the advantage that it scales to 100 GB images, which consumer tools like colorSchemerStudio are unlikely to do as well.

I respectfully note that while I've provided details on how to go about this task, you've not yet replied to my question if this is something you personally really need to do, and, if so where you see that as a priority compared to other things. It's OK to have casual interests or idle curiosity (makes the world a more interesting place), but it's important to always phrase those with a sense of priority.

Attachments:
pools_01.png
pools_02.png
pools_03.png

Dimitri

7,066 post(s)
#21-Apr-22 06:19

Forgot to mention: the image I used with 255 color palette is a screen grab of lionel's photo of pools in France. The original may well have had better contrast, etc.

Dimitri

7,066 post(s)
#21-Apr-22 07:05

Thinking about this a bit more, there are many tools you can use in 9 to refine the above approaches. For example, the Sieve transform would work great for reducing the number of small, "noise" areas.

You could also pre-process images using TileMaskRange to flatten (reduce to one value) pixels that are not of interest to pick out with Trace, to reduce the number of noise areas generated in really large images. That would be useful when working with indexed images or a synthesized Hue channel: eliminate everything but the desired range of Hue values and just Trace on those.

If you pre-process sensibly with TileMaskRange you could "knock out" all pixels except those in the range of interest for what you think are pools, and thus totally eliminate the use of Trace, just styling the remaining pixels with bright color and making the others invisible. See the Examples in the User manual for knocking out pixels.

dchall8
951 post(s)
#21-Apr-22 15:05

I went to Google Maps to see if contrast was an issue, and it seems to be less hazy. This is a different neighborhood in the same area.

Swimming pool colors are all over the map (bwahahaha) in this image. Only a couple are the blue color we normally see. Could they be trying to trick the tax man by painting their plaster different colors?

Attachments:
Saint Tropez Neighborhood.jpg

lionel

987 post(s)
#21-Apr-22 20:16

No, pool detection is not an important or priority project for me, having read the article and the price paid by the French state, I was wondering if manifold could already do this as it supports already color raster files and altitude (lidar). Not knowing anything about tiles and the functions that can be used to do this, this problem is for me a user case that should be basic ( priiiority for people who work on detect specific item inside color image) : detect areas using altitude (pools are flat) and colours (often several shades of blue/grey, since blue is not a common natural color in a forest ) and a certain surface area (pools are not Olympic size). Otherwise, from space, there should not be much natural blue surface apart from rivers and the sea!

The results you get already look really good to me.

By working on a pool colour sample, this sample is valid and can detect all pools that were photographed on the same day in the same weather conditions. How can a cab we detect from a set of raster tiles those made on the same day (I assume that the light conditions were stable during the day when the aerial photographs were taken)?

Thank's a lot ...i ll work on this on my spare time and during my holidays in may !!


Book about Science , cosmological model , Interstellar travels

Boyle surface fr ,en

lionel

987 post(s)
#21-Apr-22 20:49

before i buy and use for first time manifold ( convert text law to geom /Table for be able to analayze geom data ) , I phone to know the price to a gis company to do the work .... manifold cost me 1/20 of the price and a lot of work to have the text data ( All department of france so 36000 communes ) and then convert text data to table and then link to geom/map ( work not done by the company ) .... I ask myself if the goverment have to pay too much for achieve swimming pool détection !! With osm cadastre the lat long point coordinate that is centered in the blue area can be link easely with the owner of parcel ( private data i think not open data ) !!

I don't believe in AI and I don't think monte carlo ( statistic and probaility) is AI so AI don't exist !!! and rather a marketing word !!


Book about Science , cosmological model , Interstellar travels

Boyle surface fr ,en

lionel

987 post(s)
#21-Apr-22 21:15

I love the idea of changing the colour system from RGB to HSL to make the work easier...


Book about Science , cosmological model , Interstellar travels

Boyle surface fr ,en

lionel

987 post(s)
#20-Apr-22 16:42

Why select range of color in 2D space when color exist in 3D both in hsl and Rgb representation !

.Web Safe Colors – Luis Garcia Designs (wordpress.com)

Attachments:
paintnet_blue.png
spectrum_tolerance.png


Book about Science , cosmological model , Interstellar travels

Boyle surface fr ,en

lionel

987 post(s)
#26-Jul-22 23:08

I bought a LoMaps maps of the south of France ( provence-alpes-cote_d_azur.osm.db and provence-alpes-cote_d_azur.osm.db ) for 100 LoCoins for use with LocusMap . Maps in LoMaps format are only optimised for the Locus Map application. I noticed that the roads are present but also the swimming pools ( empty or full, with clear bottom or not .... !!

So the best way to detect pools by the French government is not to waste taxpayers' money on well-known or innovative technology companies but to use the work done by the world's population on the osm maps for free.

With a bit of manifold SQL and two vector maps are enought for achieve best result, far from the 200 million euros currently spent according to the article! The two maps are: 1) a vector map of the cadastre ( also available from osm at http://cadastre.openstreetmap.fr) and 2) the vector map of France from osm where the contributors added not only roads but also swimming pools! ( available from osm at https://www.openstreetmap.org/#map=18/43.31088/6.64131 )

*.map file is not manifold file format extension but obtain after use a 100% java github project call MapsForge that follow Specification .

Attached is a screenshot of the same area currently available in osm.

NB support of map file format ll be nice for offline navigation !!

Attachments:
android_totalcommander_show_LocusMap_storage-Path.jpg
locuamp_sainteMaxime.jpg
osm_saintemaxime.png


Book about Science , cosmological model , Interstellar travels

Boyle surface fr ,en

Manifold User Community Use Agreement Copyright (C) 2007-2021 Manifold Software Limited. All rights reserved.