Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

The code works just for one image #2

Closed
Ng-ms opened this issue May 1, 2019 · 6 comments
Closed

The code works just for one image #2

Ng-ms opened this issue May 1, 2019 · 6 comments

Comments

@Ng-ms
Copy link

Ng-ms commented May 1, 2019

i tried the code with my image (512x512 ) but it did not work , what can i change to make it work for my data ?

@mmkamani7
Copy link
Owner

What error do you get? If you resize your image is it working?

@Ng-ms
Copy link
Author

Ng-ms commented May 1, 2019

ValueError Traceback (most recent call last)
in ()
1 print(mir_delD_yn.shape)
----> 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()

in flux(delD_xn, delD_yn)
88 nonNanPix = np.argwhere(np.invert(np.isnan(delD_xn) | np.isnan(delD_yn)))
89 for pix in nonNanPix:
---> 90 flux_x = Nx * delD_xn[pix[0] - 1:pix[0] + 2, pix[1] - 1:pix[1] + 2]
91 flux_y = Ny * delD_yn[pix[0] - 1:pix[0] + 2, pix[1] - 1:pix[1] + 2]
92 flux_x[1, 1] = np.nan

ValueError: operands could not be broadcast together with shapes (3,3) (0,0)
this is the error , i tried resize it as BW.png image but it gives the same error

@mmkamani7
Copy link
Owner

It seems that your matrix delD_xn is empty. What is the results of print(mir_delD_yn.shape)?

@ibragimoveldor
Copy link

Same issue.

@ibragimoveldor
Copy link

How to solve it?

@mmkamani7
Copy link
Owner

Same issue.

It seems that your matrix delD_xn is empty. What is the results of print(mir_delD_yn.shape)?
Check the outputs of this line to be correct and non empty:
D,IDX = morph.distance_transform_edt(BW,return_distances=True, return_indices=True)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants