GithubHelp home page GithubHelp logo

Comments (3)

kkmcgg avatar kkmcgg commented on May 25, 2024 1

Hey Jeeah!

I think you're understanding this right but just to be clear: you will not need to access the tile information directly to get the function working function. The function should be stand alone and accept any image, such as the google sat tiles as an argument:
image

So! To run the function you will need some image data as an input. You should be able to call the getTile() function to get some google sat images for example, and feed that into the new function. The getTile() function returns tiles as 3-D numpy arrays (rasters with height, width, and 'depth' - which represents the various bands or image colors).

So,

IMG_RGB = core.getTile([-63.5752,44.6488,2],source='google_sat')

then

ND = core.norm_diff(IMG_RGB, B1=1, B2=2)

So (I think this is your real question) to get access to the individual bands inside the function we can use the following type of numpy syntax:
image

In numpy this is called slicing . Slicing allows us to grab and modify certain parts of the numpy array by their index. So in terms of numpy, think of our images as 3-D cubes of pixels :

image
Now, yes unfortunately the order of our slices in our case, thinking about the image, is Y,X,Z. The magical : character slices all values of a given index. So if we place that for the Y and X axis of the array, our slice will return all Y and X values. Then if we set our third index Z as the index of our band number (for example band 1 is the index 0), our slice will return that band as a greyscale image.

So again, to grab a given band from an image represented as a numpy array, Arr, we use the following syntax:

image

from aestheta.

Jeeah avatar Jeeah commented on May 25, 2024

I have a question. I know I need to make a function in core.py to do the math on the img bands but I am not sure how to access the bands from the google sat tiles.

from aestheta.

kkmcgg avatar kkmcgg commented on May 25, 2024

good work @Jeeah this function is working I'm going to close this issue

from aestheta.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.