C Demonceaux
email: cedric.demonceaux@u-picardie.frpascal.vasseur@u-picardie.fr

P Vasseur

M I S Ea

OMNIDIRECTIONAL IMAGE PROCESSING USING GEODESIC METRIC

Keywords:

Due to distorsions of catadioptric sensors, omnidirectional images can not be treated as classical images. If the equivalence between central catadioptric images and spherical images is now well known and used, spherical analysis often leads to complex methods particularly tricky to employ. In this paper, we propose to derive omnidirectional image treatments by using geodesic metric. We demonstrate that this approach allows to adapt efficiently classical image processing to omnidirectional images.

INTRODUCTION

Numerous applications benefit from the use of cameras with panoramic field of view [START_REF] Benosman | Panoramic vision: sensors, theory, and applications[END_REF]. However, because of distorsions observed in images obtained with this kind of sensor (fig 3) classical image processing treatments are not adapted. Consequently, Bogdanova and al. [START_REF] Bogdanova | Scale-space analysis and active contours for omnidirectional images[END_REF] proposed to include the deformation of the mirror by considering the Jacobian induced by the mirror geometry. This method permits the correction of image distorsions for gradient estimation but can not be extended to image filtering. An other approach consists in considering omnidirectional image as a planar projection of a spherical image. Indeed, [START_REF] Barreto | A unifying geometric representation for central projection systems[END_REF] [4], [START_REF] Ying | Can we consider central catadioptric cameras and fisheye cameras within a unified imaging model[END_REF] have demonstrated that a central image (catadioptric or perspective) or a fisheye image are equivalent to a spherical image if the intrinsic parameters of the sensor are known. In this way, spherical space appears more suitable for image processing than Euclidean plane. In order to avoid spherical geometry, Jacquey and al. [START_REF] Jacquey | Fuzzy edge detection for omnidirectional images[END_REF] proposed to project the spherical image onto an including virtual cylinder. Classical image filterings are then applied on this cylinder. Even if this representation appears to be a good approximation, cylindric geometry is not adapted to spherical images. Demonceaux and Vasseur [START_REF] Demonceaux | Markov random fields for catadioptric image processing[END_REF] proposed to adapt Markovian methods to omnidirectional images by defining a neighborhood with spherical constraints for each pixel. This representation presents a real improvement of the quality of the results obtained with Markovian treatments but can not be also generalized to image filtering. In [START_REF] Makadia | Correspondence-free structure from motion[END_REF] and [START_REF] Bigot | Spherical edge detector: Application to omnidirectional imaging[END_REF], omnidirectional are considered as spherical images and the authors use spherical harmonics in order to define convolution product and Fourier transform. However, these spherical tools have been developped from a sampling which is not appropriate to omnidirectional images. Indeed, spherical coordinates of a point are defined as ∀x ∈ S 2 , x = (cos(φ) sin(θ), sin(φ) sin(θ), cos(θ)), where φ ∈ [0, 2π[, θ ∈ [0, π] and the natural sampling of the sphere consists in considering every points separated by constant θ i and φ j . Thus, the distance of two points on this kind of grid depends on their latitude (fig 1). Consequently, this irregular grid requires to introduce a weighting on the azimuth derivate for computing the gradient ∂I ∂φ ( [START_REF] Bigot | Spherical edge detector: Application to omnidirectional imaging[END_REF]):

∇ S 2 I(θ, φ) = ∂I ∂θ e θ (θ, φ) + 1 sin(θ) ∂I ∂φ e φ (θ, φ)
Moreover, this representation leads to a non-commutative convolution product and does not verify the useful following relation (I * f ) ′ = I * f ′ . In this way, computing the gradient by using the low-pass filter derivative as in perspective images is impossible. Ainouz and al [START_REF] Ainouz | Mirroradapted matching of catadioptric images[END_REF] propose to filter an omnidirectional image using the projection of the previous spherical sampling on the omnidirectional plane. But, once more, due to this irregular sampling, the formulation is not really correct.

In this paper, we propose to define omnidirectional image convolution from geodesic distance between points. We demonstrate that this definition allows to use similar filters than in perspective image processing and moreover, that commutative properties and derivative computation of the convolution remain valid.

GEODESIC METRIC

Perspective image processing tools are generally based on Euclidean metric :

∀x, y ∈ R 2 , d(x, y) = ||x -y|| l 2 (R 2 ) .
From this metric, it is possible to define a neighborhood in order to compute derivatives, to detect corners or to perform point matching for instance. The aim of the neighborhood is to define in the image plane the dependency between 3D points. Practically, for an orthographic camera this neighborhood describes exactly 3D dependency of points if they live on a fronto-parallel plane (fig 2(a)). For a perspective camera, this neighborhood is an approximation whatever the configuration of 3D points (fig 2 (b)). In the case of an omnidirectional image, this neighborhood is no more adapted (fig 2 (c)). However, if we consider a regular sampling according to θ and φ (fig 2(d)), this neighborhood describes exactly the mutual influence of 3D points if they live on a concentric sphere of the unitary sphere and is a good approximation in the general case. This is this kind of neighborhood that we develop in the following.

Definition

Let P, the projection of an omnidirectional planar image into its equivalent spherical image:

P : R 2 → S 2 x → x s = (θ, φ) (1)
In order to apply image processing treatments on the sphere, we propose to employ the following geodesic distance :

∀x s , y s ∈ S 2 d(x s , y s ) = arcos(x s , y s ).
Let x s ∈ S 2 , the projection of planar image pixel x on the equivalent sphere (x s = P(x)). The continuous neighborhood V r (x) of pixel x in the image is defined as :

V r (x) = {y s ∈ S 2 , d(x s , y s ) < r}
The discrete neighborhood V N r (x) is then defined by (fig. 2(d)): By analogy with the planar case, we define a regular grid of (2N + 1) × (2N + 1) points centered in x s such as the geodesic distance between a point and its nearest neighbours is exactly equal to r :

∀ P(x) = x s = (θ, φ) ∈ S 2 V N r (x) = {(θ ′ , φ ′ )| θ ′ = θ + nr, φ ′ = φ + p sin(θ) r -N ≤ n, p ≤ N } (2)
∀y s ∈ V N r (x) min zs∈V N r (x) d(y s , z s ) = r.

Filtering

Considering an omnidirectional image I and

I V N r (x) = I(P -1 (V N r (x)
)) as a regular grid centered in x with (2N + 1) 2 pixels associated to their grey level values. Let H be a filter of size (2N + 1) × (2N + 1), the filtered image IH at the point x = (x 1 , x 2 ) can be defined similarly than in the classical case by the convolution product1 :

IH(x) = I V N r (x) (x) * H = N i=-N N j=-N I V N r (x) (x 1 -i, x 2 -j)H(i, j) (3)
If we consider the particular example of the gradient from a Sobel filter,

S =   -1 -2 -1 0 0 0 1 2 1   .
we then obtain :

||∇I(x)|| 2 = |I V 2 r (x) * S| 2 + |I V 2 r (x) * S ′ | 2
In the same way, image filtering with a Gaussian can be seen as a weighting of the points according to their distance from the considered point. Consequently, the traditional Gaussian defined as :

G x (y, σ) = 1 2πσ 2 exp - ||x -y|| 2 2σ 2
can be replaced by :

G x (y, σ) = 1 2πσ 2 exp - d(x, y) 2σ 2 (4)
Moreover, it is possible to develop the following Laplacian of Gaussian :

LoG x (y) = - 1 πσ 4 [1 - d(x, y) 2σ 2 ] exp - d(x, y) 2σ 2 (5)
Thus, while harmonic analysis proposes definitions for Gaussian and Laplacian of Gaussian very tricky to implement for spherical image processing [START_REF] Bigot | Spherical edge detector: Application to omnidirectional imaging[END_REF], our approach allows to adapt easily classical filters. Indeed, thanks to (4, 5) and the convolution product defined by (3), the masks used in perspective image processing remain valid.

EXPERIMENTS

In this section, we demonstrate the benefits of our modeling in the case of corner detection based on Harris method and in the case of point matching based on ZNCC. It is worth noting that our geodesic neighborhood requires a first interpolation phase. In the following experiments of this section, we obtain I V N r (x) by a nearest neighbour interpolation.

Harris detector

Harris detector allows to extract corners in images and is particularly useful in computer vision. In perspective image processing, detect corners by Harris method consists in studying eigenvalues of matrix M for each point X:

M (X) = L 2 x (X, σ) L x L y (X, σ) L x L y (X, σ) L 2 y (X, σ) (6)
where

L i (X, σ) = ∂ ∂i G X (X, σ) * I(X)
In the case of omnidirectional images, this definition is always valid by using the convolution defined in (3) and (4). Results 3 for two consecutive images of a sequence. Table 1 presents the repeatability factor [START_REF] Schmid | Evaluation of interest point detectors[END_REF] of our detector in comparison with the classical Harris detector. On the locker (fig 3(b) and 3(d)), 50 corners have been detected in I 1 with our method and 55 with the classical approach. In the second frame, we detect 51 corners with our approach while the classical Harris detector finds only 36 corners. In the results of the classical Harris detector, only 29 common corners have been detected which corresponds to a repeatability rate equal to 80%. In the case of the geodesic approach, 43 common corners have been detected between the two images which corresponds to a repeatability of 86%.

Matching with ZNCC

Beyond image processing methods based on filtering, point matching techniques based on correlation have also to include

P j∈V(y) (I 1 (i) -I 1 (x))(I 2 (j) -I 2 (y)) q P i∈V(x) (I 1 (i) -I 1 (x)) 2 P j∈V(y) (I 2 (j) -I 2 (y)) 2 (7)
where I 1 (x) (resp I 2 (y)) is the mean of I 1 (resp. I 2 ) in the neighborhood V(x) (resp. V(y)). We have compared a classical neighborhood of size 7 × 7 with a geodesic neighborhood V 3 r (fig 4). If we consider the same corners in both cases and the same thresholds, classical ZNCC allows to match 65 points. Among these 65 matchings, only 53 are correct, which represents 18.4% of outliers. In the case of geodesic neighborhood defined by (2), we obtain 71 matchings including 63 correct ones, which is equal to 11.2% of outliers.

CONCLUSION

In this paper, we have proposed a new approach for omnidirectional image processing which consists in considering the spherical space and the geodesic metric rather than Euclidean plane with Euclidean metric. We are then able to define a geodesic neighborhood which presents several advantages :

• Masks are similar to the masks in R 2

• Classical methods are easily transposable.

The single drawback of the approach deals with the necessity to perform an interpolation of the image in order to define our regular grid. Nevertheless a simple interpolation by nearest neighborhood allows to obtain good results as shown in the experiments. A very interesting perspective consists in developing spherical multi-scale image processing.

Fig. 1 .

 1 Fig. 1. Sphere sampling with constant φ and θ provides an irregular grid.

Fig. 2 .

 2 Fig. 2. Image formation and neighborhood dependency. (a) Orthographic image, Euclidean metric, (b) perspective image, Euclidean metric, (c) omnidirectional image, Euclidean metric, (d) omnidirectional image, geodesic metric.

Fig. 3 .

 3 Fig. 3. Harris detector. (a)-(b) classical approach,(c)-(d) geodesic approach

Fig. 4 .

 4 Fig. 4. Matching with ZNCC. (a) classical approach : 65 matchings, 53 true matchings,(b) geodesic approach : 71 matchings, 63 true matchings

Table 1 .

 1

		Geodesic Harris Classical Harris
	Image	I 1 I 2	I 1 I 2
	Corners	231 227	212 239
	Corners on locker	50 51	55 36
	Repeatability	43 →86%	29 →80%

This representation is equivalent to the convolution product on the tangent plane at point xs = P(x).


Dynamic Programming and Skyline Extraction in Catadioptric Infrared Images

Jean-Charles Bazin, Inso Kweon, Cédric Demonceaux and Pascal Vasseur

Abstract-Unmanned Aerial Vehicles (UAV) are the subject of an increasing interest in many applications and a key requirement for autonomous navigation is the attitude/position stabilization of the vehicle. Some previous works have suggested using catadioptric vision, instead of traditional perspective cameras, in order to gather much more information from the environment and therefore improve the robustness of the UAV attitude/position estimation. This paper belongs to a series of recent publications of our research group concerning catadioptric vision for UAVs. Currently, we focus on the extraction of skyline in catadioptric images since it provides important information about the attitude/position of the UAV. For example, the DEMbased methods can match the extracted skyline with a Digital Elevation Map (DEM) by process of registration, which permits to estimate the attitude and the position of the camera. Like any standard cameras, catadioptric systems cannot work in low luminosity situations because they are based on visible light. To overcome this important limitation, in this paper, we propose using a catadioptric infrared camera and extending one of our methods of skyline detection towards catadioptric infrared images. The task of extracting the best skyline in images is usually converted in an energy minimization problem that can be solved by dynamic programming. The major contribution of this paper is the extension of dynamic programming for catadioptric images using an adapted neighborhood and an appropriate scanning direction. Finally, we present some experimental results to demonstrate the validity of our approach.

I. INTRODUCTION

Estimating the position and the orientation of a Unmanned Aerial Vehicle (UAV) is a fundamental step towards the autonomy of these vehicles. It is now well established that traditional navigation equipments like Global Positioning System or Inertial Navigation System suffer from many limitations. For example, GPS is sensitive to signal dropout and hostile jamming. The drawback of INS is that its position error compounds over time and may cause large localization errors. In order to overcome these main disadvantages, many researchers suggested a vision-based approach of the navigation problem, which helps estimating localization and/or orientation of a UAV when GPS or inertial guidance is not available [START_REF] Kanade | Advances in cooperative multi-sensor video surveillance[END_REF][2][3] [START_REF] Wang | Complete pose determination for low altitude unmanned aerial vehicle using stereo vision[END_REF]. Most of the existing works use conventional cameras which have a narrow field of view and thus the amount of information we could get from the environment is drastically limited. That is why some works have proposed using catadioptric cameras to greatly increase the field of view and applied them for various tasks [START_REF] Winters | Omnidirectional vision for robot navigation[END_REF][6] [START_REF] Yagi | Omnidirectional sensing and its applications[END_REF]. Concerning UAV applications, Hrabar and Sukhatme were the first to apply catadioptric cameras for autonomous aerial vehicles. In [START_REF] Hrabar | Omnidirectional vision for an autonomous helicopter[END_REF] [START_REF] Hrabar | A comparison of two camera configurations for optic-flow based navigation of a uav through urban canyons[END_REF], they managed to estimate the 2D position/orientation of an helicopter. However, they require artificial visual targets and cannot estimate the 3D position/orientation. Our research group has been aiming to estimate the UAV attitude/position, which has led to a series of recent publications. The methods introduced in [START_REF] Demonceaux | Robust attitude estimation with catadioptric vision[END_REF] and [START_REF] Demonceaux | Omnidirectional vision on UAV for attitude computation[END_REF] compute the roll and pitch angles after extracting the horizon in catadioptric images by adapted Markov Random Field (MRF) or maximizing RGB-based Mahalanobis distance. We have also developed a line-based method that can run in urban environment [START_REF] Demonceaux | UAV attitude computation by omnidirectional vision in urban environment[END_REF]. By considering the vertical direction as the normal vector of the ground plane, we were able to apply the same technique than in [START_REF] Demonceaux | Robust attitude estimation with catadioptric vision[END_REF] [START_REF] Demonceaux | Omnidirectional vision on UAV for attitude computation[END_REF]. In [START_REF] Bazin | Uav attitude estimation by vanishing points in catadioptric images[END_REF], we extracted the vanishing points contained in an urban scene and managed to estimate the complete rotation using infinite homography. In [START_REF] Bazin | A robust top-down approach for rotation estimation and vanishing points extraction by catadioptric vision in urban environment[END_REF], we developed a top-down approach that builds some hypothesis on the rotation angles and then verifies the consistency of the vanishing points extraction. In [START_REF] Bazin | UAV attitude estimation by combining horizon-based and homography-based approaches for catadioptric image[END_REF], we developed a hybrid approach that combines horizon-based technique with planar homography in order to estimate both rotation and translation. Finally, in [START_REF] Bazin | Motion esimation by catadioptric vision[END_REF], we have introduced a method that combines rotation estimation and epipolar geometry to estimate the attitude and the position of a UAV from only 2 point correspondences.

Whereas very interesting results have been obtained, all these vision-based methods cannot operate in low luminosity conditions since cameras are generally based on visible light which limit their applications to daytime and appropriate weather conditions. The solution is to use an infrared camera, which permits to observe the environment independently of the luminosity conditions. Unfortunately, most of the navigation methods developed for traditional images cannot be applied for IR images since traditional and IR images contain different types of information. This is essentially due to the observability problem: the features that are generally used for navigation estimation cannot be correctly detected in IR images. For example, the lines associated to urban environment (building edges, road lanes, etc...) are hard to extracted because they usually do not emit distinctive IR radiations and thus the line-based methods are likely to fail [START_REF] Bazin | Uav attitude estimation by vanishing points in catadioptric images[END_REF]. The spatial resolution of IR images is usually very low and moreover, in UAV applications, since the camera is at high altitude, the image resolution might still be lower (1 pixel represents a larger distance). Therefore the extraction of interest points, like SIFT features [START_REF] Lowe | Distinctive image features from scale-invariant keypoints[END_REF] or Harris corners [START_REF] Harris | A combined corner and edge detection[END_REF], might not be precise and most of the traditional methods based on epipolar geometry cannot work properly [START_REF] Hartley | Multiple View Geometry in Computer Vision[END_REF].

In this paper, we aim to extract the skyline in catadioptric infrared images since it provides key information about the attitude/position of the UAV. For example, once the skyline is extracted, the DEM-based methods can match it with a Digital Elevation Map (DEM) by process of registration [START_REF]Camera pose estimation by alignment from a single mountain image[END_REF] [START_REF] Cozman | Automatic mountain detection and pose estimation for teleoperation of lunar rovers[END_REF], which permits to estimate the attitude and the position of the camera. Due to the narrow field of view of traditional cameras, only a small part of the skyline is usually observed and thus the matching step with the DEM is not very robust. By using a catadioptric infrared camera, we can observe, independently of the luminosity conditions, a much larger part of the skyline, which can improve the registration with the DEM. The task of extracting the best skyline in images is usually converted in an energy maximization problem that can be solved by the important technique of dynamic programming. However the traditional dynamic programming is not adapted for catadioptric images because of the distortions due to the mirror. The major contribution of this paper is the extension of the dynamic programming technique for catadioptric images using an adapted neighborhood and an appropriate scanning direction.

This paper is divided into four main parts. First, we will recall the catadioptric projection and explain the concept of the catadioptric infrared cameras. In the third part, we present our proposed algorithm for skyline extraction in catadioptric IR images and the extension of dynamic programming. Finally we perform some experiments and show the results.

II. CATADIOPTRIC VISION AND IMAGE FORMATION

Intuitively, if the field of view is wider, we can gather more information from the environment and thus it is possible to estimate the pose more precisely and robustly. Obviously, an imaging system that is able to see in all directions could play a key role for this task. Such kind of sensors is simply called omnidirectional systems and provides a wide field of view. Catadioptric cameras are a specific kind of omnidirectional systems. They are devices which use both mirrors (catoptric elements) and lenses (dioptric elements) to form images through a conventional camera [START_REF] Geyer | Catadioptric projective geometry[END_REF]. Such systems usually have a field of view greater than 180 degrees and are getting both cheaper and more effective. Baker and Nayar classified catadioptric sensors into two categories depending on the number of viewpoints [START_REF] Baker | A theory of catadioptric image formation[END_REF]. Sensors with a single viewpoint, named central catadioptric sensors, permit a geometrically corrected reconstruction of the perspective image from the original catadioptric image. Geyer and Daniilidis have demonstrated the equivalence for the single viewpoint category with a two-step projection via a unitary sphere centered on the focus of the mirror (the single viewpoint) [START_REF] Geyer | Catadioptric projective geometry[END_REF]. This two-step projection consists first in projecting a real 3D point P w to a point P s from the center of the sphere O c (Fig 1). The second step projects point P s to point P i in the image plane from a specific point O p . In order to apply the equivalence, it is necessary to know the intrinsic parameters of the camera and two additional parameters namely ξ and ϕ which are respectively equal to distances |O c O p | and |O c O i |. Parameters ξ and ϕ define the shape of the mirror and can be estimated by calibration [START_REF] Barreto | Geometric properties of central catadioptric line images and their application in calibration[END_REF]. When a scene contains a very low luminosity, the images acquired by standard cameras are almost black because these cameras are based on visible light. To solve this problem, infrared cameras have been developed. They are based on infrared (IR) radiation which is an electromagnetic radiation of a wavelength longer than that of visible light, i.e. IR rays cannot be seen by humans. The interesting property is that objects emit IR radiations depending on their temperature and the composition of their material, independently of the luminosity in the scene. Therefore, even in completely dark situations, the radiation of objects can be detected and we can visualize the difference of IR radiations among objects.

The difficulty of developing an infrared catadioptric camera is that the catadioptric mirror must correctly reflect the IR rays of the scene objects. Indeed, if this requirement is not fulfilled, then the IR image will mainly correspond to the IR rays emitted only from the mirror, instead of those from the scene objects. As a consequence, the acquired image will be quasi homogeneous and the scene objects cannot be perceived in the image. The solution of this problem consists in coating the mirror with an IR-reflective layer so that the IR rays can be correctly reflected by the mirror and then captured by the IR camera. Indeed, mirror surfaces can be overcoated both to retard degradation of the surface and to increase their reflectivity in parts of the spectrum where they will be used, i.e. infrared spectrum for our specific application. An important property of the socalled hot mirror is that they are transmissive to visible light but reflective to infrared light. In a manufacturing point of view, it consists of a thin-film decomposition method for which common techniques exist (vapor deposition, beam deposition, etc...).

Compared to traditional IR cameras, catadioptric infrared systems could cover a much larger part of the scene. They could usually permit to observe at 360 degrees in the horizontal plane and around 180 degrees in the vertical plane. If one wants to cover the same field of view with a network of several traditional IR cameras, it will be both much more expensive and inconvenient (synchronization, weight, price, etc...).

IV. SKYLINE EXTRACTION

A. Perspective IR images

In [START_REF] Logothetis | Shape representation in the inferior temporal cortex of monkeys[END_REF], neuroscientists discovered that information contained in an image (color, texture, shape, etc...) is first analyzed by distinct neurons and then integrated into one object. These two steps are respectively called the attention and the binding processes. Figure 2 depicts a typical example of an IR image obtained by a traditional perspective IR camera. It can be noticed that the skyline is a strong edge boundary which separates the sky and mountain regions. To extract the skyline, the human visual system focuses on two elements (edgeness and homogeneity) during the attention process and then gather information during binding process. Therefore based on this biological evidence of the human vision system, we defined in [START_REF] Woo | Robust horizon and peak extraction for vision-based navigation[END_REF] the energy of a pixel (x, y) as:

E(x, y) = α 1 |∇G σ * I(x, y)| + α 2 D(x, y) H (1)
This energy corresponds to the binding process and is composed of two terms. The first one corresponds to edgeness: the magnitude of the convolution between edge operator G σ (in horizontal and vertical directions and where σ is the standard deviation of the Gaussian distribution) and the image I at pixel (x, y). The second term represents the homogeneity. For perspective images, it was computed by the number D(x, y) of pixels of similar intensity in the upper and lower directions, where upper and lower regions must have different mean intensities (to represent sky and mountain regions). This distance D(x, y) is then normalized by the image height H. α 1 and α 2 correspond to the weights associated to the edgeness and homogeneity terms. If a pixel has a high energy, then it is considered a strong candidate pixel on the skyline.

Finally, the skyline is extracted by finding the path whose total energy is maximum. This energy maximization problem can be solved efficiently by dynamic programming [START_REF] Amini | Using dynamic programming for solving variational problems in vision[END_REF]. Dynamic programming (DP) is a method used to optimize some problems containing optimal substructure, such as finding the best path between two nodes in a graph. Optimal substructure means that optimal solutions of subproblems can be used to find the optimal solution of the overall problem. DP is usually composed of 3 main steps: initialization, scoring and back-tracing. In the application of finding the best skyline in traditional IR images, the initialization step creates a matrix Q whose size is H × W where H and W respectively correspond to the image height and width. Once the energy E(x, y) of every pixel is computed using eq (1), the scoring step fills in a matrix Q such that Q(x, y) is the highest energy to reach the pixel P = (x, y) from any point on the first column (i.e. x = 1). For our application, the scoring can be performed recursively as followed:

Q(x, y) =    E(x, y) if x = 1 min(Q(x -1, y -1), Q(x -1, y), Q(x -1, y + 1)) +E(x, y) otherwise
(2) Note that this recursive form is in forward direction, in the sense that the image is scanned by increasing the x value. The third and final step of DP finds the path that maximizes the total energy by tracing backward the matrix Q. This can be done easily by using a predecessor array that saves where the best path come from in the recursive algorithm of eq [START_REF]Camera pose estimation by alignment from a single mountain image[END_REF]. Thus, in our application, we can obtain the path that most probably corresponds to the skyline. It is worthwhile noting that if wide occlusion occurs (e.g. at low altitude in urban environment, a large building might occlude the skyline), then obviously the true skyline cannot be recovered, but the DP will still extract the path that has the highest energy, even if some parts of the path might not correspond to the true skyline.

B. Extension of Dynamic Programming for Catadioptric IR Images

Unfortunately it is not possible to apply this skyline extraction algorithm directly in catadioptric images. For example, in the perspective case, we simply apply the dynamic programming technique column-wisely but obviously, this is not valid for catadioptric images. Moreover the notion of neighborhood is different in catadioptric images due to the mirror distortion. The basic solution would be to unwarp the catadioptric image into a panoramic image and then apply an existing skyline extraction method. However this approach suffers from some limitations. Because of interpolation, the unwarping process is very time consuming and also introduces extra noise into the image. Moreover on the rectified image, there still exist underlying distortions. That is why we propose to redefine dynamic programming for catadioptric images. First of all, DP strongly relies on the notion of neighborhood. For example, in eq (2), we check the energy of the pixels (x , y ) that are in the neighborhood of the current pixel (x, y) and whose horizontal coordinate is smaller than the one of the current pixel (i.e. forward direction: x < x). The neighborhood was simply defined as the 3 × 3 square centered on the current pixel. However, because of the distortions inherent to the mirror, this neighborhood definition is not valid in catadioptric images and has to be modified. Intuitively, the size of the neighborhood of a pixel in a catadioptric image depends on the position of this pixel in the image: if it lies at the center of the image, the neighborhood is smaller than if it lies at the image boundary. Thus it is complicated to work with neighborhoods in catadioptric images. In order to deal with neighborhoods more easily and define the dynamic programming technique in catadioptric images, we propose working in the equivalent sphere space rather than on the 2D image. The sphere space greatly simplifies the formalism to take into account the distortions due to the mirror. Each point P i = (x, y) in the image plane I 2 can be projected onto the equivalent sphere S 2 at P s = (θ, φ, r), where θ ∈ [-π; π] (azimuth angle), φ ∈ [-π/2; π/2] (elevation angle) and the radius r = 1. In sphere space, the distance between two points can be simply measured using the geodesic length. Concretely, the angular distance between two spherical points P 1 s and P 2 s is calculated by acos(P 1 s • P 2 s ). We note Λ() the function that projects an image point into the sphere, i.e. P s = Λ(P i ).

In [START_REF] Demonceaux | Markov random fields for catadioptric image processing[END_REF], we proposed to define the spherical neighborhood N s (P s ) of a spherical point P s = (θ, φ, 1) as:

N s (P s ) =        P s = (θ , φ , 1) ∈ S 2 such that P s = P s and |φ -φ | ≤ φ thresh and min(|θ -θ |, 2π -|θ -θ |) ≤ θ thresh (3)
In plain English, the neighborhood N s (P s ) is the set of spherical points contained in a patch centered at P s and whose lengths along θ and φ directions are respectively θ thresh and φ thresh . As in [START_REF] Demonceaux | Markov random fields for catadioptric image processing[END_REF], the neighborhood N i (P i ) of a point P i in the image plane I 2 is obtained by projecting the neighborhood of its spherical point onto the image plane:

N i (P i ) = {P i ∈ I 2 /Λ(P i ) ∈ N (Λ(P i ))} (4)
For notation, the subscripts of N i and N s are used to emphasize that N i and N s respectively corresponds to the neighborhoods in the image plane and the sphere space. Using spherical coordinates, an intuitive extension of the forward direction (i.e. x < x) for catadioptric images can simply be θ < θ, which we refer as the θ forward direction. Therefore, given a point P i , we note N i (P i ) the set of image points that correspond to the neighborhood predecessors of P i in the θ forward direction. Mathematically, we can define it as:

N i (P i ) =        P i ∈ I 2 such that P s ∈ N (P s ) and θ < θ where P s = Λ(P i ) = (θ, φ, 1) and P s = Λ(P i ) = (θ , φ , 1) (5)
Now that we can correctly scan the catadioptric image with an adapted neighborhood and an appropriate forward direction, we can finally apply the equivalent of the recursive function [START_REF]Camera pose estimation by alignment from a single mountain image[END_REF] to compute the best path to reach any point P i :

Q(P i ) = E(P i ) if Λ(P i ) = (-π, φ, 1) min P i ∈ N i (P i ) Q(P i ) + E(P i ) otherwise (6)

C. Implementation Issues of Dynamic Programming

As previously explained, we implement the dynamic programming for catadioptric images in the θ forward direction. Let suppose that the scoring matrix Q has been filled in up to a particular θ, i.e. all the pixels whose spherical projection (θ, φ, r) is such that θ ≤ θ have been scanned. To continue filling in the score matrix, two tasks must be performed. First, we need to scan the pixels that are near the previously scanned pixels and in the forward direction (in perspective case, it corresponds to the points in the next column). Mathematically, this is the set of pixels P i where Λ(P i ) = (θ , φ , 1) is such that θ > θ (forward direction) and θ -θ < θ thresh (continuity). The second task consists in getting the predecessors of these pixels in order to apply the recursive algorithm of eq [START_REF] Chang | Omni-directional visual servoing for humanrobot interaction[END_REF].

At each iteration, θ is increased by θ thresh (in perspective case, it corresponds to the next column, i.e. x = x+1). Thus at the i th iteration, the θ angles of the current spherical points belong to the interval [-π + (i -1)θ thresh : -π + iθ thresh ]. As this θ interval is determined in advance, an efficient implementation for the first task consists in sorting the spherical points with respect to their θ angles, which permits to access the spherical points belonging to some bounded θ intervals and their 2D image coordinates very easily, and then save the results in a LookUpTable in pre-processing.

Therefore, at any iteration, we can calculate the current θ interval and obtain the list of the pixels belonging to this θ interval instantaneously.

For the second task, we want to quickly obtain the neighborhood predecessors N i (P i ) of any point P i . A basic but efficient solution is to build a second LookUpTable which contains the list of predecessors for every point P i . However some predecessors of a given point P i might lie in the same θ interval than P i (cf Fig 3). This is an important problem. Indeed, in this case, the path length (i.e. the number of pixels) to go from a θ interval to another is not fixed. If a path is longer, its energy is likely to be higher since more energies will be summed up and as a consequence, DP might extract long paths that do not correspond to the expected skyline. Therefore these predecessors must not be used when computing the path score. To simply solve this problem, in our implementation, we have simply removed the points of N (P i ) that lie in the same θ interval than the current pixel and save the results in a LookUpTable in preprocessing. In (b), given a current pixel P i (drawn in red), we can get its predecessors N i (P i ) (drawn in orange) but some of them might lie in the same θ interval than the current pixel P i .

The way of splitting the sphere into fixed θ intervals can also be used to define some upper and lower directions. Each θ interval can be considered as a vertical slice, as depicted in Fig 4 . The upper and lower directions can be scanned by increasing and decreasing the φ angle respectively in a particular vertical slice. Thus we are also able to redefine the homogeneity term of eq (1) which can be calculated by Algorithm 1. Starting from a point P in the image, we scan the pixels belonging to the same θ range that P in upper and lower directions until the pixel intensity differs significantly from the intensity of P . Then, we compute the mean intensities of the two upper and lower regions and we measure how different the mean intensities are.

Algorithm 1 distance=FnComputeHomogeneity(P ) // P = (x, y) : point in the 2D image I // L θr : list of pixels belonging to the theta range θ r and sorted with respect to φ angle in ascending order θ r = F nGetT hetaRange(P ) k ori = F nGetIndex(P, L) // get the index of P in list L φ ori = F nGetP hi(P ) // get the φ angle of P // similarity in upper direction 4. By dividing the range of the θ angles into several intervals, we can obtain some vertical slices in the equivalent 3D sphere (left) and the associated 2D image (right). For a better visualization, the θ range has been split into 100 intervals only.

k = k ori repeat k = k + 1 until P = L θr (k) such that |I(P ) -I(P )| > T hresh 1 dist up = (k -1) -k ori V alue up = k-1 k =k ori I(L θr (k )) // similarity in lower direction k = k ori repeat k = k -1 until P = L θ r (k) such that |I(P ) -I(P )| > T hresh 1 dist down = k ori -(k + 1) V alue down = k ori k =k+1 I(L θ r (k )) // homogeneity if V alueup dist up -V alue down dist down > T hresh 2 then distance = dist up + dist down else distance = 0 end if Fig.

V. EXPERIMENTAL RESULTS

A. Synthesizing Catadioptric IR Images

To date, IR-reflective catadioptric mirrors are not commercially available yet. Thus it is impossible for us to purchase this equipment. Nevertheless, in order to show the validity of our approach, we performed two important tasks. First of all, to demonstrate the properties of IR-reflective mirror, we have combined an infrared camera with a planar IR-reflective mirror. We placed some objects in front of the mirror and pointed the IR camera towards the mirror. As expected, the IR camera was able to correctly visualize the reflection of the object on the IR-reflective mirror despite the complete darkness in the room.

In the second task, we decided to synthesize some catadioptric IR images in order to demonstrate the validity of our skyline extraction and our adapted dynamic programming. An approach to generate some synthesized catadioptric IR images would be to construct a virtual world and assign a material composition and a temperature value to each object of the world [28][29]. However the development would take a very long time and require deep knowledge in graphics and physics. That is why we preferred exploring another approach. Our idea consists in building a catadioptric IR image from a real perspective IR image. For this, we propose an algorithm composed of 5 main steps.

B. Skyline Extraction

This section presents some experimental results of skyline extraction in catadioptric infrared images. To obtain a dense grid of the catadioptric image (i.e. make the θ intervals thinner), we split the ranges of the θ angles into 500 intervals. We set the weights α 1 and α 2 of eq (1) both to 1 (equal weight). Figure 6 represents the distribution of the strong skyline candidates, i.e. whose energy is higher than a threshold µ = 1.05 in our experiments. Figure 7 depicts the final result of skyline extraction obtained by our adaptation of the dynamic programming. Figure 8 shows extra results obtained for another acquisition. To show that our method also works when the skyline is not entirely visible, we synthesized some camera rotation so that the skyline is partially occluded and we manually fixed the limits of the θ angle. Results are

VI. CONCLUSION

In this paper, we aimed to extract the skyline in catadioptric infrared images. The skyline can provide important information for aerial robotic applications. For example, the DEM-based methods can match the skyline with a Digital Elevation Map (DEM) by process of registration and then estimate the orientation/position of the camera. In order to overcome the limitations of traditional vision systems (narrow field of view, daytime, etc...), we have proposed using a catadioptric infrared camera. It permits to observe the scene independently of the luminosity conditions and acquire a large amount of information thanks to the wide field of view provided by the catadioptric mirror. For example, it is possible to observe a much larger part of the skyline, in any luminosity situations, which could improve the registration with a DEM. In this paper, we have extended our previous method of skyline detection towards catadioptric infrared images and experimental results have demonstrated the validity of our approach. The major contribution of this paper is the redefinition of the dynamic programming technique for catadioptric images using an adapted neighborhood and an appropriate θ forward direction. In this paper, dynamic programming was used for skyline detection and it could be applied for other purposes like image restoration [START_REF] Gong | Images restoration using an iterative dynamic programming approach[END_REF], shape retrieval [START_REF] Milios | Shape retrieval based on dynamic programming[END_REF] or image matching [START_REF] Quenot | Image matching using dynamic programming: Application to stereovision and image interpolation[END_REF] for example. Since catadioptric IR-reflective mirrors are not commercially available, we have also presented an interesting method to generate a catadioptric IR image from a real perspective IR image. The proposed method is easy to develop and by construction, it verifies the physical properties of an IR camera and the geometrical properties of a catadioptric camera. This is very useful for fast prototyping when cost and time constraints are important issues.

In future work, we plan to focus on sphere discretization, especially by applying different discretization steps in a dynamic manner. This would permit to focus attention in more interesting areas of the sphere/image and also obtain a faster algorithm.

VII. ACKNOWLEDGMENTS

This work has been performed within (1) the STAR project of the Hubert Curien (Egide) partnership between RCV Lab at KAIST-Korea and MIS at UPJV-France and (2) the project "Monocular vision based natural feature

Fig. 1 .

 1 Fig. 1. Equivalence between the catadioptric projection and the two-step mapping via the sphere

Fig. 2 .

 2 Fig. 2. Typical example of an IR image obtained by a traditional perspective IR camera.

Fig. 3 .

 3 Fig. 3. Scanning in the θ forward direction. For an easier interpretation, the deformed grid (θ, φ) of a catadioptric image is represented as a uniform and orthogonal grid. In (a), the image is split along θ into 2 regions: one where θ ∈ [θ -θ thresh : θ] (in blue) and one where θ ∈ [θ : θ + θ thresh ].In (b), given a current pixel P i (drawn in red), we can get its predecessors N i (P i ) (drawn in orange) but some of them might lie in the same θ interval than the current pixel P i .

  Fig 5 depicts the whole process and the final result. Some extra results are also presented in Fig 8. This approach provides two key advantages: first, it is simple to develop and second, it verifies not only the physical properties of a real IR camera (since we are working on a real IR image) but also the geometrical properties of a catadioptric camera (since we used a central catadioptric projection model with synthesized calibration parameters).

Fig. 5 .

 5 Fig. 5. The five steps to synthesize a catadioptric IR image from a real perspective IR image. Step1: get a real perspective IR image (a), step2: build a panoramic image by repeating the original image (b), step3: convert to a cylindrical representation (c), step4: project into the equivalent sphere (d), step5: project on the 2D image plane (e).

Fig. 6 .Fig. 7 .

 67 Fig. 6. Distribution of horixels

Fig. 8 .

 8 Fig. 8. Results of skyline extraction for an other acquisition: real perspective IR image (a), synthesized panoramic image (b), synthesized catadioptric image and skyline extraction (c).

Fig. 9 .

 9 Fig. 9. Skyline extraction when the skyline is not entirely visible due to high camera rotation.


Laurent Busé

Martín Carlos D'andrea

Martin Sombra
email: sombra@ub.edu

Weimann
email: weimann@unicaen.fr

Carlos D'andrea
email: cdandrea@ub.edu

Martín Sombra

Martin Weimann

The geometry of the flex locus of a hypersurface

Keywords: Mathematics Subject Classification. Primary 14J70; Secondary 13P15 Hypersurfaces, flex locus, multivariate resultants

ou non, émanant des établissements d'enseignement et de recherche français ou étrangers, des laboratoires publics ou privés.

Introduction

A point of a projective variety is a flex point if there is a line with order of contact with the variety at this point higher than expected. It is a generalization of the notion of inflexion point of a curve. The study of the flex locus of curves and surfaces is a classical subject of geometry from the XIXth century, treated by Monge, Salmon and Cayley, among others. Currently, there is an increasing interest in this object in low dimensions, mainly due to its applications in incidence geometry [START_REF] Tao | The Monge-Cayley-Salmon theorem via classical differential geometry[END_REF][START_REF] Katz | The flecnode polynomial: a central object in incidence geometry[END_REF][START_REF] Guth | On the Erdös distinct distances problem in the plane[END_REF][START_REF] Kollár | Szemerédi-Trotter-type theorems in dimension 3[END_REF][START_REF] Eisenbud | 3264 and all that-a second course in algebraic geometry[END_REF][START_REF] Sharir | Incidences between points and lines on two-and threedimensional varieties[END_REF].

In this text, we study the geometry of the flex locus of a hypersurface of a projective space of arbitrary dimension. Before explaining our results, we introduce some notation and summarize the previous. Let K be an algebraically closed field of characteristic zero, P n the projective space over K of dimension n ≥ 1, and V a hypersurface of P n of degree d ≥ 1. A point p ∈ V is a flex point if there is a line with order of contact at least n + 1 with the hypersurface V at the point p, and any such line is called a flex line (Definition 3.3). The flex locus of V is the set of all the flex points of V .

An important result in this context is the so-called Monge-Salmon-Cayley theorem for surfaces in P 3 , see for instance [START_REF] Tao | The Monge-Cayley-Salmon theorem via classical differential geometry[END_REF][START_REF] Kollár | Szemerédi-Trotter-type theorems in dimension 3[END_REF], generalized by Landsberg to the higher dimensional case [Lan99, Theorem 3]. It states that if the hypersurface V is irreducible, then it is ruled if and only if all of its points are flexes.

A hypersurface of degree less than n is necessarily ruled (Proposition 3.6) and its flex locus is the whole hypersurface. Hence, one restricts the study of the flex locus to the case d ≥ n.

For a plane curve C ⊂ P 2 of degree d ≥ 2, a point p ∈ C is an inflexion point if and only if the determinant of the Hessian matrix of the defining polynomial of C vanishes at p. This implies that the flex locus of C is defined by a polynomial of degree 3d -6. Hence if C contains no line, then it has at most 3d 2 -6d inflexion points, by Bézout theorem.

For a surface S ⊂ P 3 of degree d ≥ 3, an old result of Salmon states that there is a homogeneous polynomial in K[x 0 , x 1 , x 2 , x 3 ] of degree 11d -24 defining its flex locus [Sal65, Article 588, pages 277-278], see also [START_REF] Eisenbud | 3264 and all that-a second course in algebraic geometry[END_REF]§11.2.1]. If S has no ruled component, then this result together with the Monge-Salmon-Cayley theorem and Bézout's theorem imply that the flex locus is a curve of S of degree at most 11d 2 -24d.

We first address the problem of computing the dimension, and the degree of both the defining equations and the flex locus. Let x = {x 0 , . . . , x n } be a set of n + 1 variables and f V ∈ K[x] a squarefree homogeneous polynomial defining V . Let t be another variable and y = {y 0 , . . . , y n } a further set of n+1 variables. Then we consider the family of bihomogeneous polynomials f V,k , k = 0, . . . , d, in K[x, y] determined by the expansion

f V (x + ty) = d k=0 f V,k (x, y) t k k! .
Our first main result gives an equation for the flex locus of V in terms of multivariate resultants.

Theorem 1.1. There is a homogeneous polynomial ρ

V ∈ K[x] with deg(ρ V ) = d n k=1 n! k -(n + 1)!
defining the flex locus of V . It is uniquely determined modulo f V by the condition

Res y (f V,1 (x, y), . . . , f V,n (x, y), (y)) ≡ n! ρ V mod f V , for any linear form ∈ K[x],
where Res y denotes the resultant of n + 1 homogeneous polynomials in the variables y.

This result recovers the previous degree computations for the polynomial defining the flex locus of a plane curve or of a surface in P 3 . It also allows us to give a scheme structure to the flex locus: we define the flex scheme Flex(V ) as the subscheme of P n defined by the homogeneous polynomials f V and ρ V (Definition 3.11). This scheme does not depend on the choice f V , unique up to a nonzero scalar factor, nor on that of ρ V , unique modulo f V . Thus, the flex locus of V is the reduced scheme associated to Flex(V ).

Giving a closed form for a canonical representative for ρ V modulo f V seems to be a challenge on its own. In the case of curves, such a representative is given by the determinant of the Hessian matrix of f V (Example 3.12). For n = 3, Salmon also obtained a representative of this polynomial as a determinantal closed formula in terms of covariants, based on an approach by Clebsch [Sal65, Articles 589 to 597]. It would be interesting to generalize these formulae to higher dimensions.

The next corollary is a direct consequence of Theorem 1.1 and Landsberg's theorem generalizing the Monge-Salmon Cayley theorem [Lan99, Theorem 3].

Corollary 1.2. If V has no ruled irreducible components, then Flex(V ) is a complete intersection subscheme of P n of dimension n -2 and of degree

deg(Flex(V )) = d 2 n k=1 n! k -d (n + 1)!.
In particular, the flex locus of V is set-theoretically defined by equations of degree at most max(d, d n k=1 n! k -(n + 1)!), and its degree, as an algebraic set, is at most

d 2 n k=1 n! k -d(n + 1)!.
Set L V for the union of lines contained in V . When d = n, a flex line of V at a point p ∈ V has order of contact at least n + 1 at this point, and so it is necessarily contained in V by Bézout theorem. Hence in this case, L V coincides with the flex locus of V .

Corollary 1.3. Let V be a hypersurface of P n of degree n without ruled irreducible component. Then L V is a ruled subvariety of V of dimension n -2 and of degree at most

n 3 (n -1)! n-1 k=2 1 k .
Our second main result ensures that the bound for the degree of the flex locus is sharp, and that other expected properties hold true in the generic case.

Theorem 1.4. Let V be a generic hypersurface of P n of degree d ≥ n. Then

(1) Flex(V ) is a reduced subscheme (that is, a subvariety) of V of dimension n -2;

(2) for a generic flex point p of V , there is a unique flex line passing through it.

If d = n, then this line is contained in V , whereas if d > n, then its order of contact with V at p is exactly n + 1.

For a cubic surface S in P 3 , Salmon's degree bound is 11 • 3 -24 = 9. If S is smooth, it contains 27 lines and their union is the complete intersection of S with a surface of degree 9. The next result gives an analogous result for generic hypersurfaces of P n of degree n. It is a direct consequence of Theorem 1.4 and Corollary 1.3.

Corollary 1.5. Let V be a generic hypersurface of P n of degree n. Then L V is a ruled subvariety of V of dimension n -2 of degree equal to

n 3 (n -1)! n-1 k=2 1 k , complete intersection of V with a hypersurface of degree n 2 (n -1)! n-1 k=2 1 k .
Salmon's theorem for surfaces has been revisited several times. In particular, in the recent book [START_REF] Eisenbud | 3264 and all that-a second course in algebraic geometry[END_REF], the authors reprove it by performing suitable computations in the Chow ring of a Grassmaniann.

Our proof of this result and of the general version in Theorem 1.1 is elementary, and closer to Salmon's approach [Sal65, Articles 473 and 588, pages 94-95 and 277-278], see Remark 3.13. It proceeds by identifying lines with points of P n × P n outside the diagonal. Although this seems less natural from the point of view of intersection theory, it nevertheless allows us to find explicit equations for the flex locus using resultants. The proof of Theorem 1.4 is also elementary and based on the properties of resultants.

The paper is organized in the following way. In Section 2 we review the definition and properties of multidimensional resultants that will be used in the sequel. The proof of Theorem 1.1 is given in Section 3, whereas in Section 4 and Section 5 we show that the flex subscheme is generically reduced and that the generic flex line is unique and has the expected order of contact, thus proving Theorem 1.4.

Acknowledgements. We thank Marc Chardin, Martí Lahoz, Juan Carlos Naranjo and Patrice Philippon for helpful discussions. Part of this work was done while the authors met at the Universitat de Barcelona, the Université de Nice -Sophia Antipolis and the Université de Caen. We thank these institutions for their hospitality.

Busé and Weimann were partially supported by the CNRS research project PICS 6381 "Diophantine geometry and computer algebra". D'Andrea and Sombra were partially supported by the MINECO research project MTM2015-65361-P, and by the "María de Maeztu" program for units of excellence in R&D MDM-2014-0445.

Preliminaries on resultants

The resultant of a family of homogeneous multivariate polynomials plays a central role throughout this text. Therefore, in this section we briefly review this notion and some of its basic properties. We refer to [START_REF] Cox | Using algebraic geometry[END_REF][START_REF]Le formalisme du résultant[END_REF][START_REF] Gelfand | Discriminants, resultants, and multidimensional determinants[END_REF] for the proofs and more details.

We denote by N the set of nonnegative integers and by K an algebraically closed field of characteristic zero. Boldface symbols indicate finite sets or sequences, where the type and number should be clear from the context. For instance, for n ∈ N we denote by y the set of variables {y 0 , . . . , y n }, so that

K[y] = K[y 0 , . . . , y n ]. Let d = (d 0 , . . . , d n ) ∈ N n+1
. For i = 0, . . . , n, we consider the general homogeneous polynomial of degree d i in the variables y given by

F i = |a|=d i c i,a y a ,
the sum being over the vectors of a = (a 0 , . . . , a n ) ∈ N n+1 of length |a| = n j=0 a j = d i , and where each c i,a is a variable and y a stands for the monomial n j=0 y

a j j . For each i, set c i = {c i,a | a ∈ N n+1 , |a| = d i } for the set of d i +n
n variables corresponding to the coefficients of F i , and A = Z[c 0 , . . . , c n ] for the universal ring of coefficients. As usual, given P ∈ A and a system of homogeneous polynomials g i ∈ K[y] of degree d i , i = 0, . . . , n, we write P (g 0 , . . . , g n ) ∈ K for the evaluation of P in the coefficients of the g i 's.

Denote by I and by m the ideals of A[y] respectively defined by F 0 , . . . , F n and by y 0 , . . . , y n . The elimination ideal of the system F = (F 0 , . . . , F n ) is the ideal of A defined by

E d = {P ∈ A | ∃k ∈ N with P m k ⊂ I}.
It is a principal ideal, and the resultant of F , denoted by Res d , is defined as its unique generator satisfying the additional condition

Res d (y d 0 0 , . . . , y dn n ) = 1. It is an irreducible polynomial in the ring A that is homogeneous of degree j =i d j in each set of variables c i , i = 0, . . . , n.
The resultant also verifies the following formula for the descent of dimension [Jou91, Lemme 4.8.9 and §5.7].

Proposition 2.1. With notation as above,

Res (d 0 ,...,d n-1 ,dn) (F 0 , . . . , F n-1 , y dn n ) = Res dn (d 0 ,...,d n-1 ) ,
where Res (d 0 ,...,d n-1 ) denotes the resultant of n general homogeneous polynomials in A[y 0 , . . . , y n-1 ] of respective degrees d 0 , . . . , d n-1 .

The resultant satisfies the Poisson formula that we state below, see [Jou91, Proposition 2.7] or [CLO05, Theorem 3.4, Chapter 3] for its proof.

Proposition 2.2. Let g 0 , g 0 ∈ K[y] be homogeneous polynomials of degree d 0 , and g 1 , . . . , g n ∈ K[y] homogeneous polynomials of respective degrees d 1 , . . . , d n with a finite number of common zeros in P n . For each such common zero η ∈ P n , let m η denote its multiplicity. Then

Res d (g 0 , g 1 , . . . , g n ) η g 0 (η) mη = Res d (g 0 , g 1 , . . . , g n ) η g 0 (η) mη ,
both products being over the set of common zeros of g 1 , . . . , g n in P n .

A fundamental property of resultants is that their vanishing characterizes the systems of n + 1 homogeneous polynomials in n + 1 variables that are degenerate, in the sense that their zero set in P n is nonempty. Precisely, a system of homogeneous polynomials g 0 , . . . , g n ∈ K[y] of respective degrees d 0 , . . . , d n , has a common zero in P n if and only if Res d (g 0 , . . . , , g n ) = 0.

The following result gives a criterion to decide if a such degenerate system has a unique zero and, if it does, allows to compute it, see [Jou91, Lemma 4.6.1] or [JKSS04, Corollary 4.7] for its proof.

Proposition 2.3. Let g 0 , . . . , g n ∈ K[y] be homogeneous polynomials of respective degrees d 0 , . . . , d n . Suppose that Res d (g 0 , . . . , , g n ) = 0 and that there is

0 ≤ i 0 ≤ n and a 0 ∈ N n+1 with |a 0 | = d i 0 such that ∂ Res d ∂c i 0 ,a 0 (g 0 , . . . , , g n ) = 0.
Then the zero set of g 0 , . . . , g n in P n consists of a single point η, and for i = 0, . . . , n, there is an equality of projective points

(η a ) |a|=d i = ∂ Res d ∂c i,a (g 0 , . . . , , g n ) |a|=d i ∈ P ( d i +n n ) .

The equation of the flex locus

In this section, we obtain an explicit equation for the flex locus of a projective hypersurface by means of resultants. Using this equation, we define the flex scheme and we compute its dimension, the degree of its defining equations and its degree, thus giving the proof of Theorem 1.1. Definition 3.1. Let V be a subvariety of P n and p a point V . For a line L of P n passing by p, its order of contact with V at p is defined as

ord p (V, L) = dim K (O L,p /ι * I V ),
where O L,p is the local ring of L at p, I V the ideal sheaf of V , and ι : L → P n the inclusion map.

The order of contact of a line is either a positive integer or +∞. We have that ord p (V, L) = 1 if and only if L intersects V transversally at p, and ord p (V, L) = +∞ if and only if L is contained in V .

For the rest of this section, we assume that V is a (non necessarily irreducible) hypersurface of degree d ≥ 1. Fix then a defining polynomial f V of V , that is, a homogeneous polynomial in K[x] = K[x 0 , . . . , x n ] of minimal degree such that V coincides with Z(f V ), the set of zeros of f V in P n . Such a polynomial is squarefree, and unique up to a nonzero scalar factor.

The next lemma translates the notion of order of contact with the hypersurface V into algebraic terms. Given a variable t, we denote by val t the t-adic valuation in the local ring

K[t] (0) O A 1 ,0 .
Lemma 3.2. Let p ∈ V and L a line of P n passing by p. Let ϕ : A 1 → P n be an affine map parameterizing a neighborhood of p in L, and such that ϕ(0) = p. Write ϕ = ( 0 , . . . , n ) with i ∈ K[t] an affine polynomial, i = 0, . . . , n. Then

ord p (V, L) = val t (f V ( 0 , . . . , n )).
Proof. Up to a reordering of the homogeneous coordinates of P n , we can suppose that

0 (0) = 0. Let f V denote the dehomogenization of f V in the chart (x 0 = 0) A n . Using the relation f V = x d 0 f V x 1 x 0 , . . . , x n
x 0 and the fact that val t ( 0 ) = 0, we obtain

val t (f V ( 0 , . . . , n )) = val t f V 1 0 , . . . , n 0 = ord p (V, L),
where the second equality follows from the definition of the order of contact, and the fact that f V is a local equation for the germ of hypersurface (V, p) and ϕ a parametrization of the germ of line (L, p). Definition 3.3. Let p ∈ V . The order of osculation of V at p is defined as

µ p (V ) = sup L ord p (V, L),
where the supremum is taken over the lines L of P n passing by p. The point p is a flex point of V whenever µ p (V ) ≥ n + 1. A line L with order of contact with V at p at least n + 1 is called a flex line.

Consider again the group of variables y = {y 0 , . . . , y n } and a further variable t, and let f V,k , k = 0, . . . , d, be the family of polynomials in K[x, y] determined by the expansion

(3.1) f V (x + ty) = d k=0 f V,k (x, y) t k k! . For k = 0, . . . , d, f V,k (x, y) = 0≤i 1 ,...,i k ≤n ∂ k f ∂x i 1 • • • ∂x i k (x) y i 1 • • • y i k .
In particular, f V,k is bihomogeneous of bidegree (d -k, k). For a point p ∈ P n and each k ∈ N, consider the subvariety of P n defined as

Z k p = {q ∈ P n | f V,1 (p, q) = • • • = f V,k (p, q) = 0}.
The next lemma shows that the order of osculation of V at p can be read from the dimensions of these subvarieties.

Lemma 3.4. Let p ∈ V .

(1) For each k ∈ N, the subvariety Z k p ⊂ P n is a cone centered at p, union of the lines having order of contact with V at p greater than k.

(2) The order of osculation of V at p is the least k ∈ N such that Z k p = {p}.

Proof. Fix k ∈ N and choose a representative p ∈ K n+1 \ {0} of the point p ∈ P n . We have that f V (p + tp) = (1 + t) d f V (p) and so, for all j ∈ N,

f V,j (p, p) = d(d -1) • • • (d -j)f V (p) = 0.
Hence p ∈ Z k p . Let q ∈ P n be a point different from p and L the line passing by p and q. This line is parametrized by the affine map ϕ : A 1 → P n defined by ϕ(t) = p + q t for any choice of representatives p, q ∈ K n+1 \ {0} of p and q. Lemma 3.2 combined with the expansion (3.1) implies that the condition q ∈ Z k p is equivalent to ord p (V, L) > k. Hence q lies in Z k p if and only if the line L is contained in this subvariety and has order of contact with V at p greater than k, which proves (1).

By definition, the order of osculation of V at p is the least k ∈ N such that there is no line L with ord p (V, L) > k. Hence (2) is a consequence of (1).

The following corollary follows directly from Lemma 3.4 and the definition of flex points.

Corollary 3.5. A point p ∈ V is a flex point if and only if Z n p = {p} or, equivalently, if and only if dim(Z n p ) ≥ 1. The next two statements are also consequences of Lemma 3.4. Proposition 3.6. Let p ∈ V . Then either n ≤ µ p (V ) ≤ d or there is a line passing by p that is contained in V . In particular, every hypersurface of degree at most n -1 is ruled.

Proof. For k ∈ N, the subvariety Z k p is defined by k equations. If this subvariety consists of the single point p, then this number of equations k has to be at least n, by Krull's Hauptidealsatz. Lemma 3.4(2) then gives the lower bound µ p (V ) ≥ n.

On the other hand, if k > d then Z k p = Z n p because f V,j = 0 for all j > d. Hence the Z k p 's form a sequence of subvarieties that is decreasing with respect to the inclusion, and constant for k ≥ d. By Lemma 3.4(2), if Z d p = {p} then µ p (V ) ≤ d. Else, by Lemma 3.4(1), each line contained in Z d p has an order of contact that is arbitrarily large. By Lemma 3.2, such a line is necessarily contained in V .

To conclude, we observe that the last statement is a direct consequence of the first one.

Proposition 3.7. Every singular point of V is a flex point.

Proof. A point p ∈ V is singular if and only if f V,1 (p, y) = 0. Hence Z n p is defined by n -1 equations. Since this subvariety contains p, it is nonempty and so, by Krull's Hauptidealsatz, its dimension is at least 1. By Corollary 3.5, this point is necessarily a flex.

For a homogeneous polynomial g ∈ K[x] of degree e ≥ 1, we set

(3.2) R V,g = Res y (1,...,n,e) (f V,1 (x, y), . . . , f V,n (x, y), g(y)) ∈ K[x],
where Res y (1,...,n,e) denotes the resultant of n + 1 homogeneous polynomials in the variables y of respective degrees 1, . . . , n, e. Proposition 3.8. Let g ∈ K[x] be a homogeneous polynomial of degree e ≥ 1. Then R V,g defines the flex locus of V in the open subset P n \ Z(g).

Proof. Let p ∈ V such that g(p) = 0. If R V,g (p) = 0 then Z(g) intersects Z n p , by the vanishing property of the resultant. Since p / ∈ Z(g), this implies that Z n p = {p}. By Corollary 3.5, p is a flex point. Conversely, suppose that p is a flex point. Since g is not a constant, Z(g) is a hypersurface and, by Corollary 3.5, dim(Z n p ) ≥ 1. Hence Z(g) does intersect Z n p and so R V,g (p) = 0, as stated. The polynomial R V,g gives an equation for the flex locus of V outside the hypersurface Z(g), but might vanish at points in Z(g) that are not flexes. The next result, corresponding to Theorem 1.1 in the introduction, shows that this equation can be replaced by another one defining the flex locus of V in the whole of the projective space.

Theorem 3.9. There exists a homogeneous polynomial ρ

V ∈ K[x] with deg(ρ V ) = d n k=1 n! k -(n + 1)!
defining the flex locus of V . It is uniquely determined modulo f V by the condition that, for any linear form ∈ K[x],

(3.3) R V, ≡ n! ρ V mod f V .
To prove it, we need the following auxiliary result.

Lemma 3.10. Let g, h ∈ K[x] be two homogeneous polynomials of the same positive degree. Then

h n! R V,g ≡ g n! R V,h mod f V .
Proof. Let p ∈ V and p ∈ K n+1 \ {0} a representative of this point. If p is not a flex, then Z n p = {p} by Corollary 3.5. By Bézout's theorem, the intersection multiplicity of f V,1 (p, y), . . . , f V,n (p, y) at p is n! and hence, by the Poisson formula (Proposition 2.2),

(3.4) h(p) n! R V,g (p) = g(p) n! R V,h (p).
On the other hand, if p is flex then Z n p has positive dimension, again by Corollary 3.5. This implies that the system f V,1 (p, y), . . . , f V,n (p, y), G(y) has a common zero and so R V,g (p) = 0 and, similarly R V,h (p) = 0. Hence (3.4) reduces to 0 = 0 in this case. Thus the equality (3.4) holds for every point of V , which implies the statement.

Proof of Theorem 3.9. Let u = {u 0 , . . . , u n } and v = {v 0 , . . . , v n } be two sets of n + 1 variables and consider the linear forms

u = n i=0 u i x i and v = n i=0 v i x i .
By Lemma 3.10, for every choice of α, β

∈ K n+1 \ {0}, R V, α(x) β (x) n! ≡ R F, β (x) α (x) n! mod f V .
We deduce that there is a trihomogeneous polynomial s ∈ K[u, v, x] such that

(3.5) R V, u n! v -R V, v n! u + sf V = 0. The polynomials n! u , n! v , F form a regular sequence in K[u, v, x],
and hence the syzygy (3.5) is necessarily a Koszul syzygy. Hence there are trihomogeneous polynomials

ρ V , σ ∈ K[u, v, x] such that R V, u = n! u ρ V + f V σ. Since deg u (R V, u ) = n! and deg v (R V, u ) = 0, we deduce that ρ V ∈ K[x].
The equality (3.3) is obtained by specializing the variables u into the coefficients of the linear form .

By this equality (3.3) and Proposition 3.8, ρ V defines the flex locus of V in the open subset P n \ Z( ). Varying , we deduce that ρ V defines the flex locus in the whole of V .

The resultant Res y (1,...,n,1) is a multihomogeneous polynomial and, for i = 0, . . . , n -1, its degree in the set of variables c i corresponding to the coefficients of the ith polynomial is n!/(i + 1). Hence

deg x (R V, ) = n-1 i=0 deg x (f V,i+1 ) deg c i Res y (1,...,n,1) = n k=1 (d -k) n! k = d n k=1 n! k -n • n! Hence deg x (ρ V ) = deg x (R V, ) -n! = d n k=1 n!
k -(n + 1)!, as stated. The uniqueness of the polynomial ρ V satisfying (3.3) follows by considering any linear form that is not a zero divisor modulo f V , completing the proof.

Definition 3.11. The flex scheme of V , denoted by Flex(V ), is the subscheme of P n defined by the homogeneous polynomials f V and ρ V . This scheme does not depend on the choice of f V , unique up to a nonzero scalar factor, nor on that of ρ V , unique modulo f V . By Theorem 3.9, its support | Flex(V )|, that is, its set of closed points, coincides with the flex locus of V .

Example 3.12. Let C be a plane curve of degree d ≥ 2, and f C ∈ K[x 0 , x 1 , x 2 ] its defining polynomial. A computation using the Euler identities shows that, for any linear form ,

(3.6) -(d -1) 2 Res y (1,2,1) (f C,1 (x, y), f C,2 (x, y), (y)) ≡ 2 det(H(f C )) mod f C
, where H(f C ) stands for the Hessian matrix of f C . Thus we recover from Theorem 3.9 the well-known fact that a point p ∈ C is an inflexion point if and only the determinant of the Hessian matrix of f C vanishes at p, see for instance [BK86, §7.3, Theorem 1].

For a surface S in P 3 , Theorem 3.9 shows that the flex locus of S is defined by an equation of degree

deg(ρ S ) = d 3 k=1 3! k -(3 + 1)! = 11d -24,
recovering the result of Salmon.

Remark 3.13. In the book [START_REF] Salmon | A treatise on the analytic geometry of three dimensions[END_REF], Salmon studied the flex locus of the surface S by means of elimination theory. His Article 473 in pages 94-95 of loc. cit. gives a general method to compute, for three surfaces depending on parameters and satisfying a certain intersection theoretic condition, the degree of the condition so that these surfaces contain a common line. His Article 588 in pages 277-278 of loc. cit. applies this degree computation to the three surfaces that arise in the study of the flex locus.

In our notation, these three surfaces are those defining the variety Z 3 p for a point p ∈ S.

The flex subscheme of a generic hypersurface

In this section, we show that for a generic hypersurface of P n of degree d ≥ n, the bounds for the flex locus in Corollary 1.2 are sharp, or equivalently that the flex scheme is reduced, and hence that it is equal to the flex locus. The next result corresponds to Theorem 1.4(1) in the introduction. The polynomials F k ∈ K[c, x, y], k = 0, . . . , d, are determined by the expansion (4.1)

F (x + ty) = d k=0 F k (x, y) t k k! .
Following (3.2), for a linear form ∈ K[x] we set R F, := R Z(F ), = Res y 1,...,n,1 (F 1 (x, y), . . . , F n (x, y), (y)). It is a bihomogeneous polynomial in K[c, x] with bidegree given by (4.2)

deg c (R F, ) = n k=1 n! k and deg x (R F, ) = d n k=1 n! k -n • n!.
We first prove the existence of a universal polynomial Φ d in K[c, x] with the property that, for any hypersurface V of P n of degree d, its flex polynomial ρ V can be obtained as the evaluation of Φ d at the coefficients of a defining polynomial of V . Proposition 4.2. There is a bihomogeneous polynomial

Φ d ∈ K[c, x] with (4.3) deg c (Φ d ) = n k=1 n! k and deg x (Φ d ) = d n k=1 n! k -(n + 1)!
such that, for any squarefree homogeneous polynomial f ∈ K[x] of degree d,

(4.4) ρ Z(f ) (x) = Φ d (f, x).
It is uniquely determined modulo F in the ring K[c, x] by the condition that, for any linear form ∈ K[x],

(4.5) R F, ≡ n! Φ d mod F.
Proof. Adapting the proof of Theorem 3.9 to the present situation, we can show the existence of a bihomogeneous polynomial Φ d ∈ K[c, x] satisfying the congruence (4.5) for any linear form ∈ K[x]. The formulae (4.3) for the degrees of Φ d in the variables c and x follow from this congruence and the corresponding formulae for R F, in (4.2). For a squarefree homogeneous polynomial f ∈ K[x] of degree d, the congruence (4.5) can be evaluated into the coefficients of f , specializing to

R Z(f ), ≡ n! Φ d (f ) mod f.
The equality (4.4) then follows from the unicity of ρ Z(f ) modulo f . Proof. Set for short R = R F,y 0 . By Proposition 2.1, (4.6) R = Res y 1,...,n (F 1 (x, 0, y ), . . . , F n (x, 0, y )) where y denotes the set of variables {y 1 , . . . , y n }. Hence R(1, 0, . . . , 0) = Res y 1,...,n (F 1 ((1, 0, . . . , 0), (0, y )), . . . , F n ((1, 0, . . . , 0), (0, y ))) and, for j = 0, . . . , d, (4.7)

F j ((1, 0, . . . , 0), (0, y

)) = j! a c d-j,a y a 1 1 . . . y a n n ∈ K[c, y ],
the sum being over the vectors a ∈ N n of length j. We deduce that R(1, 0, . . . , 0) coincides, up to a nonzero scalar, with the resultant of n generic polynomials in n variables of degrees 1, 2, . . . , n. In particular, it is irreducible.

Lemma 4.5. The polynomial R F,y 0 does not depend on the variable c d,0,...,0 , and it is irreducible in K[c, x] x 0 .

Proof. The first statement follows from the formula (4.6) and the fact that the polynomials F k (x, 0, y ), k = 1, . . . , n, do not depend on c d,0,...,0 and so neither does R, which gives the first statement.

To prove the second one, set again R = R F,y 0 and consider a factorization

R = Q 1 Q 2 with Q 1 , Q 2 ∈ K[c, x] x 0 . Since R is a bihomogeneous polynomial in K[c, x],
we can assume that its factors are also of this kind. By Lemma 4.4, R(1, 0, . . . , 0) is an irreducible polynomial in K[c] and so one of these factors, say Q 1 , has degree 0 in the variables c or equivalently, does not depend on the coefficients of F . For each choice of p ∈ P n \ Z(x 0 ), we can construct a squarefree homogeneous polynomial f of degree d such that p is not a flex point of Z(f ), and a linear form such that (p) = 0. Proposition 3.8 then implies that R(p) = 0 and, a fortiori, Q 1 (p) = 0. Hence Q 1 is a unit of K[c, x] x 0 and R is irreducible, concluding the proof.

Lemma 4.6. The ideal (F, Φ d ) ⊂ K[c, x] is of height 2, and x 0 is not a zero divisor modulo this ideal.

Proof. Set again R = R F,y 0 for short. By Lemma 4.5, this polynomial does not depend on the variable c d,0,...,0 . Hence, it is coprime with F , as F is irreducible. By Proposition 4.2, R ≡ x n! 0 Φ d mod F , and so Φ d is also coprime with F , giving the first statement. For the second statement, set F = F (0, x 1 , . . . , x n ) and Φ d = Φ d (0, x 1 , . . . , x n ), so that

F ≡ F and Φ d ≡ Φ d mod x 0 .
Again by Proposition 4.2,

R F,yn (0, x 1 , . . . , x n ) ≡ x n! n Φ d mod F .
With the same arguments as for the previous case, we deduce that F and Φ d are coprime. Hence x 0 , F, P is a regular sequence in K[c, x]. Since F, Φ d is a regular sequence in K[c, x] and this ring is Cohen-Macaulay, the associated primes of the ideal (F, Φ d ) are of height 2. Since x 0 , F, Φ d is also a regular sequence, x 0 does not lie in any of these associated primes and so this variable is not a zero divisor modulo (F, Φ d ), as stated.

Lemma 4.7. The ideal (F, Φ d ) ⊂ K[c, x] is prime.

Proof. By Lemma 4.6, x 0 is not a zero divisor modulo (F, Φ d ) and so the morphism

K[c, x]/(F, Φ d ) -→ K[c, x] x 0 /(F, Φ d )
is an inclusion. Hence, it is enough to prove that the ideal (F, Φ d ) ⊂ K[c, x] x 0 is prime. Thanks to (4.5) applied with = x 0 , we obtain an isomorphism

K[c, x] x 0 /(F, Φ d ) -→ K[c, x] x 0 /(F, R F,y 0 )
and we are reduced to show that (F, R F,y 0 ) ⊂ K[c, x] x 0 is prime.

Set c = c \ {c d,0,...,0 } and write F = c d,0,...,0 x d 0 + F with F ∈ K[c , x]. As R F,y 0 does not depend on c d,0,...,0 by Lemma 4.5, we get a well-defined isomorphism

K[c , x] x 0 /(R F,y 0 ) -→ K[c, x] x 0 /(F, R F,y 0 ).
By Lemma 4.5 again, R F,y 0 is irreducible in K[c , x] x 0 , and the statement follows.

Proof of Theorem 4.1. Setting N = d+n n -1, let Y be the subscheme of P N × P n defined by F and Φ d . By Lemmas 4.6 and 4.7, this is an irreducible variety of dimension N + n -2. Let π : Y -→ P N the map induced by the projection onto the second factor.

For a generic choice of α ∈ P N , the homogeneous polynomial F (α, x) ∈ K[x] is squarefree and, by Proposition 4.2 and Theorem 3.9, its fiber π -1 (α) identifies with the flex locus of the hypersurface of P n defined by this polynomial. The same result implies that the dimension of this flex locus is either n -1 or n -2. Since Y has dimension N + n -2, the theorem of dimension of fibers implies that π -1 (α) has dimension n -2.

Finally, the fact that Y is a variety and Bertini's theorem [Jou83, Théorème 6.3(3)] imply that this fiber is reduced, completing the proof.

Generic flex points

For a squarefree homogeneous polynomial f ∈ K[x] of degree d ≥ n and a flex point p of the hypersurface Z(f ), we consider the following properties:

(1) there is a unique flex line of Z(f ) at p;

(2) for a flex line L of Z(f ) at p, if d = n, then L is contained in Z(f ) whereas if d > n, then the order of contact of L with Z(f ) at p is equal to n + 1.

In this section we prove the next result, corresponding to Theorem 1.4(2) stated in the introduction.

Theorem 5.1. Let f ∈ K[x] be a generic homogeneous polynomial of degree d ≥ n, and p a generic point of Flex(Z(f )). Then (f, p) satisfies the conditions (1) and (2).

We begin with some notation and preliminary results. For d ≥ 0, set N = d+n n -1 and let P N be the projective space of nonzero homogeneous forms of degree d modulo scalar factors. For k = 0, . . . , d, we introduce the incidence subvariety Γ k = Z(F 0 , . . . , F k ) ⊂ P N × (P n \ Z(x 0 )) × Z(x 0 ), with Z(x 0 ) the hyperplane at infinity of P n and F 0 , . . . , F k as in (4.1).

Lemma 5.2. The subvariety Γ k is irreducible and has dimension N + 2n -k.

Proof. Consider the surjective map pr 1 : Γ k → (P n \ Z(x 0 )) × Z(x 0 ) induced by the projection onto the last two factors. To study the fibers of this map over a point (p, q), we can reduce to the case p = (1 : 0 : • • • : 0), by applying a suitable linear change of coordinates.

For a point q ∈ Z(x 0 ), the identities in (4.7) imply that F j ((1, 0, . . . , 0), q), j = 0, . . . , k, are nonzero linear forms in the variables c depending on disjoint subsets of variables, and so they are independent. Hence the fiber pr -1 1 ((1, 0, . . . , 0), q) is a linear space of dimension N -k, and a similar statement holds for any pair of points (p, q). Thus Γ k is a geometric vector bundle of dimension N -k -1 over the base space (P n \ Z(x 0 )) × Z(x 0 ). Since this base is irreducible and has dimension 2n -1, the subvariety is also irreducible and has dimension N + 2n -k, as claimed.

For the special case k = n, the subvariety Γ n consists of the triples (f, p, q) where f is a homogeneous polynomial of degree d, p ∈ P n \ Z(x 0 ) is a flex point of the hypersurface Z(f ), and q ∈ Z(x 0 ) determines a flex line passing through p. Let Ω ⊂ P N × (P n \ Z(x 0 )) denotes the set of pairs (f, p) where p ∈ P n \ Z(x 0 ) is a flex point of Z(f ), and

(5.1) π : Γ n -→ Ω the map induced by the projection of P N × (P n \ Z(x 0 )) × Z(x 0 ) onto its first two factors.

Proposition 5.3. The map π is birational.

Proof. Since π is the restriction to the irreducible subvariety Γ n of the proper map P N × (P n \ Z(x 0 )) × Z(x 0 ) -→ P N × (P n \ Z(x 0 )), its image Ω is also an irreducible subvariety. Indeed, by Proposition 3.8 and Proposition 4.2, it is the subvariety of P N × (P n \ Z(x 0 )) defined by the polynomials F and R F,y 0 .

In both cases, there is a dense open subset T of P N such that, for each f ∈ T , we have that f is squarefree and there is a dense open subset U f of the flex locus of Z(f ) such that for each p ∈ U f , the pair (f, p) satisfies the conditions (1) and (2), completing the proof.

Theorem 4. 1 .

 1 Let d ≥ n and f ∈ K[x] a generic homogeneous polynomial of degree d. Then Flex(Z(f )) is a reduced subscheme of Z(f ) of dimension n -2. In particular (1) Z(f ) has no ruled components; (2) the flex locus of Z(f ) is the complete intersection of two hypersurfaces of respective degrees d and d n k=1 n! k -(n + 1))!; (3) the degree of the flex locus of Z(f ) is equal to d 2 n k=1 n! k -d(n + 1)!. Let d ≥ n and consider the general polynomial of degree d in the variables x F = |a|=d c a x a , the sum being over the vectors a ∈ N n+1 of length d. Put c = {c α } |α|=d for the set of n+d n variables corresponding to the coefficients of F . Thus, F is an irreducible polynomial in K[c, x], bihomogeneous of bidegree (1, d).

