CN115437601B - Image ordering method, electronic device, program product and medium - Google Patents

Image ordering method, electronic device, program product and medium Download PDF

Info

Publication number
CN115437601B
CN115437601B CN202211364538.1A CN202211364538A CN115437601B CN 115437601 B CN115437601 B CN 115437601B CN 202211364538 A CN202211364538 A CN 202211364538A CN 115437601 B CN115437601 B CN 115437601B
Authority
CN
China
Prior art keywords
image
area
matching
images
electronic device
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Active
Application number
CN202211364538.1A
Other languages
Chinese (zh)
Other versions
CN115437601A (en
Inventor
陈敬濠
曹鹏蕊
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Honor Device Co Ltd
Original Assignee
Honor Device Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Honor Device Co Ltd filed Critical Honor Device Co Ltd
Priority to CN202211364538.1A priority Critical patent/CN115437601B/en
Publication of CN115437601A publication Critical patent/CN115437601A/en
Application granted granted Critical
Publication of CN115437601B publication Critical patent/CN115437601B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F7/00Methods or arrangements for processing data by operating upon the order or content of the data handled
    • G06F7/06Arrangements for sorting, selecting, merging, or comparing data on individual record carriers
    • G06F7/08Sorting, i.e. grouping record carriers in numerical or other ordered sequence according to the classification of at least some of the information they carry
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F16/00Information retrieval; Database structures therefor; File system structures therefor
    • G06F16/60Information retrieval; Database structures therefor; File system structures therefor of audio data
    • G06F16/63Querying
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F16/00Information retrieval; Database structures therefor; File system structures therefor
    • G06F16/60Information retrieval; Database structures therefor; File system structures therefor of audio data
    • G06F16/68Retrieval characterised by using metadata, e.g. metadata not derived from the content or metadata generated manually

Landscapes

  • Engineering & Computer Science (AREA)
  • Theoretical Computer Science (AREA)
  • Physics & Mathematics (AREA)
  • General Engineering & Computer Science (AREA)
  • General Physics & Mathematics (AREA)
  • Multimedia (AREA)
  • Data Mining & Analysis (AREA)
  • Databases & Information Systems (AREA)
  • Library & Information Science (AREA)
  • User Interface Of Digital Computer (AREA)

Abstract

The application provides an image ordering method, electronic equipment, a program product and a medium, wherein the method comprises the following steps: acquiring a first image set, wherein the first image set comprises a plurality of images to be ranked, and the images to be ranked are images retrieved according to a query image; according to the first feature points matched between each image to be sequenced and the query image, calculating the common view proportion of the corresponding images to be sequenced and the query image; and sorting the images to be sorted according to the common view proportion. According to the application, the similar images in the search result can be further ranked according to the similarity by reflecting the common view proportion of the feature point distribution, so that a more accurate ranking result is obtained, and the problem of disordered ranking of the similar images in the image search result is solved.

Description

Image ordering method, electronic device, program product and medium
Technical Field
The present application relates to the field of search technology, and in particular, to an image sorting method, an electronic device, a computer program product, and a computer readable storage medium.
Background
Image retrieval is evolving, and from the beginning of describing features of an image for retrieval according to the manner of text description, there has been evolved a technique that can analyze and retrieve according to the color, texture, layout, etc. of an image, i.e., content-based image retrieval. Image retrieval is widely applied to scenes such as visual positioning, commodity recommendation, and similarity search.
Image retrieval is generally based on image feature similarity matching, and similar images of image retrieval are returned according to the sequence of the similarity from large to small. For images of the same shooting target at different distances or different visual angles, the images are disordered in the sequence of the images in the search result due to the high similarity of image features.
Disclosure of Invention
The application provides an image ordering method, electronic equipment, a computer program product and a computer readable storage medium, and aims to solve the problem of disordered ordering of similar images in image retrieval results.
In a first aspect, the present application provides an image ordering method, including: acquiring a first image set, wherein the first image set comprises a plurality of images to be ranked, and the images to be ranked are images retrieved according to a query image; calculating the common view ratio of the corresponding images to be sequenced and the query image according to the first feature points matched between each image to be sequenced and the query image, wherein the first feature points comprise feature points matched with the query image in a target image and feature points matched with the target image in the query image, the target image is the image to be sequenced for which the common view ratio is calculated at the current time, and the common view ratio refers to the area ratio of the matching areas of the matching feature points matched between the two images in the two images to the preset areas of the images to which the matching areas belong; and sorting the images to be sorted according to the common view proportion.
According to the method, after the image to be sequenced which is similar to the image characteristics of the query image is obtained through retrieval, the common view proportion reflecting the distribution of the characteristic points is calculated according to the first characteristic points matched between the image to be sequenced and the query image; and finally, sorting the images to be sorted according to the common view proportion, so that the effect of further sorting the search results according to the characteristic point distribution of the images is achieved, and the sorting precision is higher.
In one possible implementation, the calculating the common view ratio of the image to be ranked and the query image according to the first feature point matched between the image to be ranked and the query image includes: determining a first matching area in the target image and a second matching area in the query image according to the first feature points; the first matching area is an area block where the first feature point is located in the target image, and the second matching area is an area block where the first feature point is located in the query image; the common view ratio is calculated using the smaller of the first matching region and the second matching region.
According to the application, the smaller matching area image is determined as the common view area for calculating the common view proportion, so that the common view proportion can more accurately reflect the similarity between the images to be ranked and the query image, and the accuracy of the ranking result obtained by ranking according to the common view proportion is higher.
In one possible implementation, the calculating the common view ratio using the smaller of the first matching region and the second matching region includes: if the first matching area is smaller than the second matching area, calculating the area ratio of the first matching area to the target image to obtain the common view ratio; if the first matching area is larger than the second matching area, calculating the area ratio of the second matching area to the query image to obtain the common view ratio.
According to the application, the distribution condition of the matching characteristic points in the original image can be intuitively reflected by calculating the ratio of the areas of the matching area and the original image as the common view ratio, and the similarity between the target image and the query image reflected by the calculated common view ratio is more accurate.
In one possible implementation, the calculating the common view ratio using the smaller of the first matching region and the second matching region includes: if the first matching area is smaller than the second matching area, calculating the area ratio of the first matching area to the first characteristic area of the target image to obtain the common view ratio; the first characteristic region is a region block in which a second characteristic point in the target image is located, and the second characteristic point is a characteristic point matched between the target image and the target image; if the first matching area is larger than the second matching area, calculating the area ratio of the second matching area to the second characteristic area of the query image to obtain the common view ratio; the second feature area is an area block where a third feature point in the query image is located, and the third feature point is a feature point matched between the query image and the query image.
According to the application, the ratio of the areas of the matching area and the characteristic area is calculated as the common view ratio, so that the influence of a blank area or a no-characteristic area in the image can be eliminated, and the similarity of the distribution condition of the matching characteristic points between the target image and the query image can be reflected more accurately.
In one possible implementation, the determining a first matching region in the target image and a second matching region in the query image according to the first feature point includes: dividing the target image and the query image into N and M regional blocks respectively, wherein the size of each regional block is the same, and N and M are integers larger than 0; the region block in which the first feature point exists is determined as the first matching region or the second matching region.
According to the application, whether the unit area blocks belong to the matching area is determined by whether the first characteristic points exist in the unit area blocks with the same size, so that the distribution situation of the matching characteristic points can be better reflected, and meanwhile, the area counting is convenient.
In one possible implementation, before the ranking of the plurality of images to be ranked according to the common view ratio, the method further includes: and deleting the images to be ranked, wherein the common view proportion of the images in the first image set is lower than a first threshold value.
According to the method and the device, the images to be ranked, of which the common view proportion is lower than the first threshold value, are deleted, so that the calculated amount of ranking can be reduced, and the quality of candidate images in a search result is improved; the number of candidate images is smaller, and when the candidate images in the search result are used as inputs of other algorithms, the calculation amount and the calculation time of the corresponding algorithm can be reduced.
In one possible implementation, the sorting the plurality of images to be sorted according to the common view ratio includes: sorting the images to be sorted in the first image set from large to small according to the common view proportion to obtain a sorting result; after said ranking of said plurality of images to be ranked according to said common view ratio, said method further comprises: and inputting the first P images in the sequencing result into an image positioning algorithm or a pose estimation algorithm, wherein P is an integer greater than 0.
In the embodiment of the application, after the image sequence with the similarity sequenced from high to low is obtained, the first N images can be selected as the input of other algorithms, so that the accuracy of the algorithm can be improved, and the operation amount and operation time of the algorithm can be reduced.
In a second aspect, there is provided an image ordering apparatus comprising means for performing any of the methods of the first aspect. The device may be an electronic device or a chip in an electronic device. The apparatus may include an input unit and a processing unit.
When the apparatus is an electronic device, the processing unit may be a processor and the input unit may be a communication interface; the electronic device may further comprise a memory for storing computer program code which, when executed by the processor, causes the electronic device to perform any of the methods of the first aspect.
When the apparatus is a chip in an electronic device, the processing unit may be a processing unit inside the chip, and the input unit may be an output interface, a pin, a circuit, or the like; the chip may also include memory, which may be memory within the chip (e.g., registers, caches, etc.), or memory external to the chip (e.g., read-only memory, random access memory, etc.); the memory is for storing computer program code which, when executed by the processor, causes the chip to perform any of the methods of the first aspect.
In a third aspect, there is provided an electronic device comprising a processor for coupling with a memory and reading instructions in the memory and according to the instructions causing the electronic device to perform any of the methods of the first aspect.
In a fourth aspect, there is provided a computer readable storage medium having stored therein a computer program which, when executed by a processor, causes the processor to perform any of the methods of the first aspect.
In a fifth aspect, there is provided a computer program product comprising: computer program code which, when executed by a processor, causes the processor to perform any of the methods of the first aspect.
Drawings
Fig. 1 is a schematic structural diagram of an electronic device according to an embodiment of the present application;
fig. 2 is a software block diagram of an electronic device according to an embodiment of the present application;
fig. 3 is a schematic flow chart of an image sorting method according to an embodiment of the present application;
fig. 4 is a schematic flow chart of an image retrieval method according to an embodiment of the present application;
FIG. 5 is a schematic diagram of comparing a query image with a target image according to an embodiment of the present application;
FIG. 6 is a schematic flow chart of calculating a common view ratio according to an embodiment of the present application;
Fig. 7 is a block diagram of an image sorting apparatus according to an embodiment of the present application;
fig. 8 is a block diagram of an electronic device according to an embodiment of the present application.
Detailed Description
The technical solutions in the embodiments of the present application will be clearly and completely described below with reference to the accompanying drawings in the embodiments of the present application. The terminology used in the following examples is for the purpose of describing particular embodiments only and is not intended to be limiting of the application. As used in the specification of the application and the appended claims, the singular forms "a," "an," "the," and "the" are intended to include, for example, "one or more" such forms of expression, unless the context clearly indicates to the contrary. It should also be understood that in embodiments of the present application, "one or more" means one, two, or more than two; "and/or", describes an association relationship of the association object, indicating that three relationships may exist; for example, a and/or B may represent: a alone, a and B together, and B alone, wherein A, B may be singular or plural. The character "/" generally indicates that the context-dependent object is an "or" relationship.
Reference in the specification to "one embodiment" or "some embodiments" or the like means that a particular feature, structure, or characteristic described in connection with the embodiment is included in one or more embodiments of the application. Thus, appearances of the phrases "in one embodiment," "in some embodiments," "in other embodiments," and the like in the specification are not necessarily all referring to the same embodiment, but mean "one or more but not all embodiments" unless expressly specified otherwise. The terms "comprising," "including," "having," and variations thereof mean "including but not limited to," unless expressly specified otherwise.
The plurality of the embodiments of the present application is greater than or equal to two. It should be noted that, in the description of the embodiments of the present application, the terms "first," "second," and the like are used for distinguishing between the descriptions and not necessarily for indicating or implying a relative importance, or alternatively, for indicating or implying a sequential order.
The image sorting method provided by the embodiment of the application can be applied to the electronic equipment 100.
In some embodiments, the electronic device 100 may be a mobile phone, a tablet computer, a desktop, a laptop, a notebook, an ultra-mobile personal computer (UMPC), a handheld computer, a netbook, a Personal Digital Assistant (PDA), a wearable electronic device, a smart watch, or the like, and the embodiment of the present application is not limited to the specific form of the above-mentioned electronic device. In this embodiment, the structure of the electronic apparatus 100 may be as shown in fig. 1.
As shown in fig. 1, the electronic device 100 may include A processor 110, an external memory interface 120, an internal memory 121, A universal serial bus (universal serial bus, USB) interface 130, A charge management module 140, A power management module 141, A battery 142, an antenna 1, an antenna 2, A mobile communication module 150, A wireless communication module 160, an audio module 170, A speaker 170A, A receiver 170B, A microphone 170C, an earphone interface 170D, A sensor module 180, keys 190, A motor 191, an indicator 192, A camera 193, A display 194, A subscriber identity module (subscriber identification module, SIM) card interface 195, and the like. The sensor module 180 may include a pressure sensor 180A, a gyro sensor 180B, an air pressure sensor 180C, a magnetic sensor 180D, an acceleration sensor 180E, a distance sensor 180F, a proximity sensor 180G, a fingerprint sensor 180H, a temperature sensor 180J, a touch sensor 180K, an ambient light sensor 180L, a bone conduction sensor 180M, and the like.
It is to be understood that the structure illustrated in the present embodiment does not constitute a specific limitation on the electronic apparatus 100. In other embodiments, electronic device 100 may include more or fewer components than shown, or certain components may be combined, or certain components may be split, or different arrangements of components. The illustrated components may be implemented in hardware, software, or a combination of software and hardware.
The processor 110 may include one or more processing units, such as: the processor 110 may include an application processor (application processor, AP), a modem processor, a graphics processor (graphics processing unit, GPU), an image signal processor (IMAGE SIGNAL processor, ISP), a controller, a video codec, a digital signal processor (DIGITAL SIGNAL processor, DSP), a baseband processor, and/or a neural-Network Processor (NPU), etc. Wherein the different processing units may be separate devices or may be integrated in one or more processors.
The controller may be a neural hub and a command center of the electronic device 100, among others. The controller can generate operation control signals according to the instruction operation codes and the time sequence signals to finish the control of instruction fetching and instruction execution.
A memory may also be provided in the processor 110 for storing instructions and data. In some embodiments, the memory in the processor 110 is a cache memory. The memory may hold instructions or data that the processor 110 has just used or recycled. If the processor 110 needs to reuse the instruction or data, it can be called directly from the memory. Repeated accesses are avoided and the latency of the processor 110 is reduced, thereby improving the efficiency of the system.
In some embodiments, the processor 110 may include one or more interfaces. The interfaces may include an integrated circuit (inter-INTEGRATED CIRCUIT, I2C) interface, an integrated circuit built-in audio (inter-INTEGRATED CIRCUIT SOUND, I2S) interface, a pulse code modulation (pulse code modulation, PCM) interface, a universal asynchronous receiver transmitter (universal asynchronous receiver/transmitter, UART) interface, a mobile industry processor interface (mobile industry processor interface, MIPI), a general-purpose input/output (GPIO) interface, a SIM interface, and/or a USB interface, among others.
The I2C interface is a bi-directional synchronous serial bus comprising a serial data line (SERIAL DATA LINE, SDA) and a serial clock line (derail clock line, SCL). In some embodiments, the processor 110 may contain multiple sets of I2C buses. The processor 110 may be coupled to the touch sensor 180K, charger, flash, camera 193, etc., respectively, through different I2C bus interfaces. For example: the processor 110 may be coupled to the touch sensor 180K through an I2C interface, such that the processor 110 communicates with the touch sensor 180K through an I2C bus interface to implement a touch function of the electronic device 100.
The I2S interface may be used for audio communication. In some embodiments, the processor 110 may contain multiple sets of I2S buses. The processor 110 may be coupled to the audio module 170 via an I2S bus to enable communication between the processor 110 and the audio module 170. In some embodiments, the audio module 170 may transmit an audio signal to the wireless communication module 160 through the I2S interface, to implement a function of answering a call through the bluetooth headset.
PCM interfaces may also be used for audio communication to sample, quantize and encode analog signals. In some embodiments, the audio module 170 and the wireless communication module 160 may be coupled through a PCM bus interface. In some embodiments, the audio module 170 may also transmit audio signals to the wireless communication module 160 through the PCM interface to implement a function of answering a call through the bluetooth headset. Both the I2S interface and the PCM interface may be used for audio communication.
The UART interface is a universal serial data bus for asynchronous communications. The bus may be a bi-directional communication bus. It converts the data to be transmitted between serial communication and parallel communication. In some embodiments, a UART interface is typically used to connect the processor 110 with the wireless communication module 160. For example: the processor 110 communicates with a bluetooth module in the wireless communication module 160 through a UART interface to implement a bluetooth function. In some embodiments, the audio module 170 may transmit an audio signal to the wireless communication module 160 through a UART interface, to implement a function of playing music through a bluetooth headset.
The MIPI interface may be used to connect the processor 110 to peripheral devices such as a display 194, a camera 193, and the like. The MIPI interfaces include camera serial interfaces (CAMERA SERIAL INTERFACE, CSI), display serial interfaces (DISPLAY SERIAL INTERFACE, DSI), and the like. In some embodiments, processor 110 and camera 193 communicate through a CSI interface to implement the photographing functions of electronic device 100. The processor 110 and the display 194 communicate via a DSI interface to implement the display functionality of the electronic device 100.
The GPIO interface may be configured by software. The GPIO interface may be configured as a control signal or as a data signal. In some embodiments, a GPIO interface may be used to connect the processor 110 with the camera 193, the display 194, the wireless communication module 160, the audio module 170, the sensor module 180, and the like. The GPIO interface may also be configured as an I2C interface, an I2S interface, a UART interface, an MIPI interface, etc.
The USB interface 130 is an interface conforming to the USB standard specification, and may specifically be a Mini USB interface, a Micro USB interface, a USB Type C interface, or the like. The USB interface 130 may be used to connect a charger to charge the electronic device 100, and may also be used to transfer data between the electronic device 100 and a peripheral device. And can also be used for connecting with a headset, and playing audio through the headset. The interface may also be used to connect other electronic devices, such as AR devices, etc.
It should be understood that the connection relationship between the modules illustrated in this embodiment is only illustrative, and does not limit the structure of the electronic device 100. In other cases of the embodiments of the present application, the electronic device 100 may also use different interfacing manners in the foregoing embodiments, or a combination of multiple interfacing manners.
The charge management module 140 is configured to receive a charge input from a charger. The charger can be a wireless charger or a wired charger. In some wired charging embodiments, the charge management module 140 may receive a charging input of a wired charger through the USB interface 130. In some wireless charging embodiments, the charge management module 140 may receive wireless charging input through a wireless charging coil of the electronic device 100. The charging management module 140 may also supply power to the electronic device through the power management module 141 while charging the battery 142.
The power management module 141 is used for connecting the battery 142, and the charge management module 140 and the processor 110. The power management module 141 receives input from the battery 142 and/or the charge management module 140 to power the processor 110, the internal memory 121, the display 194, the camera 193, the wireless communication module 160, and the like. The power management module 141 may also be configured to monitor battery capacity, battery cycle number, battery health (leakage, impedance) and other parameters. In other embodiments, the power management module 141 may also be provided in the processor 110. In other embodiments, the power management module 141 and the charge management module 140 may be disposed in the same device.
The wireless communication function of the electronic device 100 may be implemented by the antenna 1, the antenna 2, the mobile communication module 150, the wireless communication module 160, a modem processor, a baseband processor, and the like.
The antennas 1 and 2 are used for transmitting and receiving electromagnetic wave signals. Each antenna in the electronic device 100 may be used to cover a single or multiple communication bands. Different antennas may also be multiplexed to improve the utilization of the antennas. For example: the antenna 1 may be multiplexed into a diversity antenna of a wireless local area network. In other embodiments, the antenna may be used in conjunction with a tuning switch.
The mobile communication module 150 may provide a solution for wireless communication including 2G/3G/4G/5G, etc., applied to the electronic device 100. The mobile communication module 150 may include at least one filter, switch, power amplifier, low noise amplifier (low noise amplifier, LNA), etc. The mobile communication module 150 may receive electromagnetic waves from the antenna 1, perform processes such as filtering, amplifying, and the like on the received electromagnetic waves, and transmit the processed electromagnetic waves to the modem processor for demodulation. The mobile communication module 150 can amplify the signal modulated by the modem processor, and convert the signal into electromagnetic waves through the antenna 1 to radiate. In some embodiments, at least some of the functional modules of the mobile communication module 150 may be disposed in the processor 110. In some embodiments, at least some of the functional modules of the mobile communication module 150 may be provided in the same device as at least some of the modules of the processor 110.
The modem processor may include a modulator and a demodulator. The modulator is used for modulating the low-frequency baseband signal to be transmitted into a medium-high frequency signal. The demodulator is used for demodulating the received electromagnetic wave signal into a low-frequency baseband signal. The demodulator then transmits the demodulated low frequency baseband signal to the baseband processor for processing. The low frequency baseband signal is processed by the baseband processor and then transferred to the application processor. The application processor outputs sound signals through an audio device (not limited to the speaker 170A, the receiver 170B, etc.), or displays images or video through the display screen 194. In some embodiments, the modem processor may be a stand-alone device. In other embodiments, the modem processor may be provided in the same device as the mobile communication module 150 or other functional module, independent of the processor 110.
The wireless communication module 160 may provide solutions for wireless communication including wireless local area network (wireless local area networks, WLAN) (e.g., wireless fidelity (WIRELESS FIDELITY, wi-Fi) network), bluetooth (BT), global navigation satellite system (global navigation SATELLITE SYSTEM, GNSS), frequency modulation (frequency modulation, FM), near field communication (NEAR FIELD communication, NFC), infrared (IR), etc., applied to the electronic device 100. The wireless communication module 160 may be one or more devices that integrate at least one communication processing module. The wireless communication module 160 receives electromagnetic waves via the antenna 2, modulates the electromagnetic wave signals, filters the electromagnetic wave signals, and transmits the processed signals to the processor 110. The wireless communication module 160 may also receive a signal to be transmitted from the processor 110, frequency modulate it, amplify it, and convert it to electromagnetic waves for radiation via the antenna 2.
In some embodiments, antenna 1 and mobile communication module 150 of electronic device 100 are coupled, and antenna 2 and wireless communication module 160 are coupled, such that electronic device 100 may communicate with a network and other devices through wireless communication techniques. The wireless communication techniques can include the Global System for Mobile communications (global system for mobile communications, GSM), general packet radio service (GENERAL PACKET radio service, GPRS), code division multiple access (code division multiple access, CDMA), wideband code division multiple access (wideband code division multiple access, WCDMA), time division code division multiple access (time-division code division multiple access, TD-SCDMA), long term evolution (long term evolution, LTE), BT, GNSS, WLAN, NFC, FM, and/or IR techniques, among others. The GNSS may include a global satellite positioning system (global positioning system, GPS), a global navigation satellite system (global navigation SATELLITE SYSTEM, GLONASS), a beidou satellite navigation system (beidou navigation SATELLITE SYSTEM, BDS), a quasi zenith satellite system (quasi-zenith SATELLITE SYSTEM, QZSS) and/or a satellite based augmentation system (SATELLITE BASED AUGMENTATION SYSTEMS, SBAS).
The electronic device 100 implements display functions through a GPU, a display screen 194, an application processor, and the like. The GPU is a microprocessor for image processing, and is connected to the display 194 and the application processor. The GPU is used to perform mathematical and geometric calculations for graphics rendering. Processor 110 may include one or more GPUs that execute program instructions to generate or change display information.
The display screen 194 is used to display images, videos, and the like. The display 194 includes a display panel. The display panel may employ a Liquid Crystal Display (LCD) screen (liquid CRYSTAL DISPLAY), an organic light-emitting diode (OLED), an active-matrix organic LIGHT EMITTING diode (AMOLED), a flexible light-emitting diode (flex), miniled, microLed, micro-OLED, a quantum dot light-emitting diode (QLED), or the like. In some embodiments, the electronic device 100 may include 1 or N display screens 194, N being a positive integer greater than 1.
A series of graphical user interfaces (GRAPHICAL USER INTERFACE, GUIs) may be displayed on the display 194 of the electronic device 100, all of which are home screens of the electronic device 100. Generally, the size of the display 194 of the electronic device 100 is fixed and only limited controls can be displayed in the display 194 of the electronic device 100. A control is a GUI element that is a software component that is included in an application program, controls all data processed by the application program and interactive operations on the data, and a user can interact with the control by direct operations (direct manipulation) to read or edit information about the application program. In general, controls may include visual interface elements such as icons, buttons, menus, tabs, text boxes, dialog boxes, status bars, navigation bars, widgets, and the like. For example, in an embodiment of the present application, the display 194 may display virtual keys (image retrieval or image positioning).
The electronic device 100 may implement photographing functions through an ISP, a camera 193, a video codec, a GPU, a display screen 194, an application processor, and the like.
The ISP is used to process data fed back by the camera 193. For example, when photographing, the shutter is opened, light is transmitted to the camera photosensitive element through the lens, the optical signal is converted into an electric signal, and the camera photosensitive element transmits the electric signal to the ISP for processing and is converted into an image visible to naked eyes. ISP can also optimize the noise, brightness and skin color of the image. The ISP can also optimize parameters such as exposure, color temperature and the like of a shooting scene. In some embodiments, the ISP may be provided in the camera 193.
The camera 193 is used to capture still images or video. The object generates an optical image through the lens and projects the optical image onto the photosensitive element. The photosensitive element may be a charge coupled device (charge coupled device, CCD) or a Complementary Metal Oxide Semiconductor (CMOS) phototransistor. The photosensitive element converts the optical signal into an electrical signal, which is then transferred to the ISP to be converted into a digital image signal. The ISP outputs the digital image signal to the DSP for processing. The DSP converts the digital image signal into an image signal in a standard RGB, YUV, or the like format. In some embodiments, electronic device 100 may include 1 or N cameras 193, N being a positive integer greater than 1.
The digital signal processor is used for processing digital signals, and can process other digital signals besides digital image signals. For example, when the electronic device 100 selects a frequency bin, the digital signal processor is used to fourier transform the frequency bin energy, or the like.
Video codecs are used to compress or decompress digital video. The electronic device 100 may support one or more video codecs. In this way, the electronic device 100 may play or record video in a variety of encoding formats, such as: dynamic picture experts group (moving picture experts group, MPEG) 1, MPEG2, MPEG3, MPEG4, etc.
The NPU is a neural-network (NN) computing processor, and can rapidly process input information by referencing a biological neural network structure, for example, referencing a transmission mode between human brain neurons, and can also continuously perform self-learning. Applications such as intelligent awareness of the electronic device 100 may be implemented through the NPU, for example: image recognition, face recognition, speech recognition, text understanding, etc.
The external memory interface 120 may be used to connect an external memory card, such as a Micro SD card, to enable expansion of the memory capabilities of the electronic device 100. The external memory card communicates with the processor 110 through an external memory interface 120 to implement data storage functions. For example, files such as music, video, etc. are stored in an external memory card.
The internal memory 121 may be used to store computer executable program code including instructions. The processor 110 executes various functional applications of the electronic device 100 and data processing by executing instructions stored in the internal memory 121. For example, in the present embodiment, the processor 110 may perform image retrieval, image ordering, and/or image positioning by executing instructions stored in the internal memory 121. The internal memory 121 may include a storage program area and a storage data area. The storage program area may store an application program (such as a sound playing function, an image playing function, etc.) required for at least one function of the operating system, etc. The storage data area may store data created during use of the electronic device 100 (e.g., audio data, phonebook, etc.), and so on. In addition, the internal memory 121 may include a high-speed random access memory, and may further include a nonvolatile memory such as at least one magnetic disk storage device, a flash memory device, a universal flash memory (universal flash storage, UFS), and the like. The processor 110 performs various functional applications of the electronic device 100 and data processing by executing instructions stored in the internal memory 121 and/or instructions stored in a memory provided in the processor.
The electronic device 100 may implement audio functions through an audio module 170, a speaker 170A, a receiver 170B, a microphone 170C, an earphone interface 170D, an application processor, and the like. Such as music playing, recording, etc.
The audio module 170 is used to convert digital audio information into an analog audio signal output and also to convert an analog audio input into a digital audio signal. The audio module 170 may also be used to encode and decode audio signals. In some embodiments, the audio module 170 may be disposed in the processor 110, or a portion of the functional modules of the audio module 170 may be disposed in the processor 110.
The speaker 170A, also referred to as a "horn," is used to convert audio electrical signals into sound signals. The electronic device 100 may listen to music, or to hands-free conversations, through the speaker 170A.
A receiver 170B, also referred to as a "earpiece", is used to convert the audio electrical signal into a sound signal. When electronic device 100 is answering a telephone call or voice message, voice may be received by placing receiver 170B in close proximity to the human ear.
Microphone 170C, also referred to as a "microphone" or "microphone", is used to convert sound signals into electrical signals. When making a call or transmitting voice information, the user can sound near the microphone 170C through the mouth, inputting a sound signal to the microphone 170C. The electronic device 100 may be provided with at least one microphone 170C. In other embodiments, the electronic device 100 may be provided with two microphones 170C, and may implement a noise reduction function in addition to collecting sound signals. In other embodiments, the electronic device 100 may also be provided with three, four, or more microphones 170C to enable collection of sound signals, noise reduction, identification of sound sources, directional recording functions, etc.
The earphone interface 170D is used to connect a wired earphone. The headset interface 170D may be a USB interface 130 or a 3.5mm open mobile electronic device platform (open mobile terminal platform, OMTP) standard interface, a american cellular telecommunications industry association (cellular telecommunications industry association of the USA, CTIA) standard interface.
The pressure sensor 180A is used to sense a pressure signal, and may convert the pressure signal into an electrical signal. In some embodiments, the pressure sensor 180A may be disposed on the display screen 194. The pressure sensor 180A is of various types, such as a resistive pressure sensor, an inductive pressure sensor, a capacitive pressure sensor, and the like. The capacitive pressure sensor may be a capacitive pressure sensor comprising at least two parallel plates with conductive material. The capacitance between the electrodes changes when a force is applied to the pressure sensor 180A. The electronic device 100 determines the strength of the pressure from the change in capacitance. When a touch operation is applied to the display screen 194, the electronic apparatus 100 detects the touch operation intensity according to the pressure sensor 180A. The electronic device 100 may also calculate the location of the touch based on the detection signal of the pressure sensor 180A. In some embodiments, touch operations that act on the same touch location, but at different touch operation strengths, may correspond to different operation instructions. For example: and executing an instruction for checking the short message when the touch operation with the touch operation intensity smaller than the first pressure threshold acts on the short message application icon. And executing an instruction for newly creating the short message when the touch operation with the touch operation intensity being greater than or equal to the first pressure threshold acts on the short message application icon.
The gyro sensor 180B may be used to determine a motion gesture of the electronic device 100. In some embodiments, the angular velocity of electronic device 100 about three axes (i.e., x, y, and z axes) may be determined by gyro sensor 180B. The gyro sensor 180B may be used for photographing anti-shake. For example, when the shutter is pressed, the gyro sensor 180B detects the shake angle of the electronic device 100, calculates the distance to be compensated by the lens module according to the angle, and makes the lens counteract the shake of the electronic device 100 through the reverse motion, so as to realize anti-shake. The gyro sensor 180B may also be used for navigating, somatosensory game scenes.
The air pressure sensor 180C is used to measure air pressure. In some embodiments, electronic device 100 calculates altitude from barometric pressure values measured by barometric pressure sensor 180C, aiding in positioning and navigation.
The magnetic sensor 180D includes a hall sensor. The electronic device 100 may detect the opening and closing of the flip cover using the magnetic sensor 180D. In some embodiments, when the electronic device 100 is a flip machine, the electronic device 100 may detect the opening and closing of the flip according to the magnetic sensor 180D. And then according to the detected opening and closing state of the leather sheath or the opening and closing state of the flip, the characteristics of automatic unlocking of the flip and the like are set.
The acceleration sensor 180E may detect the magnitude of acceleration of the electronic device 100 in various directions (typically three axes). The magnitude and direction of gravity may be detected when the electronic device 100 is stationary. The electronic equipment gesture recognition method can also be used for recognizing the gesture of the electronic equipment, and is applied to horizontal and vertical screen switching, pedometers and other applications.
A distance sensor 180F for measuring a distance. The electronic device 100 may measure the distance by infrared or laser. In some embodiments, the electronic device 100 may range using the distance sensor 180F to achieve quick focus.
The proximity light sensor 180G may include, for example, a Light Emitting Diode (LED) and a light detector, such as a photodiode. The light emitting diode may be an infrared light emitting diode. The electronic device 100 emits infrared light outward through the light emitting diode. The electronic device 100 detects infrared reflected light from nearby objects using a photodiode. When sufficient reflected light is detected, it may be determined that there is an object in the vicinity of the electronic device 100. When insufficient reflected light is detected, the electronic device 100 may determine that there is no object in the vicinity of the electronic device 100. The electronic device 100 can detect that the user holds the electronic device 100 close to the ear by using the proximity light sensor 180G, so as to automatically extinguish the screen for the purpose of saving power. The proximity light sensor 180G may also be used in holster mode, pocket mode to automatically unlock and lock the screen.
The ambient light sensor 180L is used to sense ambient light level. The electronic device 100 may adaptively adjust the brightness of the display 194 based on the perceived ambient light level. The ambient light sensor 180L may also be used to automatically adjust white balance when taking a photograph. Ambient light sensor 180L may also cooperate with proximity light sensor 180G to detect whether electronic device 100 is in a pocket to prevent false touches.
The fingerprint sensor 180H is used to collect a fingerprint. The electronic device 100 may utilize the collected fingerprint feature to unlock the fingerprint, access the application lock, photograph the fingerprint, answer the incoming call, etc.
The temperature sensor 180J is for detecting temperature. In some embodiments, the electronic device 100 performs a temperature processing strategy using the temperature detected by the temperature sensor 180J. For example, when the temperature reported by temperature sensor 180J exceeds a threshold, electronic device 100 performs a reduction in the performance of a processor located in the vicinity of temperature sensor 180J in order to reduce power consumption to implement thermal protection. In other embodiments, when the temperature is below another threshold, the electronic device 100 heats the battery 142 to avoid the low temperature causing the electronic device 100 to be abnormally shut down. In other embodiments, when the temperature is below a further threshold, the electronic device 100 performs boosting of the output voltage of the battery 142 to avoid abnormal shutdown caused by low temperatures.
The touch sensor 180K, also referred to as a "touch device". The touch sensor 180K may be disposed on the display screen 194, and the touch sensor 180K and the display screen 194 form a touch screen, which is also called a "touch screen". The touch sensor 180K is for detecting a touch operation acting thereon or thereabout. The touch sensor may communicate the detected touch operation to the application processor to determine the touch event type. Visual output related to touch operations may be provided through the display 194. In other embodiments, the touch sensor 180K may also be disposed on the surface of the electronic device 100 at a different location than the display 194.
The bone conduction sensor 180M may acquire a vibration signal. In some embodiments, bone conduction sensor 180M may acquire a vibration signal of a human vocal tract vibrating bone pieces. The bone conduction sensor 180M may also contact the pulse of the human body to receive the blood pressure pulsation signal. In some embodiments, bone conduction sensor 180M may also be provided in a headset, in combination with an osteoinductive headset. The audio module 170 may analyze the voice signal based on the vibration signal of the sound portion vibration bone block obtained by the bone conduction sensor 180M, so as to implement a voice function. The application processor may analyze the heart rate information based on the blood pressure beat signal acquired by the bone conduction sensor 180M, so as to implement a heart rate detection function.
The keys 190 include a power-on key, a volume key, etc. The keys 190 may be mechanical keys. Or may be a touch key. The electronic device 100 may receive key inputs, generating key signal inputs related to user settings and function controls of the electronic device 100.
The motor 191 may generate a vibration cue. The motor 191 may be used for incoming call vibration alerting as well as for touch vibration feedback. For example, touch operations acting on different applications (e.g., photographing, audio playing, etc.) may correspond to different vibration feedback effects. The motor 191 may also correspond to different vibration feedback effects by touching different areas of the display screen 194. Different application scenarios (such as time reminding, receiving information, alarm clock, game, etc.) can also correspond to different vibration feedback effects. The touch vibration feedback effect may also support customization.
The indicator 192 may be an indicator light, may be used to indicate a state of charge, a change in charge, a message indicating a missed call, a notification, etc.
The SIM card interface 195 is used to connect a SIM card. The SIM card may be inserted into the SIM card interface 195, or removed from the SIM card interface 195 to enable contact and separation with the electronic device 100. The electronic device 100 may support 1 or N SIM card interfaces, N being a positive integer greater than 1. The SIM card interface 195 may support Nano SIM cards, micro SIM cards, and the like. The same SIM card interface 195 may be used to insert multiple cards simultaneously. The types of the plurality of cards may be the same or different. The SIM card interface 195 may also be compatible with different types of SIM cards. The SIM card interface 195 may also be compatible with external memory cards. The electronic device 100 interacts with the network through the SIM card to realize functions such as communication and data communication. In some embodiments, the electronic device 100 employs esims, i.e.: an embedded SIM card. The eSIM card can be embedded in the electronic device 100 and cannot be separated from the electronic device 100.
In addition, an operating system is run on the components. Such as the iOS operating system developed by apple corporation, the Android open source operating system developed by google corporation, the Windows operating system developed by microsoft corporation, etc. An operating application may be installed on the operating system.
The operating system of the electronic device 100 may employ a layered architecture, an event driven architecture, a microkernel architecture, a microservice architecture, or a cloud architecture. In the embodiment of the application, taking an Android system with a layered architecture as an example, a software structure of the electronic device 100 is illustrated.
Fig. 2 is a software configuration block diagram of the electronic device 100 according to the embodiment of the present application.
The layered architecture divides the software into several layers, each with distinct roles and branches. The layers communicate with each other through a software interface. In some embodiments, the Android system is divided into four layers, from top to bottom, an application layer, an application framework layer, an Zhuoyun rows (Android runtime) and system libraries, and a kernel layer, respectively.
The application layer may include a series of application packages. As shown in fig. 2, the application package may include applications for cameras, gallery, calendar, phone calls, maps, navigation, WLAN, bluetooth, music, video, short messages, etc. For example, in embodiments of the present application, the application package may also include a dedicated image retrieval application, an image location application, or a social application that includes both image retrieval and image location functions. When the user needs to perform image retrieval or image positioning, the application can access an image retrieval interface or an image positioning interface management service provided by an application framework layer.
The application framework layer provides an application programming interface (application programming interface, API) and programming framework for the application of the application layer. The application framework layer includes a number of predefined functions. As shown in FIG. 2, the application framework layer may include a window manager, a content provider, a view system, a telephony manager, a resource manager, a notification manager, and the like. For example, in an embodiment of the present application, the application framework layer may provide APIs related to image retrieval, image ordering, or image positioning functions for the application layer, and interface management services for the application layer to implement the scene orchestration function.
The window manager is used for managing window programs. The window manager can acquire the size of the display screen, judge whether a status bar exists, lock the screen, intercept the screen and the like.
The content provider is used to store and retrieve data and make such data accessible to applications. The data may include video, images, audio, calls made and received, browsing history and bookmarks, phonebooks, etc.
The view system includes visual controls, such as controls to display text, controls to display pictures, and the like. The view system may be used to build applications. The display interface may be composed of one or more views. For example, a display interface including a text message notification icon may include a view displaying text and a view displaying a picture.
The telephony manager is used to provide the communication functions of the electronic device 100. Such as the management of call status (including on, hung-up, etc.).
The resource manager provides various resources for the application program, such as localization strings, icons, pictures, layout files, video files, and the like.
The notification manager allows the application to display notification information in a status bar, can be used to communicate notification type messages, can automatically disappear after a short dwell, and does not require user interaction. Such as notification manager is used to inform that the download is complete, message alerts, etc. The notification manager may also be a notification in the form of a chart or scroll bar text that appears on the system top status bar, such as a notification of a background running application, or a notification that appears on the screen in the form of a dialog window. For example, a text message is prompted in a status bar, a prompt tone is emitted, the electronic device vibrates, and an indicator light blinks, etc.
Android run time includes a core library and virtual machines. Android runtime is responsible for scheduling and management of the android system.
The core library consists of two parts: one part is a function which needs to be called by java language, and the other part is a core library of android.
The application layer and the application framework layer run in a virtual machine. The virtual machine executes java files of the application program layer and the application program framework layer as binary files. The virtual machine is used for executing the functions of object life cycle management, stack management, thread management, security and exception management, garbage collection and the like.
The system library may include a plurality of functional modules. For example: surface manager (surface manager), media Libraries (Media Libraries), three-dimensional graphics processing Libraries (e.g., openGL ES), 2D graphics engines (e.g., SGL), etc.
The surface manager is used to manage the display subsystem and provides a fusion of 2D and 3D layers for multiple applications.
Media libraries support a variety of commonly used audio, video format playback and recording, still image files, and the like. The media library may support a variety of audio and video encoding formats, such as MPEG4, h.264, MP3, AAC, AMR, JPG, PNG, etc.
The three-dimensional graphic processing library is used for realizing three-dimensional graphic drawing, image rendering, synthesis, layer processing and the like.
The 2D graphics engine is a drawing engine for 2D drawing.
The kernel layer is a layer between hardware and software. The inner core layer at least comprises a display driver, a camera driver, an audio driver and a sensor driver.
Although the Android system is described as an example in the embodiment of the present application, the basic principle is equally applicable to electronic devices based on the iOS or Windows and other operating systems.
The workflow of the hardware system and software system of the electronic device 100 is illustrated below in connection with a specific scenario.
When a user performs a touch operation on the touch sensor 180K, a corresponding hardware interrupt is sent to the kernel layer, which processes the touch operation into a raw input event, for example, information including touch coordinates and a time stamp of the touch operation. The original input event is stored in the kernel layer, and the application framework layer acquires the original input event from the kernel layer, identifies a control corresponding to the original input event, and notifies an Application (APP) corresponding to the control. For example, the touch operation is a click operation, the APP corresponding to the control is a camera APP, and after the camera APP is awakened by the click operation, the camera APP may call the camera driver of the kernel layer through the API, and the camera driver controls the camera 193 to shoot.
Application scenario one
When a user opens a search APP and wants to search for similar images according to images in the electronic device, the electronic device responds to the query image selected by the user, retrieves the similar images with the query image from the Internet or an image database of the search APP, and displays the similar images through a display screen of the electronic device according to the sequence of the similarity from high to low.
However, when the existing image retrieval algorithm is adopted to perform image retrieval, the electronic device performs similarity matching based on image features, and for images with high similarity of the image features, for example, multiple images of the same target are shot at different distances or different visual angles, the electronic device is difficult to further sort, so that the similarity sorting in the retrieval result is disordered, and the user experience is poor.
Application scene two
When a user opens a social APP to shoot a scene image and wants to release the scene image and display the position of the scene image, the electronic equipment can respond to the scene image, retrieve the scene image from an Internet database and determine the position information corresponding to the scene image through a visual positioning system/service (visual positioning system/service, VPS) according to a plurality of images in the retrieval result; finally, the electronic device can display the scenery image and the position information through a display screen of the electronic device so as to enable a user to confirm whether the scenery image and the position information are released or not.
However, the image obtained by the existing image searching algorithm may contain a large amount of interference information, for example, the scene image is a pyramid, and more images in the searching result include lion body, face and animal buildings besides the pyramid, so when the electronic device adopts the searching result to perform positioning, the electronic device may perform positioning based on the lion body, face and animal, and the positioning error may be caused, and the user experience is poor.
Based on the above, the embodiment of the application provides an image ordering method.
It should be understood that the foregoing is illustrative of an application scenario, and is not intended to limit the application scenario of the present application in any way.
The image processing method provided by the embodiment of the application is described in detail below with reference to fig. 3 to 6.
Referring to fig. 3, fig. 3 is a flowchart of an image sorting method according to an embodiment of the present application, and specifically includes steps 301 to 303.
301. A first set of images is acquired.
The first image set comprises a plurality of images to be ranked, and each image to be ranked is an image retrieved according to the query image.
Further, the number of feature points matched between each image to be ranked and the query image is greater than or equal to the second threshold. In one possible implementation, acquiring the first set of images includes: searching an image database according to the query image to obtain a second image set, wherein the second image set comprises a plurality of candidate images; and deleting candidate images with matching feature points smaller than a second threshold value between the second image set and the query image to obtain a first image set.
The query image refers to a source image provided by a user, and the device searches for images similar to the source image through the source image query, so that the images to be ranked are obtained. The query image may specifically be an image captured by a user through a camera of the electronic device, or may be an image selected from a database of the electronic device, and the second image set may be a candidate image set retrieved from the database according to the query image.
The image database can be a public database in the Internet or a private database of an APP.
The second threshold may be a preset threshold of number of feature points, or may be a threshold determined according to the number of feature points of the query image, and is used for screening candidate images in the second image set, which are more similar to the query image.
According to the method, the electronic equipment can search the image database through a search algorithm to obtain a plurality of candidate images with higher similarity scores; and then, obtaining the images with the number of the matched characteristic points larger than a second threshold value from the candidate images as images to be sequenced, so that the similarity between the images to be sequenced and the query image in the final first image set is improved, and the interference of special images on image sequencing can be avoided. For example, the local close-up image of the query image, the matching feature points of the local close-up image and the query image are uniformly distributed in the local close-up image, and the common view proportion calculated in a specific mode is high, but the overall similarity is low, so that the image sorting result may be disturbed, and the sorting is disordered.
In another possible implementation, referring to fig. 4, a flow of retrieving a first image set by an electronic device according to a query image may be fig. 4, and fig. 4 is a schematic diagram of an image retrieval method according to an embodiment of the present application, including steps 401 to 404.
401. And (5) preprocessing an image.
After the electronic device obtains the query image and the database image set, it may be first determined whether the query image and the database image in the database image set meet the requirement of the preset image size. The preset size may be the maximum value of the image side length, for example, the preset maximum side length is 640 pixels, or may be the height and width of the image, for example, the preset size is 640 x 480 pixels.
In one possible implementation, the preset size is an image side length; if the height or width of a certain image is larger than the preset side length, the height or width of the image is reduced to a preset size in proportion; if smaller than the preset size, no pretreatment will be necessary.
In another possible implementation, the preset size is the height and width of the image; if the height and width of a certain image are inconsistent with the preset size, the image is stretched in proportion, so that the height and width of the image are consistent with the preset size.
It will be appreciated that the set of preset dimensions is related to the algorithm of subsequent feature extraction and matching; and by adjusting the image size, the feature extraction of the subsequent image is facilitated.
402. And extracting local features of the image.
After obtaining the query image and the database image which meet the preset size requirement, the electronic device can respectively extract the first characteristic point of the query image and the second characteristic point of the database image.
Specifically, the electronic device may perform image feature extraction through scale-INVARIANT FEATURE TRANSFORM (SIFT) algorithm or super point (super point) algorithm.
Taking a SIFT algorithm as an example, the electronic equipment can firstly construct a scale space of an image and establish a corresponding image pyramid, wherein each layer in the image pyramid is an image with different scales; detecting a feature point in the scale space, for example, a point in the scale space, and determining the point as a feature point when the point is at a maximum value or a minimum value compared with 8 adjacent points in the same scale and 18 adjacent points in the adjacent scale; then the low contrast and unstable feature points can be removed; and finally, assigning a value to the extreme point to generate a corresponding characteristic point descriptor.
It will be appreciated that the SIFT algorithm and the super point algorithm are merely examples, and other feature extraction algorithms may be used in practical applications, which are not specifically limited herein.
403. Image local feature matching.
After the first feature point of the query image and the second feature point of the database image are extracted, the electronic device can match the first feature point with the second feature point to obtain feature points matched with all the database images and the query image.
Specifically, the electronic device may perform feature matching through a super glue algorithm or a SIFT algorithm.
Taking a SIFT algorithm as an example, after extracting feature points of two images, matching feature point descriptors of the two images; specifically, a corresponding SIFT feature vector may be generated according to the feature point descriptor, and then the euclidean distance of the feature vector is used as a similarity determination measure for the key points in the two images. For example, a certain feature point in the query image is taken, and the first two feature points with the closest Euclidean distance to the database image are found, and if the distance obtained by dividing the closest distance by the next closest distance is smaller than a preset proportion threshold value, the feature point in the query image and the feature point with the closest Euclidean distance in the database image are determined to be matching feature points.
It will be appreciated that the SIFT algorithm and the super glue algorithm are merely examples, and other feature extraction algorithms may be used in practical applications, which are not specifically limited herein.
404. And removing the outliers.
The outlier (outlier) refers to an outlier pair in the matching point pair, and the use of the outlier as the algorithm input causes errors, which reduces the algorithm accuracy. The feature point matching process can generate outliers, generally has two types, and the first type is mainly caused by incorrect feature matching; the second category comes from motion feature points in the environment, which if treated as static points, can lead to inconsistent algorithm results.
Specifically, the electronic device may cull outliers by a random sample consensus (random sample consensus, RANSAC) algorithm, a robust estimation method, or a combination of both.
Taking a RANSAC algorithm as an example, the electronic device can randomly select a matching characteristic point as an assumed internal point; fitting a model based on the hypothesized interior points; judging whether the rest matched characteristic points accord with the fitted model, and dividing the matched characteristic points into inner points and outer points; if the number of the internal points is too small, marking the internal points as invalid iteration, and re-fitting the model according to the assumed internal points and the internal points divided in the last step; and calculating residual errors of all the inner points, and re-evaluating the model according to the sum of the residual errors or the error rate.
The electronic device may iterate the above steps, take the model with the smallest sum of residuals or the largest number of inner points as the optimal model, and then obtain the corresponding outer points according to the optimal model and reject.
405. And (5) image screening.
After the electronic device eliminates the outliers, the electronic device can screen the images to be ranked from the database image set according to the number of the matched characteristic points between each database image and the query image.
302. And calculating the common view proportion of the corresponding images to be sequenced and the query image according to the first feature points matched between each image to be sequenced and the query image.
When the first image set is obtained, the electronic device can synchronously obtain first feature points matched between all images to be ranked and the query image.
The common view ratio refers to the area ratio of a matching area of the matching feature points between two images in the two images to a preset area of the image to which the matching area belongs.
The first feature points comprise feature points matched with the query image in the target image and feature points matched with the target image in the query image, and the target image is an image to be sequenced, wherein the common view proportion of the image is calculated at the current time.
After the first image set is acquired, the electronic device may calculate a common view ratio between each image to be ranked and the query image one by one.
In one possible implementation, the electronic device may determine a first matching region in the target image and query a second matching region in the image based on the first feature point; and finally, calculating the common view ratio by adopting the smaller one of the first matching area and the second matching area.
The first matching area is an area block where the first feature point in the target image is located, and the second matching area is an area block where the first feature point in the query image is located.
The electronic device may divide the target image and the query image into N and M area blocks, where each area block has the same size, and the area block may be a grid with m×m size, a circle with radius r, or a unit area block with other shapes, where N and M are integers greater than 0; and finally, determining the region block with the first characteristic point as the first matching region or the second matching region.
Specifically, the electronic device may count the first matching region in the target image by counting; and if the first characteristic point exists in each area block of the target image, the count is increased by 1, and the area of the first matching area is represented by a numerical value. The count of the second matching region is the same.
It can be understood that the number of the first feature points matched in the target image and the query image is the same, and the distribution condition of the matched feature points can be intuitively reflected through the size of the matched area by taking the area block where the first feature points are located as the matched area; the larger the matching region, the more discrete the matching feature point distribution is, and the smaller the matching region, the more concentrated the matching feature point distribution is.
In the application, the higher the common view proportion is, the higher the similarity is, and the size of the matching region is in direct proportion to the common view proportion, so that the common view proportion is calculated by adopting a smaller matching region, and the similarity of the target image and the query image can be reflected more accurately. For example, under the condition that first feature points in the query image are uniformly distributed, the first matching area is smaller than or equal to the second matching area, and the similarity can be reflected under the scale of the same standard by calculating the common view proportion by the first matching area; in a special case that some first matching areas are larger than the second matching areas, for example, when the query image contains a large blank, so that the first feature points are concentrated, and the target image is a close-up image of a non-blank area in the query image, the similarity between the two images can be better reflected by adopting the smaller second matching areas to calculate the common view ratio.
As shown in fig. 5, fig. 5 is a schematic diagram showing a comparison of a query image, which is an image photographed 50 meters in front of a subject, and a target image, a, which is an image photographed 500 meters away from the subject, and a target image, B, which is an image photographed 10 meters away from the subject. Wherein the broken line between the images is the connection between the first feature points. It will be appreciated that, for simplicity of the drawing, the lines of all the first feature points are not shown in the drawing.
It can be seen that when the co-view ratio of the query image and the target image a is calculated, the first matching region is small and the second matching region is large, the first matching region is adopted to calculate the co-view ratio, and the computing device can reflect the similarity with the query image by the region in which the first feature points are distributed in the target image a; when the common view ratio of the query image and the target image B is calculated, the first matching area is large and the second matching area is small, and the common view ratio is calculated by adopting the second matching area, the calculating device can reflect the similarity with the query image by the area distributed by the first characteristic points in the query image.
In other possible implementations, the electronic device may calculate only the first matching region or the second matching region, and calculate the common view ratio according to the first matching region or the second matching region.
After determining the first matching region and the second matching region, and after determining the smaller of the two as the common view region, the electronic device may further calculate the common view ratio.
In one possible implementation, the electronic device may calculate a ratio of areas of the common view region and the image to which the common view region belongs as a common view ratio.
If the first matching area is smaller than the second matching area, the first matching area is a common view area, and the electronic equipment calculates the area ratio of the first matching area and the target image to obtain the common view ratio; specifically, the target image may be divided into N region blocks in the aforementioned step of calculating the first matching region, and N may represent the area of the target image, and thus the common view ratio is the ratio of the region count of the first matching region to N.
If the first matching area is larger than the second matching area, calculating the area ratio of the second matching area to the query image to obtain the common view ratio. Similarly, M may represent the area of the query image, and the common view ratio is the ratio of the area count of the second matching area to M.
In another possible implementation, the electronic device may calculate the ratio of the areas of the common view region and the feature region in the same image as the common view ratio.
Referring specifically to fig. 6, fig. 6 is a flowchart of a co-view ratio calculation method according to an embodiment of the present application, where the calculation method includes steps 601 to 603.
601. Matching regions and feature regions are calculated.
After determining the target image, the electronic device may first obtain a first feature point matched between the target image and the query image, and calculate a first matching area A1 in the target image and a second matching area A2 in the query image according to the first feature point.
Then, the electronic device may acquire a second feature point that matches the target image with the target image itself and a third feature point that matches the query image with the query image itself in steps 401 to 403 in the method embodiment as described in fig. 4; and then calculating a first characteristic region B1 where the second characteristic point in the target image is located and a second characteristic region B2 where the third characteristic point in the query image is located.
It can be understood that the method for calculating the area is to count the area block where the corresponding feature point is located, and is specifically the same as the method for counting the area, which is not described herein.
602. And judging whether the first matching area is larger than the second matching area.
After the A1 and the A2 are obtained through calculation, the electronic equipment can judge whether the first matching area is larger than the second matching area by comparing the sizes of the A1 and the A2; and then, taking the smaller matching area as the common view area, and executing step 603.
603. And calculating the common view proportion.
If A1 is larger than A2, calculating the ratio of the second matching area A2 to the fourth characteristic area B2 to obtain the common view ratio C.
If A1 is smaller than A2, calculating the ratio of the first matching area A1 to the third characteristic area B1 to obtain the common view ratio C.
According to the application, the ratio of the matching area to the corresponding characteristic area is calculated as the common view ratio, so that the interference of the blank area or the area without the characteristic point in the image can be eliminated, and the obtained common view ratio can more accurately reflect the similarity of the distribution condition of the second characteristic point in the two images.
303. And sorting the plurality of images to be sorted according to the common view ratio.
After obtaining the common view proportion of each image to be sequenced, the electronic device can sequence the images to be sequenced in the first image set according to the common view proportion from large to small.
In one possible implementation, the electronic device may delete the images to be ranked having a common view ratio below the first threshold in the first image set first, and rank the remaining images to be ranked.
The first threshold is a preset common view ratio threshold.
In one possible implementation, the electronic device, after sorting the images to be sorted, may select the top P images as a set of input images for input to other algorithms, P being an integer greater than 0.
The other algorithm may be an image positioning algorithm or a pose estimation algorithm, among others.
In the embodiment of the application, after the image sequence with the similarity sequenced from high to low is obtained, the first N images can be selected as the input of other algorithms, so that the accuracy of the algorithm can be improved, and the operation amount and operation time of the algorithm can be reduced.
According to the embodiment of the application, after the image to be sequenced which is similar to the image characteristics of the query image is obtained through retrieval, the common view proportion reflecting the distribution of the characteristic points is calculated according to the characteristic points matched between the image to be sequenced and the query image; and finally, sorting the images to be sorted according to the common view proportion, so as to achieve the effect of further sorting the search results according to the characteristic point distribution of the images, and solve the problem of low sorting precision of similar images.
Referring to fig. 7, fig. 7 is a block diagram illustrating an image sorting apparatus 700 according to an embodiment of the present application, where the image sorting apparatus 700 includes:
An obtaining unit 701, configured to obtain a first image set, where the first image set includes a plurality of images to be ranked, and the images to be ranked are images retrieved according to a query image;
The calculating unit 702 is configured to calculate, according to first feature points matched between each image to be ranked and the query image, a common view ratio corresponding to the image to be ranked and the query image, where the first feature points include feature points matched with the query image in a target image, and feature points matched with the target image in the query image, the target image is the image to be ranked for which the common view ratio is calculated at the present time, and the common view ratio refers to an area ratio of a matching area of feature points matched between two images in the two images and a preset area of an image to which the matching area belongs;
A sorting unit 703, configured to sort the plurality of images to be sorted according to the common view ratio.
In one possible implementation, the computing unit 702 is specifically configured to: determining a first matching area in the target image and a second matching area in the query image according to the first feature points; the first matching area is an area block where the first feature point is located in the target image, and the second matching area is an area block where the first feature point is located in the query image; the common view ratio is calculated using the smaller of the first matching region and the second matching region.
In one possible implementation, the computing unit 702 is specifically configured to: if the first matching area is smaller than the second matching area, calculating the area ratio of the first matching area to the target image to obtain the common view ratio; if the first matching area is larger than the second matching area, calculating the area ratio of the second matching area to the query image to obtain the common view ratio.
In one possible implementation, the computing unit 702 is specifically configured to: if the first matching area is smaller than the second matching area, calculating the area ratio of the first matching area to the first characteristic area of the target image to obtain the common view ratio; the first characteristic region is a region block in which a second characteristic point in the target image is located, and the second characteristic point is a characteristic point matched between the target image and the target image; if the first matching area is larger than the second matching area, calculating the area ratio of the second matching area to the second characteristic area of the query image to obtain the common view ratio; the second feature area is an area block where a third feature point in the query image is located, and the third feature point is a feature point matched between the query image and the query image.
In one possible implementation, the computing unit 702 is specifically configured to: dividing the target image and the query image into N and M regional blocks respectively, wherein the size of each regional block is the same, and N and M are integers larger than 0; and determining the region block with the second feature point as the first matching region or the second matching region.
In one possible implementation, the apparatus further includes: and a deleting unit 704, configured to delete the to-be-ranked images in the first image set with the common view ratio lower than a first threshold.
In one possible implementation, the sorting unit 703 is specifically configured to: sorting the images to be sorted in the first image set from large to small according to the common view proportion to obtain a sorting result; the apparatus further comprises: the output unit 705 inputs the first P images in the sorting result into an image positioning algorithm or a pose estimation algorithm, where P is an integer greater than 0.
The image sorting apparatus 700 provided in this embodiment is used for executing the image sorting method in the above embodiment, and the technical principle and the technical effect are similar, and are not repeated here.
The image processing apparatus 700 is embodied as a functional unit. The term "unit" herein may be implemented in software and/or hardware, without specific limitation.
The embodiment of the application also provides electronic equipment, which comprises the processor. The electronic device provided in this embodiment may be the electronic device 100 shown in fig. 1, for executing the image sorting method described above. In case an integrated unit is employed, the electronic device may comprise a processing module, a storage module and a communication module. The processing module may be configured to control and manage actions of the electronic device, for example, may be configured to support the electronic device to execute steps executed by the display unit, the detection unit, and the processing unit. The memory module may be used to support the electronic device to execute stored program code, data, etc. And the communication module can be used for supporting the communication between the electronic device and other devices.
Wherein the processing module may be a processor or a controller. Which may implement or perform the various exemplary logic blocks, modules and circuits described in connection with this disclosure. A processor may also be a combination that performs computing functions, e.g., including one or more microprocessors, digital Signal Processing (DSP) and a combination of microprocessors, and the like. The memory module may be a memory. The communication module can be a radio frequency circuit, a Bluetooth chip, a Wi-Fi chip and other equipment which interact with other electronic equipment.
In one embodiment, when the processing module is a processor and the storage module is a memory, the electronic device according to this embodiment may be a device having the structure shown in fig. 1.
Specifically, referring to fig. 8, fig. 8 shows a schematic structural diagram of another electronic device provided by the present application. The dashed line in fig. 8 indicates that the unit or the module is optional. The electronic device 800 may be used to implement the image ordering method described in the method embodiments above.
The electronic device 800 includes one or more processors 801, which one or more processors 801 may support the electronic device 800 to implement the image ordering method in the method embodiments described above.
The processor 801 may be used to control the electronic device 800, execute software programs, and process data for the software programs. The electronic device 800 may also include a communication unit 805 to enable input (reception) and output (transmission) of signals.
The electronic device 800 may include one or more memories 802 having a program 804 stored thereon, the program 804 being executable by the processor 801 to generate instructions 803 such that the processor 801 performs the image ordering method described in the method embodiments described above in accordance with the instructions 803.
Optionally, the memory 802 may also have data stored therein. Optionally, processor 801 may also read data stored in memory 802, which may be stored at the same memory address as program 804, or which may be stored at a different memory address than program 804.
The processor 801 and the memory 802 may be provided separately or may be integrated together; for example, integrated on a System On Chip (SOC) of the terminal device.
The embodiment of the application also provides a computer readable storage medium, in which a computer program is stored, which when executed by a processor, causes the processor to execute the image sorting method according to any one of the embodiments.
Such as memory 802. The memory 802 may be volatile memory or nonvolatile memory, or the memory 802 may include both volatile and nonvolatile memory. The nonvolatile memory may be a read-only memory (ROM), a Programmable ROM (PROM), an erasable programmable ROM (erasable PROM), an electrically erasable programmable EPROM (EEPROM), or a flash memory. The volatile memory may be random access memory (random access memory, RAM) which acts as external cache memory. It is to be understood that the above is intended to be illustrative, and not restrictive.
The embodiment of the application also provides a computer program product which, when run on a computer, causes the computer to perform the above-mentioned related steps to implement the image ordering method in the above-mentioned embodiment.
The computer program product may be stored in a memory 802, such as program 804, with the program 804 ultimately being converted into an executable object file that can be executed by the processor 801 via preprocessing, compiling, assembling, and linking processes.
The electronic device, the computer readable storage medium, the computer program product or the chip provided in this embodiment are used to execute the corresponding method provided above, so that the beneficial effects thereof can be referred to the beneficial effects in the corresponding method provided above, and will not be described herein.
In the several embodiments provided by the present application, it should be understood that the disclosed apparatus and method may be implemented in other manners. For example, the apparatus embodiments described above are merely illustrative, e.g., the division of modules or units is merely a logical function division, and there may be additional divisions when actually implemented, e.g., multiple units or components may be combined or integrated into another apparatus, or some features may be omitted or not performed. In addition, the coupling or direct coupling or communication connection shown or discussed with respect to each other may be an indirect coupling or communication connection via interfaces, devices, or units, and the replacement units may or may not be physically separate, and the components shown as units may be one physical unit or multiple physical units, that is, may be located in one place, or may be distributed in multiple different places. Some or all of the units may be selected according to actual needs to achieve the purpose of the solution of this embodiment.
In addition, each functional unit in the embodiments of the present application may be integrated in one processing unit, or each unit may exist alone physically, or two or more units may be integrated in one unit. The integrated units may be implemented in hardware or in software functional units.
The integrated units, if implemented in the form of software functional units and sold or used as stand-alone products, may be stored in a readable storage medium. Based on such understanding, the technical solution of the embodiments of the present application may be essentially or a part contributing to the prior art or all or part of the technical solution may be embodied in the form of a software product stored in a storage medium, including several instructions for causing a device (may be a single-chip microcomputer, a chip or the like) or a processor (processor) to perform all or part of the steps of the methods of the embodiments of the present application. And the aforementioned storage medium includes: a U-disk, a removable hard disk, a Read Only Memory (ROM), a random access memory (random access memory, RAM), a magnetic disk, or an optical disk, or other various media capable of storing program codes.
The foregoing is merely illustrative of the present application, and the present application is not limited thereto, and any person skilled in the art will readily recognize that variations or substitutions are within the scope of the present application. Therefore, the protection scope of the application is subject to the protection scope of the claims.

Claims (7)

1. An image display method applied to an electronic device, the method comprising:
acquiring a query image in response to a selection operation;
retrieving a first image set according to a query image, wherein the first image set comprises a plurality of images to be ranked, and the number of first feature points matched between the images to be ranked and the query image is larger than or equal to a second threshold value;
aiming at the images to be ranked, taking the area block of the first characteristic point matched with the query image in the images to be ranked as a first matching area, and taking the area block of the first characteristic point matched with the images to be ranked in the query image as a second matching area;
if the first matching area is smaller than the second matching area, calculating the ratio of the area of the first matching area to the area of a preset area of an image to which the first matching area belongs, and obtaining a common view ratio;
if the first matching area is larger than the second matching area, calculating the ratio of the area of the second matching area to the area of a preset area of an image to which the second matching area belongs, and obtaining the common view ratio;
deleting the images to be sorted, wherein the common view proportion of the images to be sorted is lower than a first threshold value;
Sorting the rest images to be sorted according to the common view proportion;
Displaying the ordered images to be ordered.
2. The method of claim 1, wherein the area of the preset area of the image to which the first matching area belongs is the area of the image to which the first matching area belongs, and the area of the preset area of the image to which the second matching area belongs is the area of the image to which the second matching area belongs.
3. The method of claim 1, wherein the preset region of the image to which the first matching region belongs is a first feature region of the image to be ranked, the first feature region is a region block in which a second feature point in the image to be ranked is located, and the second feature point is a feature point matched between the image to be ranked and the image to be ranked;
The preset area of the image to which the second matching area belongs is a second characteristic area of the query image, the second characteristic area is an area block where a third characteristic point in the query image is located, and the third characteristic point is a characteristic point matched between the query image and the query image.
4. A method according to any one of claims 1 to 3, wherein the step of using, as a first matching region, a region block in the image to be ranked in which a first feature point matching the query image is located, and using, as a second matching region, a region block in the query image in which a first feature point matching the image to be ranked is located, includes:
dividing the image to be ordered and the query image into N and M regional blocks respectively, wherein the size of each regional block is the same, and N and M are integers larger than 0;
and determining a region block in which the first feature point exists as the first matching region or the second matching region.
5. A method according to any one of claims 1 to 3, wherein said ranking the remaining images to be ranked according to the common view ratio comprises:
Ranking the rest images to be ranked according to the common view proportion from large to small to obtain a ranking result;
after the ranking of the remaining images to be ranked according to the common view ratio, the method further comprises:
and inputting the first P images in the sequencing result into an image positioning algorithm or a pose estimation algorithm, wherein P is an integer greater than 0.
6. An electronic device comprising a processor configured to couple with a memory and to read instructions in the memory and to cause the electronic device to perform the method of any one of claims 1 to 5 in accordance with the instructions.
7. A computer readable storage medium, characterized in that the computer readable storage medium has stored therein a computer program which, when executed by a processor, causes the processor to perform the method of any of claims 1 to 5.
CN202211364538.1A 2022-11-02 2022-11-02 Image ordering method, electronic device, program product and medium Active CN115437601B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202211364538.1A CN115437601B (en) 2022-11-02 2022-11-02 Image ordering method, electronic device, program product and medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202211364538.1A CN115437601B (en) 2022-11-02 2022-11-02 Image ordering method, electronic device, program product and medium

Publications (2)

Publication Number Publication Date
CN115437601A CN115437601A (en) 2022-12-06
CN115437601B true CN115437601B (en) 2024-04-19

Family

ID=84252884

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202211364538.1A Active CN115437601B (en) 2022-11-02 2022-11-02 Image ordering method, electronic device, program product and medium

Country Status (1)

Country Link
CN (1) CN115437601B (en)

Families Citing this family (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN117131213A (en) * 2023-04-10 2023-11-28 荣耀终端有限公司 Image processing method and related equipment

Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN114782716A (en) * 2022-04-11 2022-07-22 中国工商银行股份有限公司 Image matching method and device
WO2022161011A1 (en) * 2021-01-29 2022-08-04 华为技术有限公司 Method for generating image and electronic device
CN115170893A (en) * 2022-08-29 2022-10-11 荣耀终端有限公司 Training method of common-view gear classification network, image sorting method and related equipment

Family Cites Families (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US11727052B2 (en) * 2020-09-03 2023-08-15 General Electric Company Inspection systems and methods including image retrieval module

Patent Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
WO2022161011A1 (en) * 2021-01-29 2022-08-04 华为技术有限公司 Method for generating image and electronic device
CN114782716A (en) * 2022-04-11 2022-07-22 中国工商银行股份有限公司 Image matching method and device
CN115170893A (en) * 2022-08-29 2022-10-11 荣耀终端有限公司 Training method of common-view gear classification network, image sorting method and related equipment

Non-Patent Citations (1)

* Cited by examiner, † Cited by third party
Title
图像的SIFT特征二阶检索算法;易军凯 等;北京化工大学学报(自然科学版);20160720;第43卷(第4期);第84-89页 *

Also Published As

Publication number Publication date
CN115437601A (en) 2022-12-06

Similar Documents

Publication Publication Date Title
CN110910872B (en) Voice interaction method and device
CN115866121B (en) Application interface interaction method, electronic device and computer readable storage medium
CN111061912A (en) Method for processing video file and electronic equipment
CN114650363B (en) Image display method and electronic equipment
CN113364971A (en) Image processing method and device
CN112130714B (en) Keyword search method capable of learning and electronic equipment
CN113542580B (en) Method and device for removing light spots of glasses and electronic equipment
CN114140365B (en) Event frame-based feature point matching method and electronic equipment
CN116070035B (en) Data processing method and electronic equipment
CN116048358B (en) Method and related device for controlling suspension ball
CN115115679A (en) Image registration method and related equipment
CN115437601B (en) Image ordering method, electronic device, program product and medium
CN112740148A (en) Method for inputting information into input box and electronic equipment
CN114911400A (en) Method for sharing pictures and electronic equipment
CN115686182B (en) Processing method of augmented reality video and electronic equipment
CN116861066A (en) Application recommendation method and electronic equipment
CN114942741B (en) Data transmission method and electronic equipment
CN114764300B (en) Window page interaction method and device, electronic equipment and readable storage medium
CN116703741B (en) Image contrast generation method and device and electronic equipment
CN114205318B (en) Head portrait display method and electronic equipment
CN116048831B (en) Target signal processing method and electronic equipment
CN112416984B (en) Data processing method and device
CN117710695A (en) Image data processing method and electronic equipment
CN117130695A (en) Target information processing method and device and electronic equipment
CN117131380A (en) Matching degree calculation method and electronic equipment

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination
GR01 Patent grant
GR01 Patent grant