Photo analysis - Image Pixel Manipulation

TatukGIS Internet Server LITE Samples

Choose analysis:

Source code    Project files

This IS LITE sample shows the use of various techniques for filtering frequencies of light to reveal greater contrast and detail, or to make easier the search for certain types of physical features in aerial photos.


photo.aspx    Top

                    
                    
<%@ Page Language="VB" Debug="True" %>
<%@ Register TagPrefix="ttkGIS" Namespace="TatukGIS.IS" Assembly="TatukGIS.IS" %>
<script runat="server">

    Sub GIS_FullExtent_Click(sender As Object, e As ImageClickEventArgs)
        GIS.FullExtent
    End Sub

    Sub GIS_ZoomIn_Click(sender As Object, e As ImageClickEventArgs)
        GIS.ZoomIn
    End Sub

    Sub GIS_ZoomOut_Click(sender As Object, e As ImageClickEventArgs)
        GIS.ZoomOut
    End Sub

    Sub GIS_Smaller_Click(sender As Object, e As ImageClickEventArgs)
        GIS.Width  = Unit.Pixel( GIS.Width.Value  - 54 )
        GIS.Height = Unit.Pixel( GIS.Height.Value - 40 )
    End Sub

    Sub GIS_Larger_Click(sender As Object, e As ImageClickEventArgs)
        GIS.Width  = Unit.Pixel( GIS.Width.Value  + 54 )
        GIS.Height = Unit.Pixel( GIS.Height.Value + 40 )
    End Sub

    Sub GIS_Load(sender As Object, e As EventArgs)
        Select Case DropDownListAnalyses.SelectedIndex
            Case "1"
                GIS.Open ( Page.MapPath( "data/photoColorCorrected.ttkgp" ) )
            Case "2"
                GIS.Open ( Page.MapPath( "data/photoHistogram.ttkgp" ) )
            Case "3"
                GIS.Open ( Page.MapPath( "data/photoInverted.ttkgp" ) )
            Case "4"
                GIS.Open ( Page.MapPath( "data/photoBlueChannel.ttkgp" ) )
            Case "5"
                GIS.Open ( Page.MapPath( "data/photoColorized_bw.ttkgp" ) )
            Case "6"
                GIS.Open ( Page.MapPath( "data/photoTransparent.ttkgp" ) )
            Case Else
                GIS.Open ( Page.MapPath( "data/photoNormal.ttkgp" ) )
        End Select

    End Sub

</script>
<html>
<head>
    <link href="style.css" type="text/css" rel="stylesheet" />
</head>
<body>
    <a name="top">
    <h1>Photo analysis - Image Pixel Manipulation
    </h1>
    <h2 class="comment">TatukGIS IS LITE Sample
    </h2>
    <form runat="server">
        <p>
            <asp:Table id="Table1" runat="server" Height="38px" BackColor="#E9E9E9" Width="360px">
                <asp:TableRow>
                    <asp:TableCell>
                        <asp:Label runat="server" id="Label1" cssclass="bold">Choose analysis: </asp:Label>
                    </asp:TableCell>
                    <asp:TableCell>
                        <asp:DropDownList runat="server" AutoPostBack="True" ID="DropDownListAnalyses">
                            <asp:ListItem Value="1">Normal</asp:ListItem>
                            <asp:ListItem Value="2">Colors corrected</asp:ListItem>
                            <asp:ListItem Value="3">Histogram enhance</asp:ListItem>
                            <asp:ListItem Value="4">Inverted</asp:ListItem>
                            <asp:ListItem Value="5">Only Blue chanel</asp:ListItem>
                            <asp:ListItem Value="6">B&W and colorized</asp:ListItem>
                            <asp:ListItem Value="7">Transparent</asp:ListItem>
                        </asp:DropDownList>
                    </asp:TableCell>
                </asp:TableRow>
            </asp:Table>
        </p>
        <p>
            <table style="WIDTH: 236px; HEIGHT: 199px" cellspacing="0" cellpadding="0" border="0">
                <tbody>
                    <tr>
                    <td>
                        <asp:ImageButton id="GIS_FullExtent" onclick="GIS_FullExtent_Click" runat="server" ImageUrl="/TatukGIS_IS8/img/fullextent.gif"></asp:ImageButton>
                        <asp:ImageButton id="GIS_ZoomIn" onclick="GIS_ZoomIn_Click" runat="server" ImageUrl="/TatukGIS_IS8/img/zoomin.gif"></asp:ImageButton>
                        <asp:ImageButton id="GIS_ZoomOut" onclick="GIS_ZoomOut_Click" runat="server" ImageUrl="/TatukGIS_IS8/img/zoomout.gif"></asp:ImageButton>
                    </td>
                    <td align="right">
                        <asp:ImageButton id="GIS_Smaller" onclick="GIS_Smaller_Click" runat="server" ImageUrl="/TatukGIS_IS8/img/smaller.gif"></asp:ImageButton>
                        <asp:ImageButton id="GIS_Larger" onclick="GIS_Larger_Click" runat="server" ImageUrl="/TatukGIS_IS8/img/larger.gif"></asp:ImageButton>
                    </td>
                    </tr>
                    <tr>
                        <td colspan="2">
                            <p>
                                <ttkGIS:XGIS_VIEWERIS id="GIS" runat="server" Height="240px" Width="360px" OnLoad="GIS_Load" BorderWidth="1px" BorderColor="CornflowerBlue"></ttkGIS:XGIS_VIEWERIS>
                            </p>
                        </td>
                    </tr>
                </tbody>
            </table>
        </p>
        <p>
        </p>
        <p>
        </p>
    </form>
    </a>
</body>
</html>

                    

photoNormal.ttkgp    Top

                    
                    
[TatukGIS Layer1]
Path=photo.jpg
Name=photo

                    

photoColorCorrected.ttkgp    Top

                    
                    
[TatukGIS Layer1]
Path=photo.jpg
Name=photo

Pixel.Red=-2
Pixel.Green=0
Pixel.Blue=3
Pixel.Brightness=5
Pixel.Contrast=10

                    

photoHistogram.ttkgp    Top

                    
                    
[TatukGIS Layer1]
Path=photo.jpg
Name=photo

Pixel.Histogram=true
; if parameter omited the default name will be used ( path + .his )
Pixel.HistogramFileName=histogram.his

; use histogram or create if not exist
Pixel.HistogramEqualize=true

                    

photoInverted.ttkgp    Top

                    
                    
[TatukGIS Layer1]
Path=photo.jpg
Name=photo

; make inversion at one step
Pixel.Inversion=true

                    

photoBlueChannel.ttkgp    Top

                    
                    
[TatukGIS Layer1]
Path=photo.jpg
Name=photo

;cut all red and green colours
Pixel.RedMapZone1=0,255,0,0
Pixel.GreenMapZone1=0,255,0,0

;leave only blue colour 
Pixel.BlueMapZone1=0,255,0,255

                    

photoColorized_bw.ttkgp    Top

                    
                    
[TatukGIS Layer1]
Path=photo.jpg
Name=photo

; convert to gray scale
Pixel.GrayScale=true

;color all scale to grey->blue
Pixel.GrayMapZone1= $55, $a0, $000000, $0099ff
Pixel.GrayMapZone2= $30, $50, $000000, $0099ff

                    

photoTransparent.ttkgp    Top

                    
                    
[TatukGIS Layer1]
Path=photo.jpg
Name=photo

; set a several transparent zones
Pixel.TransparentZone1= $000000, $5F5f5f 
Pixel.TransparentZone2= $aFafaf , $FFFFFF