05-31-2024 12:56 AM
Currently I have loaded a png image file.
I only want to know whether an image exists in the loaded file by comparing other image files.
I searched using the data array, but a 100% match was required, so a problem occurred.
I would like to judge it as existing even if it is more than 60% similar.
Is there a good way?
Solved! Go to Solution.
05-31-2024 01:00 AM
Additionally the two images are of different sizes 😞
05-31-2024 04:25 AM - edited 05-31-2024 04:31 AM
@sooyeul wrote:
Currently I have loaded a png image file.
I only want to know whether an image exists in the loaded file by comparing other image files.
I searched using the data array, but a 100% match was required, so a problem occurred.
I would like to judge it as existing even if it is more than 60% similar.
Is there a good way?
Classically you have to use something like cross correlation:
This is how it works:
Or if you need to search multiple entries in single image, then (very quick and very dirty) something like that:
Then
Or use NI Vision Development Module (or may be OpenCV), then you will get much more flexibility, but image processing basics still required.
06-02-2024 07:02 PM
thank you Thanks to you, I learned a lot. 😄
06-02-2024 09:14 PM
I have one question.
What is the standard for filter values of 500 and 100?
06-02-2024 11:05 PM
@sooyeul wrote:
I have one question.
What is the standard for filter values of 500 and 100?
There are no "standard values", that was small "cheating" to cut off "wrong" detections on the borders, this Filter is just takes ROI (100,100) - (500,500) into account, ignores everything outside. With your real you might not need this, or need other values, depends on the size of the large actual image and small template. Just explore 2D output of the Cross Correlation (in Intensity Graph, for example) and check that you have stable maximum on all detections. How good is this work on your particular case — it depends on your real images (may be such simple cross correlation approach is not applicable at all, it depends).
06-02-2024 11:30 PM
Thank you 😄
06-04-2024 07:03 PM
Hello, I've tried various things over the past few days, but I can't detect images with small pixels?
My image has 8x11 pixels and I want to find my image in the entire image of 88x14.
My image was a 24-bit pixmap, so I went through the process of converting it to an 8-bit pixmap.
I would appreciate it if you could check out the drawings I worked on.
<Front panel>
<block diagram>
06-05-2024 04:36 AM - edited 06-05-2024 04:43 AM
@sooyeul wrote:
Hello, I've tried various things over the past few days, but I can't detect images with small pixels?
My image has 8x11 pixels and I want to find my image in the entire image of 88x14.
My image was a 24-bit pixmap, so I went through the process of converting it to an 8-bit pixmap.
I would appreciate it if you could check out the drawings I worked on.
<Front panel>
<block diagram>
For sure, it will work also for smaller images, but up to certain limit, because some amount of data is required to get cross-correlation working. How stable it will work in your particular case, depends on the images.
First of them, you don't need such multiple conversion, its a kind of Rube Goldberg Code:
You can do it as simple at this:
Just convert RGB to grays as needed, and you can continue processing with DBL, not needed to get integers. Classically you should do something like
gray = 0.2989 * r + 0.5870 * g + 0.1140 * b
if you have same values on channels, then obviously enough to take single channel instead.
What I would like to recommend is to take some books about fundamentals of image processing, this will remove lot of questions.
Personally I've learning machine vision 30 years ago with Digital Picture Processing written by Azriel Rosenfeld and Avinash Kak, greate books in two volumes, probably hard to found nowadays, but Digital Image Processing written by Rafael Gonzalez and Richard Woods also "classical".
In the last book, the correlation was explained in many chapters, starting from Chapter 3, and object recognition was explained in Chapter 12. You don't need to read whole 900+ pages, just basics and selected chapters.
And still recommend to explore image processing libraries — this problem was solved many times, especially is you need kind of OCR. Nowadays ML-based approach is popular (not sure if this applicable for your case and you have sufficient dataset to train), just google for MNIST.
06-06-2024 02:47 AM
@Andrey_Dmitriev wrote:
And still recommend to explore image processing libraries — this problem was solved many times, especially is you need kind of OCR. Nowadays ML-based approach is popular (not sure if this applicable for your case and you have sufficient dataset to train), just google for MNIST.
crosscorrelation and convolution are quite similar, no surprise it is used in all those convolutionalneuralnetworks 😉