How to convert newton basin into a binary image.

4 vues (au cours des 30 derniers jours)
Abiti Sendek
Abiti Sendek le 3 Jan 2017
I've recently made a newton basin using this program and slight variations of it. How do i take it a step further and convert the color map into a binary image, so that I can run box counting programs on them.

Réponse acceptée

Walter Roberson
Walter Roberson le 3 Jan 2017
near_z1 = c(:,:,2) > 0;
near_z2 = c(:,:,1) > 0 & ~near_z1;
near_z3 = c(:,:,3) > 0;
Note: in theory these can overlap -- after all, your roots might be very close to each other. However, because you set the red plane for both z1 and z2, in order to not have the z2 map include the z1 values unnecessarily, you have to exclude the places z1 was found. That is a problem because your code does not give any way to figure out the places where z1 and z2 should both be set.
If your code for z1 did not set the red plane as well as the green plane, it would be easy.
  2 commentaires
Abiti Sendek
Abiti Sendek le 4 Jan 2017
Modifié(e) : Abiti Sendek le 4 Jan 2017
Can you give me an example of how this is supposed to be implemented into the program? I tried it myself and the color map never converts into a black and white image. Could you tell me which part of the program this is supposed to go into?
I'm also assuming that this code could also be added into this other newtonpic program with minor tweaks?
Walter Roberson
Walter Roberson le 4 Jan 2017
imshow(near_z1)
You have 3 black and white images available, one for each of the z variables. The z1 and z2 will never overlap because of the way z2 had to be constructed but the z1 and z2 can overlap and the z2 and z3 can overlap. (The overlaps would happen if the input roots are close together.)

Connectez-vous pour commenter.

Plus de réponses (0)

Catégories

En savoir plus sur Fractals dans Help Center et File Exchange

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by