Code Monkey home page Code Monkey logo

skeletonization's People

Contributors

habi avatar mmkamani7 avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar

skeletonization's Issues

The code perhaps works just for one image

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)
Screenshot_20200622_164507
Help needed.

skeleton2Graph() function problem

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?

ValueError: operands could not be broadcast together with shapes (3,3) (0,0)

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

flux_error

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.