mmkamani7 / skeletonization Goto Github PK
View Code? Open in Web Editor NEWIn this repository you can see the code for skeletonization of binary images using our novel fuzzy inference system.
License: MIT License
In this repository you can see the code for skeletonization of binary images using our novel fuzzy inference system.
License: MIT License
i tried the code with my image (512x512 ) but it did not work , what can i change to make it work for my data ?
I run your code I got error no module named fuzzyTransform
Duplicates of #2 #5.
File "Skeletonization.py", line ..., in
fluxMap = flux(mir_delD_xn, mir_delD_yn)
File "skeleton2Graph.py", line 195, in flux
flux_x = Nx * delD_xn[pix[0] - 1:pix[0] + 2, pix[1] - 1:pix[1] + 2]
ValueError: operands could not be broadcast together with shapes (3,3) (0,0)
According to your instructions in #2, Igot
mir_delD_yn.shape: (284, 284)
the outputs of this line to be correct and non empty:
D,IDX = morph.distance_transform_edt(BW,return_distances=True, return_indices=True)
Help needed.
Hello, thanks for your code. When I run the demo, I got the problem saying "IndexError: only integers, slices (:
), ellipsis (...
), numpy.newaxis (None
) and integer or boolean arrays are valid indices" skelenton2Graph.py, line 329, in skeleton2Graph edgeLinkedLength = np.array(edgeLength)[map(int, list(np.abs(edgeLinkedNumber) - 1))].tolist(). My work environment is python3.x, windows. Maybe this is the different version of python that map function return different type result, can you help me solve this problem?
Hi, thanks for this good work, I was trying your method on my own image.
When calculating flux, I had this error message:
ValueError Traceback (most recent call last)
in
1 #Calculate flux map
----> 2 fluxMap = flux(mir_delD_xn,mir_delD_yn)
3 plt.imshow(np.nan_to_num(fluxMap))
4 plt.title('Flux Map')
5 plt.show()
~/CODES/Skeletonization-master/skeleton2Graph.py in flux(delD_xn, delD_yn)
199 print(pix[0],pix[1])
200 print(delD_xn[pix[0]-1:pix[0]+2,pix[1]-1:pix[1]+2].shape)
--> 201 flux_x = Nx * delD_xn[pix[0]-1:pix[0]+2,pix[1]-1:pix[1]+2]
202 flux_y = Ny * delD_yn[pix[0]-1:pix[0]+2,pix[1]-1:pix[1]+2]
203 flux_x[1,1] = np.nan
ValueError: operands could not be broadcast together with shapes (3,3) (0,0)
I print out some more information in flux function:
Nx = -1/np.sqrt(2) * np.array([[-1, 0, 1],[-np.sqrt(2), 0, np.sqrt(2)],[-1, 0, 1]])
print('NX=', Nx.shape)
Ny = -1/np.sqrt(2) * np.array([[-1, -np.sqrt(2), -1],[0, 0, 0],[1, np.sqrt(2), 1]])
print('NY=', Ny.shape)
flux = np.zeros(delD_xn.shape)
print('flux=', flux.shape)
flux.fill(np.nan)
nonNanPix = np.argwhere(np.invert(np.isnan(delD_xn) | np.isnan(delD_yn)))
print('nonNanPix=', nonNanPix.shape)
for pix in nonNanPix:
print(pix[0],pix[1])
print(delD_xn[pix[0]-1:pix[0]+2,pix[1]-1:pix[1]+2].shape)
..............................
NX= (3, 3)
NY= (3, 3)
flux= (1603, 1335)
nonNanPix= (1456285, 2)
0 0
(0, 0)
It looks that something wrong to find out nonNanPix, but I don;t understand why, I also attached my image, could you take a look? Thanks.
Fan
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.