how to achieve xray style orthoimages

Any question about the main GUI application (frontend)
Post Reply
justgord
Posts: 7
Joined: Thu Feb 20, 2025 3:01 am

how to achieve xray style orthoimages

Post by justgord »

hi,

Is there a way to use the raster feature to make an xray style orthoimage ?

sample xray ortho here : https://quato.blob.core.windows.net/upl ... y_MVYG.png


To make an xray orthoimage you basically plot density, or point count over each xy cell - if more points occur above or below the xy cell, the score is higher and the xray image lighter.

For example a floorplan xray orthoimage would show walls as light areas, which makes for easy plan tracing to get a vector floorplan from the raster orthoimage.


I wonder if there is a way to achieve this, or would we need a fialog option "count" or "density" in addition to min/max/medium/average ??


[ ps. I notice in the code a mention of ccRasterGrid::PER_CELL_UNIQUE_COUNT_VALUE in ccRasterGrid.cpp.
This seems a similar computation : except we want a count of unique integer voxels above the xy cell occupied by points. This is better than raw point count, as it evens out the effect of higher density point counts closer to the scanner, lo some degree. nb, we want a count of occupied voxels, not the point or value count .. a voxel being a xyz cell above the xy cell of the raster ortho image ]


A related issue is .. if we want to get an orthimage of say a wall at an angle of 30deg from north, we would need to make a new sample pointcloud from that region, then use the raster feature .. there is no way to use the section tool local z axis / orientation ?
justgord
Posts: 7
Joined: Thu Feb 20, 2025 3:01 am

Re: how to achieve xray style orthoimages

Post by justgord »

in pseudocode : somethinhg like this :

Code: Select all

    case PER_CELL_UNIQUE_VOXEL_COUNT_VALUE:        
    {
    	 // count num voxels for "xray" ortho-image
    
        size_t count = 0;
        for (size_t n = 1; n < cellPointVal.size(); ++n)
        {
            int prev = round(cellPointVal[n - 1] / gridStep);
            int curr = round(cellPointVal[n] / gridStep);
            if (prev != curr)
            {
                ++count;
            }
        }
        sVal = static_cast<ScalarType>(count);
    }
    break;
daniel
Site Admin
Posts: 8158
Joined: Wed Oct 13, 2010 7:34 am
Location: Grenoble, France
Contact:

Re: how to achieve xray style orthoimages

Post by daniel »

So it was quite some time that I wanted to play with this idea.

I took a stab at it in the 'Rasterize' tool which is indeed the easiest way to do it for now.

I added a 'X-ray' option to the existing 'Hillshade' tab at the bottom left of the Rasterize tool window (now called 'Hillshade / X-ray').

It will create a scalar field with the accumulation value. You can then export the grid as a cloud if you want more rendering options (tweak the color scale, use the 'Display > Render to file' option, etc.).
cc_rasterize_xray.jpg
cc_rasterize_xray.jpg (315.09 KiB) Viewed 29277 times
You can test this in the latest 2.14.alpha version for Windows
Daniel, CloudCompare admin
justgord
Posts: 7
Joined: Thu Feb 20, 2025 3:01 am

Re: how to achieve xray style orthoimages

Post by justgord »

Daniel,

great - thanks for putting this xray feature in the next release / current beta.

I did grab the latest code and managed to get the xray view coming up in the preview in Raster dialog...

and it says its generated a new scalar field xray ..
BUT, I didnt seem to be able to save that as an image ?

g
justgord
Posts: 7
Joined: Thu Feb 20, 2025 3:01 am

Re: how to achieve xray style orthoimages

Post by justgord »

ok.. so it generates a new cloud with the xray 'height' .. then you rasterize that new cloud to get the ortho-image ?

That seemed to give the desired output.
Post Reply