How to install matlab in julia and how to occupy it

I need Matlab in julia…

I am not sure I understand what you are trying to do, but perhaps you are looking for

What I want to do is; How can I get the automatic Threshold of a july image?Automatic threshold of an image in matlab.

my project …

using ImageContrastAdjustment, Images, ImageFiltering, TestImages, ColorTypes, HistogramThresholding
const ICA = ImageContrastAdjustment

function example()

img = testimage("circulo")

# Grayscale image.
imgg = Gray.(img)

# Linear contrast stretching.
imggₗ = ICA.adjust_histogram(ICA.LinearStretching(), imgg)

# Histogram Equalization.
imggₑ = ICA.adjust_histogram(ICA.Equalization(), imgg)

#=
   admiminsion and subtracion
 =#
R₁ = float.(imggₗ) + float.(imggₑ)

R₂ = R₁ - float.(imggₑ)

#  imggₗ + imggₗ + imggₑ.
R₃ = R₁ + R₂

# Applying a minimum filter.
window_size = (-1:1, -1:1)
imgmin = mapwindow(minimum, R₃, window_size)

# divide el intervalo del valor más pequeño al más grande en imgmin en 256 bin
edges, counts = ICA.build_histogram(imgmin, 256, minval = minimum(imgmin), maxval = maximum(imgmin))

#=
La matriz `count` almacena en el índice 0 las frecuencias que estaban por debajo de
  primer borde del cubo. Ya que estamos buscando un umbral sobre el intervalo
  divididos por `edges` necesitamos descartar la primera bandeja en` count`
  de modo que las dimensiones de `edge` y` count` coincidan.
=#
t = find_threshold(Otsu(), counts[1:end], edges)

# Aplica el umbral a imgmin y checo el resultado.
img₀₁ = zeros(Gray{Bool}, axes(imgmin))
for i in CartesianIndices(img)
    img₀₁[i] = imgmin[i] < t ? 0 : 1
end
display(img₀₁)

end

example()

the picture is

It is still not clear what you are asking here.

The original question seems to be about something general (interfacing Matlab and Julia), the second one is about programming a specific problem in Julia.

I am not sure how the two are related, or why you need Matlab for this.

The method you link should be very simple to implement in Julia (if not done already, I didn’t check). Perhaps you could contribute it to one of the image processing libraries as a PR.

2 Likes

Excuse me if I did not make sense, I think I love the nights I have not slept.

The code you provide is made in Juno.

but I’ve been searching the internet for matlab in julia … and I found a process, and I thought it would be good to install matlab.

But my code does the opposite of what I require.

and I want to use the otsu method in that image. Through Julia-matlab. Or if not well, it would be in Julia, in console form.

Maybe this package: https://github.com/zygmuntszpak/ImageBinarization.jl is what you’re looking for for the binarisation; it does implement Otsu.

(If you really want to use Matlab, you’ll want to use the interop package mentioned already)

2 Likes