是否有任何内置的Java API或类库来访问给定图像中的像素? 我打算做的是在另一张图片中搜索一张图片。 例如:img1是24x24px,img2是1024x768px假设img2中可能存在类似于img1的符号。 现在我想获得与img1类似的符号的X和Y坐标。
Is there any inbuilt java API or class library for accessing pixels in a given image? What I am planning to do is search one image inside another image. For example : img1 is 24x24px , img2 is 1024x768px assume that a symbol, similar to img1 may exists in img2 . Now I want to get X and Y coordinates of the symbol which is similar to the img1.
最满意答案
是的,如果将图像作为BufferedImage则使用getRGB(int x, int y)方法获取位置(x,y)上像素的值。
请参阅java.awt.image.BufferedImage的API文档。
Yes, there is, if you have your image as a BufferedImage then use the getRGB(int x, int y) method to get the value of the pixel at the position (x, y).
See the API documentation of java.awt.image.BufferedImage.
更多推荐
img,API,电脑培训,计算机培训,IT培训"/> <meta name="description" con
发布评论