GithubHelp home page GithubHelp logo

yzhq97 / cnn-registration Goto Github PK

View Code? Open in Web Editor NEW
422.0 422.0 137.0 36.48 MB

An image registration method using convolutional neural network features.

License: MIT License

Python 100.00%
convolutional-neural-networks image-registration

cnn-registration's People

Contributors

rburkey2005 avatar yzhq97 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  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  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  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

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

cnn-registration's Issues

A suggestion

Would you like to upgrade the project to be compatible with newer library versions and Python version?

Application for medical images

Hello, I came across to this nice project and it seems quite powerful. Have you experienced to use it also for large histology images? Would you be interested in participating in AHNIR challenge?
You may also see other interesting methods from this domain Borda/BIRL#2

Embed CNN registration

Hi!

First of all congratulations for your work!

I would like to know if there is the possibility to incorporate your algorithm inside
a wider network that some point uses it.

Using CNN-REGISTRATION to produce homography for stitching of images to produce panorama

Dear Z. Yang and T. Dan and Y. Yang,

This is not much of an issue with the work that is produced by you, but more of a question regarding the capabilities of your work.

I am currently working on a project that tries to employ machine learning networks to detect, describe, and match keypoints for the purpose of matching 2D robot LiDAR maps. So far, I have been tinkering around with panorama techniques utilising SIFT and the OpenCV Stitcher class, and they both yield successful results only to a certain extent due to the nature of the images being feature-poor.

As such, I would like to ask: Can your cnn-registration work stitch overlapping images? (From what I understand, the registration produced by the code is equivalent to homography that is produced by OpenCV's cv2.findHomography)

If proven successful, I would like to referrence you in my Final Year Project.

No module named 'lap'

Hi, @yzhq97

I met this error when run demo.py

oem@sgi:/cnn-registration/src$
oem@sgi:
/cnn-registration/src$ python3 demo.py
Traceback (most recent call last):
File "demo.py", line 2, in
import Registration
File "/home/oem/cnn-registration/src/Registration.py", line 10, in
from lap import lapjv
ModuleNotFoundError: No module named 'lap'
oem@sgi:/cnn-registration/src$
oem@sgi:
/cnn-registration/src$

What's wrong with me?
I already installed pip3 install lap.
but this error happen.

Thanks in advance~

from @bemoregt.

requirements versions

Hello, I have so problem with running the demo even after porting to py3...
Could you add package version to requirements.txt to be able to run the demo, Thx

No pairwise_distance file to import

I was wrong about before, so I deleted the comment.

I am curious however if this supports images of different dimensions or if the input image must always be a static size?

Deformation matrix?

Is it possible to extract the deformation matrix in this registration? And if so, where in the code can this be found?

Unable to resolve simple rigid translations

I notice that if I translate IX by:

rows,cols = IX.shape[:-1]
M = np.float32([[1,0,100],[0,1,50]])
IY = cv2.warpAffine(IX,M,(cols,rows))

the registered image output is highly warped. One would think that it would detect a simple rigid body translation in this case...? Is there a way to force only rigid transformations?

How can I reduce the execution time of numpy.linalg.norm()?

While executing the script found that the numpy.linalg.norm() process is taking much time for execution. I have tried by reducing the number of points passed to the function and got better throughput but not such satisfiable for me. In the current situation, it is taking about 3-4 seconds for one comparison. How can I reduce it to below 1 second without much compromising the accuracy.

Communication

Hello zhuoqian. Could you please share the codes in the paper "Non-Rigid Image Registration With Dynamic Gaussian Component Density and Space Curvature Preservation"? I'd appreciate if you can show your email address. Look forward to your reply. Thanks a lot.

In addition, your homepage ( http://yzhq97.github.io/) seems inaccessible.

about the result

What does the third picture in the imshow window mean? , it seems that the first two pictures are just cropped and misplaced. Shouldn't image registration be to get an affine transformed image?

How did you compute RMSD, MAD, MED and STD

Hi, thank you for sharing your exciting work. I would ask how did you compute the RMSD, MAD, MED and STD? have you computed them between the registered and sensed image OR registered image and ground truth?

Please assist with this as it is not clear to me.
Kind regards,

some modifications for python3 to work

There are some minor modifications in order to make this great project work with python3

  1. In shape_context.py, change from utils import pairwise_distance to from utils.utils import pairwise_distance

  2. In utils.py, change all instances of xrange to range

  3. In utils.py, line 117, change hi, wi = height/n, width/n to hi, wi = height//n, width//n

Hope it helps.

How to use the RANSAC to remove the mismatching?

img_homo_gray1= cv2.cvtColor(IX, cv2.COLOR_BGR2GRAY)
img_homo_gray2= cv2.cvtColor(registered, cv2.COLOR_BGR2GRAY)

MIN_MATCH_COUNT =5
if matches>MIN_MATCH_COUNT:
M, mask = cv2.findHomography(X,Z, cv2.RANSAC,5.0)
matchesMask = mask.ravel().tolist()
print(matchesMask)
h,w =img_homo_gray1.shape
pts = np.float32([ [0,0],[0,h-1],[w-1,h-1],[w-1,0] ]).reshape(-1,1,2)
dst = cv2.perspectiveTransform(pts, M)
img_homo_gray2= cv2.polylines(img_homo_gray2, [np.int32(dst)], True, 255, 3, cv2.LINE_AA)
else:
matchesMask = None

#calaulate RANSAC matching point
sum = 0
for i in range(1,matches, 1):
if mask[i][0]==1:
sum += 1
print("RANSAC matching point: ",sum)
mismatching=matches-sum
print("mismatching:",mismatching)

#---------------------------------------------------------------------------------

Question: I don't know how to draw the matching line after doing RANSAC?

Ideas why results are unsatisfactory?

Hello,
Thanks for the model! I ran it to align two "satellite" images from different sensors (NAIP, DigitalGlobe). Unfortunately, the results look pretty unsatisfactory (see image). Do you have any ideas/thoughts how the results could be increased?

cnn_registration_w_hist

Thank you!
Björn

got unexpected results

Dear author,

I have tried to use your CNN based image registration method but got unexpected results. Here I have attached the fixed, sensed, registered and cp images. please take a look at it and let me know if the results are supposed to be like that. Initially, I was expecting an unbent registered image which doesn't have those extra black pixels.

Thanks.
fixed
moving
registered
cb

How many sample we can use to train?

I saw have two image ( 1a.jpg and 1b.jpg) in the img folder. They was used for comment line (python demo.py).
Can you explain for me, how do the registration work? And If we have many sameples, how do we use this code? For example, we have many samples, as following:
image

thank.

how to identify correct and incorrect points, and show by blue or yellow line?

Great code, thanks for sharing!
However, the filtering of matching feature points and the display of incorrect and correct matching points in blue and yellow respectively mentioned in the article seem to have no function definition. Could you please update this part?
Because I mainly want to use the extracted correctly matched feature points for other tasks!
I can't understand the code well enough to write the function to realize the above functions. If I can receive your share, it will be very helpful to my work. Looking forward to your reply!!
Thank you very much!!

drawmatches

Thank you very much for sharing the code. Now I want to take a look at the matching of feature points, and I have some difficulties in adding drawmatches function. Could you please provide the code to implement this function according to your code idea?
This will be of great help to me, thank you very much!

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.