Python Forum
how to compare two different size images in python and find corresponding pixel value
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
how to compare two different size images in python and find corresponding pixel value
#1
[I'm currently doing this project in which I have two similar images, however they are in slightly different angles. Think of it as shifting left, right, up, down, but not in the z-axis, only x and y-axis are changed. Is it possible to compare these images, and let's say I have a value in the first image (340,150), what methods can I use to find that pixel in the second image, and since the second image was shifted won't the pixel value shift as well? How do I solve this problem thanks! Huh Big Grin
Reply
#2
I'm not quite sure the problem. Are the images different sizes?

Is your example of (340, 150) the width and height of the image or x and y of where it is displayed? "Pixel Value" isn't a term I'm familiar with, however...

Have you used pygame? It has the image.get_rect() feature that will measure and image for you. You can then compare the width and height of the two images that way. You can also use the center of the image to locate it on the screen so that the two images will be in the same location regardless of size.
Reply


Possibly Related Threads…
Thread Author Replies Views Last Post
  Python code for alignment and font size 1418 0 275 Jan-14-2024, 03:56 AM
Last Post: 1418
  Voxel to pixel graphics voicemail 3 533 Nov-19-2023, 09:45 AM
Last Post: paul18fr
  How to do "fixed size" (wrapping) math in Python? AlexanderWulf 13 1,731 Jul-19-2023, 04:13 PM
Last Post: deanhystad
  Pixel color and action Sartre 4 1,969 Apr-13-2023, 03:26 AM
Last Post: Sartre
  Dynamic pixel display jerryf 2 675 Mar-17-2023, 07:26 PM
Last Post: jerryf
  compare and find the nearest element ? mr_gentle_sausage 4 1,003 Jan-15-2023, 07:11 AM
Last Post: DPaul
Question Opening small size browser with python selenium not work, need help greenpine 0 1,587 Feb-07-2022, 11:36 AM
Last Post: greenpine
  How to set Tab size to 4 in Python interpreter? zzzhhh 1 1,796 Jan-18-2022, 12:11 PM
Last Post: snippsat
Question convert autohotkey script to python / macro - press key when pixel get colour willson94d 1 3,573 Jan-01-2022, 08:13 PM
Last Post: Yoriz
  Compare two Excel sheets with Python and list diffenrences dmkfon 1 14,488 Oct-09-2021, 03:30 PM
Last Post: Larz60+

Forum Jump:

User Panel Messages

Announcements
Announcement #1 8/1/2020
Announcement #2 8/2/2020
Announcement #3 8/6/2020