Matlab: Distinguish land from ocean in harbors - matlab

I'm trying to distinguish land from ocean in harbors in Matlab. I have tried using the highest resolution maps from gshhs, but it isn't detailed enough. Below are is an example showing that it isn't detailed to the level I want. The one to the left showing the coastline boundaries and the other one showing the geoplot with basemap = 'streets'.
Comparison of the basemap and coastlines:
Since the map is able to plot in such detail, shown below, I would imagine that it should be able to distinguish land from ocean, just based on the colors.
Zoomed in basemap:
Appreciate any help here! Thanks in advance.

Related

How to design multi level highway intersection

So I am trying to design a multi-level highway system with the Road Traffic library in Anylogic. The highways have multiple levels and I am having trouble with depicting the difference in the levels of the roads in my model.
I looked at the help content related to RTL specifically Library Reference Guides and Tutorials but they don't mention adding grades/inclination to a road to get a multi level system.
I apologize in advance if I missed documentation related to this. But I would like to know how to do this in Anylogic.
Also, there is a Highway Junction model available in the sample models that comes with the installation and implements an increase in the z-value of the roads but I am not sure how to do that when designing the road.
When You draw road Object in RTL, in points section of the drawn road properties panel, you can set the Z value of each point of your road. So you should use more than two points to draw your road, even if it is a straight one. This way you can easily set z value of different points of your road, and build up needed levels, grades or slope of the road.
Hope this helps you.

Matlab - Working with specific region of interest

I have an image (see attached) and I am trying to calculate the variance of the image inside the region of interest (dark region) using the stdfilt function.Image here.
The dark side is what I need to work on. When I use stdfilt on this image, it shows me the boundaries of the dark and bright.
My idea is that we can threshold the image to show only the dark side and tell Matlab to work only with this region of interest. So far, did not find a proper way of doing this.
The area is not a perfect polygon, which would make things way easier. At that point, I'm not sure what to do, so any suggestions are welcome.
Cheers
If the spatial location of the pixels is not relevant, you could just do:
datatoprocess=I(I<threshold);
Being threshold a value that separates the white from black. [graythresh][1] is a fantastic function for that. datatoprocess will be a 1xN array with the pixel values.
If, instead, the spatial location of the pixels is relevant, then you need to modify your functions to not work on specific pixels. The best approach for this is generally setting NaN values in pixels you dont want to take into account.
Itoprocess=I;
Itoprocess(I>threshold)=NaN;
Without more information on what exactly are you doing with the image, this is the best anyone can get to.

Leaflet - markers in continuousWorld WITHOUT changing longitudinal points?

In reference to an earlier question I would like to know:
Using leaflet, is it possible to draw markers in multiple adjacent worlds(leaflet's continuousWorld) WITHOUT adjusting their longitudes?
Please understand, I don't want to use leaflet's worldcopyjump as it does not show markers in multiple worlds simultaneously.
A workaround is to change longitudes by 360 degrees (-900 to -540, -540 to -180 etc. to one side and 180 to 540, 540 to 900 etc. to the other side) while maintaining latitudes.
Apparently, leaflet does not offer automated marker repeat due to "performance concerns" (Quote from 2013). Yet, Google Maps offer this.
With a practical view to resolve this problem, I see two solutions and I'd appreciate comments on this:
Use Google visualization instead
Copy my list of nodes a few times each direction and adjust their longitudes (this is assuming the conventional consumer would not keep drag-droping the world ca. two-three times around)
Many thanks in advance,
Naibaf

Find correspondence between two sets of 2D points

I have two sets of 2D Points (shown in images below).
And I would like to find some high confidence correspondence between these dots.
These dots are extracted feature points from 2 camera images from different angles. Two images are relatively well rectified, though not perfect. However, there will be distortion/warp caused by depth in the scene, the number of points might not be the same, there might be outliers, etc.
One approach could be using a sliding window that contains multiple dots and try block matching. But that might be kind of slow. I feel like there should be a relatively straight forward solution to this problem.
For example, this paper might be addressing a similar problem.
You can use each dot/point in one of the images, and search for its "neighbors" in the other image.
Just a few days ago someone asked a similar question here, and got a very sophisticated (accepted) answer:
How to calculate the nearest neighbors using weka from the command line?
But maybe your problem is so common in image processing that there are even better solutions, but you might try this one (implemented in java).

Edge Detection Along Blood Vessel in Matlab

I am trying to specify a line across a blood vessel in an image, and then have matlab specify the edges of the vessel (which are contained within the line). The next part will be comparing changes in the distance between these edges over time (so across 1000x more images).
I have tried the following code to get started:
I = imread('Obj1.tif');
imshow(I,[]);
improfile
And I was looking at available methods to detect the edges from intensity along that line that gets plotted (tangents, maxima/minima etc) but I am not convinced this is the best method. I looked into other tools on matlab such as the Canny Method, Sobel etc, but the examples for all of these only show how to detect edges throughout the entire image. My coding skills are not sufficient to have the algorithms specified along a single line of the users choosing. Methods that I have looked at on pubmed also seem more complicated then perhaps I need.
Does anybody have any ideas or suggestions from the point that I am currently at?
Thank you