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
  How to set Tab size to 4 in Python interpreter? zzzhhh 1 143 Jan-18-2022, 12:11 PM
Last Post: snippsat
Question convert autohotkey script to python / macro - press key when pixel get colour willson94d 1 223 Jan-01-2022, 08:13 PM
Last Post: Yoriz
  Compare two Excel sheets with Python and list diffenrences dmkfon 1 598 Oct-09-2021, 03:30 PM
Last Post: Larz60+
  how to read multispectral images on python noorasim 0 660 Feb-28-2021, 03:54 PM
Last Post: noorasim
  Plotting Pixel Intensity Doev 0 724 Oct-21-2020, 10:56 PM
Last Post: Doev
  How do I insert images in Python using gspread (or any other package)? ivansing23 0 956 Jul-27-2020, 01:26 PM
Last Post: ivansing23
  My journey with attaching file instead of images using Python numbnumb54 1 785 Jul-24-2020, 02:37 AM
Last Post: scidam
  What is the best way to search for a pixel in a screenshot? TheZadok42 1 1,131 May-15-2020, 12:37 PM
Last Post: scidam
  A more efficient way of comparing two images in a python vukan 0 1,096 Mar-17-2020, 11:39 AM
Last Post: vukan
  How to compare in python an input value with an hashed value in mysql table? Formationgrowthhacking 4 1,731 Jan-14-2020, 11:43 AM
Last Post: Formationgrowthhacking

Forum Jump:

User Panel Messages

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