Remark 4. 3 .

 3 By the definition of the resultant, as recalled in Section 2, the universal polynomial Φ d can be chosen as a primitive polynomial with integer coefficients, that is as an irreducible polynomial in Z[c, x]. Lemma 4.4. The polynomial R F,y 0 (1, 0, . . . , 0) is irreducible in K[c].

The inversion property of the resultant (Proposition 2.3), implies that the map π is invertible on the open subset of points (f, p) ∈ Ω where (5.2) ∂ Res y (1,...,n,1) ∂c i 0 ,a 0 (f 1 (p, y), . . . , f n (p, y), y 0 ) = 0 for a representative p ∈ K n+1 \ {0} of p and a pair of indices 0 ≤ i 0 ≤ n -1 and a 0 ∈ N n+1 with |a 0 | = i 0 + 1.

We next want to prove that this open subset is nonempty. To this end, it is enough to show that there is a point (f, p 0 ) in Ω with p 0 = (1 : 0 • • • : 0) ∈ P n \ Z(x 0 ) satisfying at least one of the inequations (5.2). We have that F (1, 0, . . . , 0) = c d,0,...,0 and, by Lemma 4.5, the polynomial R F,y 0 does not depend on this variable. Thus (f, p 0 ) ∈ Ω if and only if it satisfies the independent conditions (5.3) c d,0,...,0 = 0 and R Z(f ),y 0 (1, 0, . . . , 0) = 0.

