LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

About picture data search.. Help me

Solved!
Go to solution

스크린샷 2024-05-31 144856.png

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?

0 Kudos
Message 1 of 11
(961 Views)

Additionally the two images are of different sizes 😞

0 Kudos
Message 2 of 11
(956 Views)
Solution
Accepted by sooyeul

@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:

 

Corr1.png

This is how it works:

Screenshot 2024-05-31 11.20.43.png

Or if you need to search multiple entries in single image, then (very quick and very dirty) something like that:

Corr2.png

Then

Screenshot 2024-05-31 11.21.31.png

Or use NI Vision Development Module (or may be OpenCV), then you will get much more flexibility, but image processing basics still required.

Message 3 of 11
(921 Views)

thank you Thanks to you, I learned a lot. 😄

0 Kudos
Message 4 of 11
(875 Views)

I have one question.

 

What is the standard for filter values ​​of 500 and 100?

0 Kudos
Message 5 of 11
(855 Views)

@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).

Message 6 of 11
(843 Views)

Thank you 😄

0 Kudos
Message 7 of 11
(838 Views)

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.

스크린샷 2024-06-05 085631.png

<Front panel>  

 

스크린샷 2024-06-05 085634.png

<block diagram>

0 Kudos
Message 8 of 11
(759 Views)

@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>  

 

스크린샷 2024-06-05 085634.png

<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:

Screenshot 2024-06-05 10.55.27.png

You can do it as simple at this:

Snippet.png

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.

Screenshot 2024-06-05 10.52.21.png

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".

2Books.jpg

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.

Message 9 of 11
(735 Views)

@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 😉

Message 10 of 11
(701 Views)