Java bufferedimage, write to the underlying grid, and the pixels are offset in the final image
Sorry for the thread dead software, I tried to generate a test version, which can be found here
https://www.dropbox.com/sh/y0wtlae37yltfz5/yRDSyKj2NY
The largest part of the download is the three sample images in the SRC folder (two of them are medical grade fundus images, so they are a little large) Sorry, if the overall size of the solution is still a little large, but without serious reflection, I can't remove it (I admit I don't get enough sleep and have to go to work in 20 minutes)
My original question is described below
That's my problem I have a bufferedimage human retina. Now I have successfully extracted the vascular structure from the eye using the adaptive thresholding device. The rest of the software processes to draw the blood vessels and determine their thickness. I believe this is a normal function The final result shows that all coordinates deviate from the actual position to a considerable extent (careful observation, you can see that some seeds have been correctly connected after the blood vessel, and the coordinates follow the rotation of the image. My question is what causes this offset and how can I remedy it?
Solution
The coordinates are not offset, but their scale is wrong: the red pixel coordinates are scaled by 0.75 (approximately) At odinveinthicknessgen Java line 333 attempts to replace
wRast.setPixel(x6,y6,redVal);
adopt
wRast.setPixel(x6 * 4 / 3,y6 * 4 / 3,redVal);
I don't know why, you should find it faster, because you know your code is better than me
The above is the Java bufferedimage collected and sorted by the programming home for you. Write it to the bottom grid, and the pixels are offset in the final image. I hope this article can help you solve the program development problems encountered by Java bufferedimage, write it to the bottom grid, and the pixels are offset in the final image.
If you think the content of the programming home website is good, you are welcome to recommend the programming home website to programmers and friends.