By (4.7), each of the evaluations in (5.2) for the point (f, p 0 ) coincide, up to a fixed (that is, neither depending on i 0 nor on a 0 ) nonzero scalar factor, with

where ∇R F,y 0 denotes the gradient operator. By Lemma 4.4, R F,y 0 is an irreducible polynomial, and a fortiori squarefree. Hence, the condition (5.4) is verified for a generic f satisfying (5.3). We deduce that the map π is invertible on a nonempty open subset of Ω. Since Ω is irreducible, such an open subset is dense, and so π is birational.

Proof of Theorem 5.1. By Proposition 5.3, there are dense open subsets U ⊂ Γ n and W ⊂ Ω such that the restriction of the map π in (5.1) to these subsets is an isomorphism. In particular, for each (f, p) ∈ W there is a unique flex line passing through the point p.

If d = n, then any such flex line has order of contact at least n + 1 at the point p, and so it is necessarily contained in Z(f ).

If d > n then Γ n+1 is a proper subvariety of Γ n by Lemma 5.2. By Lemma 3.4(1), for each (f, p, q) ∈ U \ Γ n+1 , the line passing by p and q has order of contact equal to n + 1. Hence, every pair (f, p) in the dense open subset W := W \ π(Γ n+1 ) of Ω satisfies both conditions (1) and (2).

Set Z = Ω \ W and consider the map : Z → P N defined by (f, p) → f . If this map is not dominant, then for f ∈ P N \ (Z) we have that {f }×Flex(Z(f )) is disjoint from Z, giving the statement in this case.

Otherwise, by the theorem of dimension of fibers [Sha94, §1.6, Theorem 7], there is a dense open subset T ⊂ P N such that, for f ∈ T , dim( -1 (f )) = dim(Z) -dim(P N ) < n -2.

On the other hand, dim(Flex(Z(f ))) is either n -1 or n -2. Hence for all f ∈ T , no component of {f } × Flex(Z(f )) can be contained in Z.