Message Boards Message Boards

How do I extract features of two different points in the image ?

Posted 10 months ago

Dear all,

How can I extract all features for any point in the images using Mathematica? For example, I would like to know what is difference between the features of points A and B in the following image.

GeoImage[GeoRange -> Entity["Country", "Morocco"]]

enter image description here

Thank you for your time.

POSTED BY: Alex Teymouri
3 Replies
Posted 10 months ago

Hi Alex,

Please clarify

  1. Are the two points random coordinates on an arbitrary image or are they geo-locations on Earth?
  2. What do you mean by "all features"? Geographic features (land/ocean, elevation, ...), weather features (temperature, wind speed, ...), geo-political features (place, region, population, ...), or what exactly?
POSTED BY: Rohit Namjoshi
Posted 10 months ago

Hi Rohit,

You are right.

  1. These two points have random coordinates. Consider two random points.
  2. Let's assume two pixels represent these two points. I need to determine the pixel intensity, RGB, and any other important features related to image characteristics.

All the best

POSTED BY: Alex Teymouri
Posted 10 months ago

Something like this?

image = GeoImage[GeoRange -> Entity["Country", "Morocco"]]
dimensions = ImageDimensions@image

(* Random point in the image *)
SeedRandom[123];
position = RandomInteger[{1, #}] & /@ dimensions

(* RGB values and color for that point *)
rgb = ImageData[image][[Sequence @@ position]]
color = RGBColor@rgb

(* Highlight the point on the image *)
HighlightImage[
  image,
  ImageMarker[position, Graphics[{Yellow, Disk[{0, 0}, Scaled[.02]]}]]]

Sampling a single pixel value is probably not a good idea. Get the RGB values for a small region around the point and average them.

POSTED BY: Rohit Namjoshi
Reply to this discussion
Community posts can be styled and formatted using the Markdown syntax.
Reply Preview
Attachments
Remove
or Discard

Group Abstract Group Abstract