How to convert newton basin into a binary image.

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.

 Accepted Answer

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 Comments

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?
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.)

Sign in to comment.

More Answers (0)

Categories

Find more on Fractals in Help Center and File Exchange

Community Treasure Hunt

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

Start Hunting!